Skip to content

Commit

Permalink
this seems better not completely solve
Browse files Browse the repository at this point in the history
Uncaught exception in processFrame #11
  • Loading branch information
kalwalt committed Apr 24, 2023
1 parent 3809be5 commit 54bd86c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions examples/index_akaze.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var videoEl;
var arElem;
var grayScaleVideo;
var grayScaleImage;
var grayVideoData;
var overlayCanvas;
var videoCanvas;
var stats;
Expand Down Expand Up @@ -51,22 +52,26 @@ window.onload = async function () {
switch (msg.type) {
case "loadedTracker": {
hideLoading();
process();
break;
}
case "found": {
found(msg);
process();
break;
}
case "not found": {
found(null);
process();
break;
}
}
process();
//process();
};

let update = () => {
stats.begin();
grayVideoData = grayScaleVideo.getFrame();
const videoCanvasCtx = videoCanvas.getContext("2d");
videoCanvasCtx.drawImage(videoSource, 0, 0, oWidth, oHeight);
stats.end();
Expand All @@ -90,12 +95,11 @@ window.onload = async function () {
}

function process() {
var grayVideoData = grayScaleVideo.getFrame();
if (grayVideoData) {
worker.postMessage({ type: "process", data: grayVideoData });
}
}
//process();
update();
};

async function initVideo() {
Expand Down
10 changes: 7 additions & 3 deletions examples/index_orb.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var videoEl;
var arElem;
var grayScaleVideo;
var grayScaleImage;
var grayVideoData
var overlayCanvas;
var videoCanvas;
var stats;
Expand Down Expand Up @@ -51,22 +52,26 @@ window.onload = async function () {
switch (msg.type) {
case "loadedTracker": {
hideLoading();
process();
break;
}
case "found": {
found(msg);
process();
break;
}
case "not found": {
found(null);
process();
break;
}
}
process();
//process();
};

let update = () => {
stats.begin();
grayVideoData = grayScaleVideo.getFrame();
const videoCanvasCtx = videoCanvas.getContext("2d");
videoCanvasCtx.drawImage(videoSource, 0, 0, oWidth, oHeight);
stats.end();
Expand All @@ -90,12 +95,11 @@ window.onload = async function () {
}

function process() {
var grayVideoData = grayScaleVideo.getFrame();
if (grayVideoData) {
worker.postMessage({ type: "process", data: grayVideoData });
}
}
//process();
update();
};

async function initVideo() {
Expand Down

0 comments on commit 54bd86c

Please sign in to comment.