# Algorithm for detect similar photos

Hello to everyone, I wanted to ask you advice. My goal is to create an algorithm that succeeds with a good percentage, to see if two pictures are similar. I have a master photo and all the photos i want to compare with this to see if they are "the same". I wanted to divide the algorithm in 3 points.

1)Load photo to compare and adjust brightness, contrast, histogram 2)I adjust the perspective by calculating matrix h with the original photo 3)I make the difference between the master picture and this (absdiff)

My problem is: how do I get a similar picture to that master in brightness and contrast

edit retag close merge delete

Sort by ยป oldest newest most voted

don't reinvent the wheel.

since lately, there's a new img_hash module in opencv_contrib, that should do exactly, what you need.

(get latest opencv3 master + latest opencv_contrib)

more

I can use this form to know if the pictures are similar but after I have to extract the differences. Can i do it directly with adsdiff?

( 2017-07-03 06:03:01 -0500 )edit

sure, but why ?

( 2017-07-03 06:10:59 -0500 )edit

I explain: I do a series of photos to a target. If the photographs are the same, they have not fired. If I find a difference in the photographs then I suppose they fired. To find where they shot I searched for circumferences. When I have to find the next hole I do not use the original photograph anymore but the one where the first hole is. I wanted to find the difference between the two pictures to do this

( 2017-07-03 06:50:21 -0500 )edit

hole ? fired ?

i don't think, i understood anything from the last comment.

( 2017-07-03 07:11:31 -0500 )edit

Sorry for my bad English. What did you not understand? I try to explain this again

( 2017-07-03 07:27:01 -0500 )edit

tbh, i did not understand any of it, and yes, please try again !

(if there are examplle images, maybe you can add them to your question ? (there is an upload image button)

( 2017-07-03 07:39:11 -0500 )edit

ok. My goal is to look a target with a cam. The target is this: https://www.dropbox.com/s/s64vekyb5g3...

I would like to calculate the x / y position of the hole. example: https://www.dropbox.com/s/d5vvt0d9gwd...

As you can see the second photo has the target slightly moved. How can I get a good result?

ps: It may happen that the images have different brightness, example: https://www.dropbox.com/s/ncl0wl07e1m...

( 2017-07-03 08:31:56 -0500 )edit

now, please look again, at how thisquestionstarted, and ask yourself, how on earth could we ever have guessed, what you mean ? (it's a totally different question !)

( 2017-07-03 08:46:54 -0500 )edit

You're right. You know how to help me? Can you give some advice on how to get a good result?

( 2017-07-03 09:05:30 -0500 )edit