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

Same photo with different brightness #2

Open
nibalk opened this issue Feb 14, 2014 · 4 comments
Open

Same photo with different brightness #2

nibalk opened this issue Feb 14, 2014 · 4 comments
Assignees

Comments

@nibalk
Copy link

nibalk commented Feb 14, 2014

Thanks for the great effort. Need some help to solve the below mentioned issue.
I have noticed that if we use the same photo with different brightness it consider that two photos as "Not duplicates".
I have tried below example, but didn't work.
Imgproc.cvtColor(img1, img1, Imgproc.COLOR_RGB2HSV);
Imgproc.cvtColor(img2, img2, Imgproc.COLOR_RGB2HSV);

Could you please help me with this ?
Thanks!

@torcellite
Copy link
Owner

You could convert both images to grayscale and then check for similarities.

@nibalk
Copy link
Author

nibalk commented Feb 17, 2014

Thanks for the quick reply.
Does it mean that we have to do something like this ?
Imgproc.cvtColor(img1, img1, Imgproc.COLOR_RGBA2GRAY);
Imgproc.cvtColor(img2, img2, Imgproc.COLOR_RGBA2GRAY);
Or simply use the Android way of grayscale the image ?
Thanks!

@torcellite
Copy link
Owner

The code you've written above should do it.
On Feb 17, 2014 12:21 PM, "nibalk" notifications@github.com wrote:

Thanks for the quick reply.
Does it mean that we have to do something like this ?
Imgproc.cvtColor(img1, img1, Imgproc.COLOR_RGBA2GRAY);
Imgproc.cvtColor(img2, img2, Imgproc.COLOR_RGBA2GRAY);
Or simply use the Android way of grayscale the image ?
Thanks!

Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-35232441
.

@nibalk
Copy link
Author

nibalk commented Feb 18, 2014

oopsss! Even if I tried it still it can't identify it as duplicate images :) I will have a look again.

Do you have any idea how to change the code to show only the mismatching areas of the two images. Currently it's showing the matching areas using green color lines. I want to do it the other way round. I have already tried passing the mismatches to below method. But didn't work.

I might be doing some crazy thing. :) I have no idea of OpenCV API. Any good resource to refer it.

Thanks!

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Features2d.drawMatches(img1, keypoints, img2, dupKeypoints,
missmatches,
img3, GREEN, RED, drawnMatches, Features2d.NOT_DRAW_SINGLE_POINTS);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
for (int i = 0; i < totalMatchCount; i++) {
if (matchesList.get(i).distance <= min_dist) {
matches_final.add(matchesList.get(i));
} else {
missmatches_temp.add(matchesList.get(i));
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@torcellite torcellite self-assigned this Sep 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants