I need to compare and rank (give a score) drawings made by a mechanical device: An ideal rectangle would get the score of 100%, and an arbitrary image would get (say) 10%. See attached examples of drawings I want to rank. The next step of this project would be to modify the device and compare the drawings' grades before and after the modification.
Any ideas? techniques?
You could do color segmentation (see my File Exchange ) to split the image between black and yellow. Then get a binary image of the black parts and pass it to bwlabel() to count the number of black blobs. 1 would be a solid outline, and a broken outline would of course give more parts. You could also call imopen() on the yellow mask to get the interior yellow "square" and then look at the Solidity from the regionprops() if you look at the yellow blob. You could look at the area fraction of black lines and compare it to what it would be if the lines were all connected. There are other things too, but that's a start.