-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding features track functionality to the project #7
Conversation
- post vWidth and vHeight to the worker - missed ConfigData
- increased number of ORB features - disabled blurring for now
@@ -43,7 +43,12 @@ const loadTrackables = async (msg: any) => { | |||
let src = msg.data; | |||
let refRows = msg.trackableHeight; | |||
let refCols = msg.trackableWidth; | |||
let mat = new cv.matFromArray(refRows, refCols, cv.CV_8UC4, src); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't correct, infact logging the mat
it gives me an Unbinding error, though i have no errors in the console.
src/Workers/Worker.ts
Outdated
//var mat = new cv.Mat(imageData.height, imageData.width, cv.CV_8UC4); | ||
let mat = new cv.Mat(refRows, refCols, cv.CV_8UC4); | ||
//mat.data.set(imageData.data); | ||
mat.data.set(src.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i found this snippet from helpers.js opencv code, see matFromImageData:
Module['matFromImageData'] = function(imageData) {
var mat = new cv.Mat(imageData.height, imageData.width, cv.CV_8UC4);
mat.data.set(imageData.data);
return mat;
};
src/Workers/Worker.ts
Outdated
|
||
let ksize = new cv.Size(BlurSize, BlurSize); | ||
let anchor = new cv.Point(-1, -1); | ||
cv.blur(mat, mat, ksize, anchor, cv.BORDER_DEFAULT); | ||
//cv.blur(mat, mat, ksize, anchor, cv.BORDER_DEFAULT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding blur make more difficult to detect, i will leave out this, maybe i need to adjust the settings.
src/Workers/Worker.ts
Outdated
template_keypoints_vector = new cv.KeyPointVector(); | ||
|
||
template_descriptors = new cv.Mat(); | ||
|
||
let noArray = new cv.Mat(); | ||
|
||
let orb = new cv.ORB(3000); | ||
let orb = new cv.ORB(10000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to increase the number of features, it gives more matches.
src/Workers/Worker.ts
Outdated
|
||
let ksize = new cv.Size(BlurSize, BlurSize); | ||
let anchor = new cv.Point(-1, -1); | ||
cv.blur(src, src, ksize, anchor, cv.BORDER_DEFAULT); | ||
//cv.blur(src, src, ksize, anchor, cv.BORDER_DEFAULT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above.
src/Workers/Worker.ts
Outdated
|
||
var frame_keypoints_vector = new cv.KeyPointVector(); | ||
|
||
var frame_descriptors = new cv.Mat(); | ||
|
||
var orb = new cv.ORB(); | ||
var orb = new cv.ORB(10000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
cv.perspectiveTransform is wrapped in a different way from C++ it require cv.Mat as args, struglled a bit with this. |
regarding the last comment, when testing the
this error happens only with htat example because the homography is not valid (because at the start it's not recognizing any pattern), it's empty and that's why that message. This routine:
should be placed after the findHomography function. i will fix this. |
- rebuilding libs and improved github actions scripts
In check if homograpy is valid commit testing the example_image the result is |
Tracking feature
The code can only compute keypoints and descriptors for the trackable. I will implement also the tracking functionality.
This codes will be derived most from webarkit-testing and wasm-ar, even if they are coded with C++, i think it can be easily translated to js.
I will add inside
WebARKitCV
a track method, with a trackables argument and a Promise structure.So you will be able to pass matrix data to trackers; it will be independent from any 3d is rendering library.
List of features:
simple VideoCapture method for video stream.cameraViewRenderer class for video stream to be exportedFor the future...
Things to improve in the near future.