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

Help needed!!, ORB matching - How train pattern using image from image folder instead of webcam. #79

Open
rohitkshirsagar opened this issue Dec 18, 2017 · 3 comments

Comments

@rohitkshirsagar
Copy link

Could you please help me into it.

@jinoantony
Copy link

jinoantony commented Dec 26, 2017

just get the image data using canvas

var image = new Image();
image.src = "image.jpg";

var c = document.getElementById("myCanvas");
var ctxx = c.getContext("2d");
c.width = image.width;
 c.height = image.height;
ctxx.drawImage(image, 0, 0, image.width, image.height);
var imgData = ctxx.getImageData(0, 0, c.width, c.height);

var imgg = new jsfeat.matrix_t(image.width, image.height, jsfeat.U8_t | jsfeat.C1_t);
jsfeat.imgproc.grayscale(imgData.data, image.width, image.height, imgg);

//Finally change this line in train_pattern()
jsfeat.imgproc.resample(img_u8, lev0_img, new_width, new_height);
//to this
jsfeat.imgproc.resample(imgg, lev0_img, new_width, new_height);

@jinoantony
Copy link

jinoantony commented Dec 29, 2017

@rohitkshirsagar
Copy link
Author

@jinoantony Thank yo so much for your help !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants