# Revision history [back]

On-topic. Thank you for answer. I don't get what specific (if any) kind of approach do you have in mind with this:

For each piece I would extract the dangley/hole bits so that they are flat on one side, and rectify them so that all the flat sides face one way. I hope that makes sense

Indeed it makes a lot of sense and i was asking close thing:

I think i could draw straight lines connecting proper corners, then any white color outside that contour would be bulge and any black color inside would be hole. I believe they even would be detected by .findBlobs().

But how? I can find exterior points using .contour and .boundingBox but can't easily tell apart corners from bulges because pieces may be rotated. Do you have any specific algorithm or direction in mind? It's not obvious to me. I guess i could make some analysis on angle of corner and select those closer to 90, but lacking that level of math skill it starts to be very complicated or probabilistic. I am all for probabilistic models but complicated ones tend to break.

Off-topic. Thanks for karma adjustment. I've updated post with links, hopefully it looks more attractive now. Next problem is that i can't comment your answer, so have to use new answer.