How to compare two black curves on a white background? How to do it as fast? For example
this

and this

are similar, but this

and this

are not
First curve I’ll draw on JPanel, second is image.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have an idea. Not sure that it is the best one, but somehow it allows to evaluate the coefficient of similarity of two cruves.
Lets make a matrix for each cruve putting 1 for black pixels and 0 for white ones. Now if we want to compare two cruves with matrixes
aandbat first we should construct third matrixcwhere:Then we will denote by
Scount of cells wherec[i][j] != 0, and byTcount of cells wherec[i][j] == 2. And at last two cruves are similar ifT / S > 1 - eps, whereepsyou should choose yourself according what accuracy you want to get.