image – How to find and highlight missing white “objects” in Python using OpenCV


I am trying to solve a problem in Python using OpenCV. I have to create a function which will return if input image (toothed wheel) is OK or NOK and will also additionaly highlight defects (missing teeth).

Original images:
Original image which is NOK
and
Original image which is OK

I created an image which represents the one with all teeth (white “objects”) – OK image:
Image used as a “mask”

Second image is missing 2 teeth (white “objects”) – NOK image:
Image with 2 teeth missing

The problem I am trying to solve is that i would like to highlight these missing white “objects”. It should look similar to this:
Function output

I will be very grateful for any help.

I don’t have idea how to solve this problem.
The problem might be that these white “objects” (teeth) in “black and white” images are actually not exactly the same.



Source link

Leave a Comment