i want to compare to components with their filled colors if they are equal or not i do the following algorithm , i do averaging for the rgb as following
double avg1 =(comp[0].Red+comp[0].Blue+comp[0].Green)/3;
double avg2 =(comp[1].Red+comp[1].Blue+comp[1].Green)/3;
then compare them as following
double ratio = avg1/avg2 ;
if(ratio > 0.8 && ratio < 1.2){} //then they are supposed to be equal
but this way isn't accurate at all
after searching i found that the best way is converting the image to HSL space and compare but i can't get how i compare 2 colors ?!! here
in other words after converting the image into HSL space what can i do ?!
help please !!
modification to the question for more clarification i mean with component (sequence of points) so in the averaging step actually i revisit all the points calculating the sum of the average of rgb for each pixel , then do averaging over the total number of the points