Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improving transmatrix and related functions #26

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,810 changes: 7,669 additions & 5,141 deletions build/webarkit_ES6_wasm.js

Large diffs are not rendered by default.

12,810 changes: 7,669 additions & 5,141 deletions build/webarkit_ES6_wasm.simd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/GrayScale.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/WebARKit.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions emscripten/WebARKitJS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ void WebARKit::initTrackerGray(emscripten::val data_buffer, int width, int heigh
manager.initTracker(u8.data(), width, height, colorSpace);
}

void WebARKit::processFrame(emscripten::val data_buffer, webarkit::ColorSpace colorSpace, bool enableBlur) {
void WebARKit::processFrame(emscripten::val data_buffer, webarkit::ColorSpace colorSpace, webarkit::BLUR_TYPE blurType) {
auto u8 = emscripten::convertJSArrayToNumberVector<uint8_t>(data_buffer);
manager.processFrameData(u8.data(), this->videoWidth, this->videoHeight, colorSpace, enableBlur);
manager.processFrameData(u8.data(), this->videoWidth, this->videoHeight, colorSpace, blurType);
}

void WebARKit::setLogLevel(int logLevel) { manager.setLogLevel(logLevel); }
Expand Down
2 changes: 1 addition & 1 deletion emscripten/WebARKitJS.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class WebARKit {
}

void initTrackerGray(emscripten::val data_buffer, int width, int height, webarkit::ColorSpace colorSpace);
void processFrame(emscripten::val data_buffer, webarkit::ColorSpace colorSpace, bool enableBlur);
void processFrame(emscripten::val data_buffer, webarkit::ColorSpace colorSpace, webarkit::BLUR_TYPE blurType);
void setLogLevel(int logLevel);
emscripten::val getHomography();
emscripten::val getPoseMatrix();
Expand Down
2 changes: 1 addition & 1 deletion emscripten/WebARKitLib
Submodule WebARKitLib updated 20 files
+3 −3 .github/workflows/test.yml
+7 −1 WebARKit/CMakeLists.txt
+6 −2 WebARKit/WebARKitManager.cpp
+37 −5 WebARKit/WebARKitPattern.cpp
+60 −0 WebARKit/WebARKitTrackers/WebARKitOpticalTracking/TrackedPoint.cpp
+194 −0 WebARKit/WebARKitTrackers/WebARKitOpticalTracking/TrackingPointSelector.cpp
+9 −2 WebARKit/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.cpp
+20 −0 WebARKit/WebARKitTrackers/WebARKitOpticalTracking/WebARKitHomographyInfo.cpp
+511 −163 WebARKit/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.cpp
+61 −0 ...it/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/TrackedPoint.h
+64 −0 ...KitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/TrackerVisualization.h
+94 −0 ...itTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/TrackingPointSelector.h
+7 −0 .../WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h
+6 −0 ...t/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitEnums.h
+24 −0 ...tTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitHomographyInfo.h
+3 −1 ...WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.h
+71 −1 ...t/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitUtils.h
+3 −1 WebARKit/include/WebARKitManager.h
+8 −0 WebARKit/include/WebARKitPattern.h
+2 −2 tests/webarkit_test.cc
5 changes: 5 additions & 0 deletions emscripten/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ EMSCRIPTEN_BINDINGS(constant_bindings) {
.value("RGB", webarkit::RGB)
.value("GRAY", webarkit::GRAY);

enum_<webarkit::BLUR_TYPE>("BLUR_TYPE")
.value("MEDIAN_BLUR", webarkit::MEDIAN_BLUR)
.value("BOX_BLUR", webarkit::BOX_BLUR)
.value("NONE_BLUR", webarkit::NONE_BLUR);

constant("WEBARKIT_LOG_LEVEL_DEBUG", WEBARKIT_LOG_LEVEL_DEBUG + 0);
constant("WEBARKIT_LOG_LEVEL_INFO", WEBARKIT_LOG_LEVEL_INFO + 0);
constant("WEBARKIT_LOG_LEVEL_WARN", WEBARKIT_LOG_LEVEL_WARN + 0);
Expand Down
32 changes: 4 additions & 28 deletions examples/css/nft-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ html {
}

#loading img {
height: 5em;
height: 5em;
}

#loading span{
#loading span {
color: black;
font-weight: bold;
}
Expand All @@ -35,7 +35,7 @@ html {

margin: 0.5rem;

background-color: rgba( 255,255,255,0.6 );
background-color: rgba(255, 255, 255, 0.6);
border-radius: 6px;
}

Expand All @@ -49,7 +49,6 @@ html {

.stats-item {
margin: 0 0 0.5rem;

}

.stats-item-title {
Expand Down Expand Up @@ -106,29 +105,6 @@ html {
object-fit: cover;
}

#canvas_process {
position: absolute;
left: 0;
top: 0;
z-index: 80;

display: block;
width: 1280px;;
height: 720px;
object-fit: cover;
}

#arvideo {
display: none;
}

#status {
position: absolute;
left:10px;
top: 180px;
background: lightslategrey;
border-radius: 6px;
color: #fff;
padding: 4px;
user-select: none;
}
}
4 changes: 3 additions & 1 deletion examples/initCamera.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
async function initCamera(width, height) {

var aspect = width / height;
const constraints = {
audio: false,
video: {
// using the "environment" rear camera
facingMode: "environment",
// using the "user" front camera
// facingMode: "user",
aspectRatio: { ideal: aspect },
width: width,
height: height
}
Expand All @@ -21,6 +22,7 @@ async function initCamera(width, height) {

return new Promise(resolve => {
video.onloadedmetadata = () => {
video.play();
resolve(video);
};
});
Expand Down
1 change: 1 addition & 0 deletions examples/js/jsfeatNext.js

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions examples/teblid_advanced_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Simple example with WebARKit</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../dist/GrayScale.js"></script>
<script type="text/javascript" src="stats.min.js"></script>
<script>
function setTrackerType(){
return 'teblid';
}
</script>
<script src="worker_setup_advanced.js"></script>
<link rel="stylesheet" href="css/style.css">
</head>

<body>
<div id="stats"></div>
<img id="refIm" src="./data/pinball.jpg" width="1637" height="2048" style="display:none;">
<img id="arElem" src="./data/aframe-k.png"></img>
<div id="loading">Loading Image Tracking Modules...</div>
</body>

</html>
7 changes: 3 additions & 4 deletions examples/threejs_ES6_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<div id="loading" >
<!--<img src="Data/JsartoolkitNFT-logo.gif"/>-->
<img src="data/aframe-k.png"/>
<span class="loading-text">Loading, please wait</span>
</div>
<!--
Expand Down Expand Up @@ -39,9 +39,9 @@
id="video">
</video>
<canvas id="canvas"></canvas>
<canvas width="1280" height="720" id="canvas_process"></canvas>
<!--<canvas width="1280" height="720" id="canvas_process"></canvas>-->
</div>
<img id="refIm" src="./data/pinball.jpg" width="1637" height="2048" style="display:none;">
<!--<img id="refIm" src="./data/pinball.jpg" width="1637" height="2048" style="display:none;">-->
<script src="js/stats.min.js"></script>
<script src="js/three.min.js"></script>
<script>
Expand Down Expand Up @@ -73,7 +73,6 @@
sourceVideo = video;
sourceVideo.width = 1280;
sourceVideo.height = 720;
sourceVideo.play();

// init target canvas
initTargetCanvas();
Expand Down
Loading