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

AndroidFrameConverter and OpenCVFrameConverter #155

Closed
deddygnwn14 opened this issue May 25, 2015 · 3 comments
Closed

AndroidFrameConverter and OpenCVFrameConverter #155

deddygnwn14 opened this issue May 25, 2015 · 3 comments
Labels

Comments

@deddygnwn14
Copy link

Based on my last issue #152 (comment)
I learn how to use them from another post and I did it like this

protected void processImage(byte[] data, int width, int height) {
int f = SUBSAMPLING_FACTOR;
if (grayImage == null || grayImage.width() != width/f || grayImage.height() != height/f) {
grayImage = IplImage.create(width/f, height/f, IPL_DEPTH_8U, 1);
}
bgrFrame = IplImage.create(width/f, height/f, IPL_DEPTH_32F, 3);
frameCvt = new AndroidFrameConverter();
OpenCVFrameConverter.ToIplImage converter = new OpenCVFrameConverter.ToIplImage();
bgrFrame = converter.convertToIplImage(frameCvt.convert(dataGambar, width/f, height/f,));

But the result is the image that contained by bgrFrame is like this

croppedimage_20150525_104526 1
croppedimage_20150525_104530 1

Did I do it wrong?

@saudet
Copy link
Member

saudet commented May 25, 2015

Call AndroidFrameConverter.convert() this way: convert(data, width, height)

@saudet saudet closed this as completed May 25, 2015
@deddygnwn14
Copy link
Author

It works! thank you for your help :D
But it become slow because the image is too large. But thanks 👍

@saudet
Copy link
Member

saudet commented May 26, 2015

We can use OpenCV for faster conversion, something like shown in #156.

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

No branches or pull requests

2 participants