Quality control system for eraser factory
Hello all,
My question is a mix between "how to do the task in a quickly and professional way" because I'm a completely amateur and "how can I change my (probably) wrong pipeline" (any advice would be very appreciated.
*Problem to solve:*
I'm developing a system (it's university last year practicum) to detect if an eraser is in between some quality standards. My system should detect if the eraser:
- Has good area
- Has an obvius defect in form
- If the logo's position is right
- If the logo is different (for example, another barcode)
- If the barcode's position is right
- If the printing is right
Here are some images to put you in context:
The first eraser at the top is right,
It's difficult to see, but this is a little bit sharper (different form) and should not pass de Quality Control (QC)
You can also have rubber's like:
These will be droped in some part of the pipeline
Taking the first image as a good eraser, the system should determine orientation of the eraser (how many degrees is turned) from a given 0º. This rotation should be the same for all the production. For example, imagine that 0º is the rubber with text in vertical (reading like humans), but it can be any other if it's consistent and not to much difficult to read.
Some guidelines are given by the tutor:
Detect the mask of the rubber and also, the logo. Sectorize it! (how?) If there is a size/form defect, as the system will discard the eraser, cut the anylisis
My developed pipeline is as follows:
- Binary Threshold (type = 3) with salt noise.
- Canny Edge Detector
- Contours Detection (I'll use the bigger one)
- Mask
- Crop to the region of interest (bounding box of the eraser). As you can see, contours is taking also the salt noise close to the rubber making it not perfect. Do you know how to improve it?
- Some nice's algorithms founded on the net that I'll show the results.
Detect hough lines, trying to determine a triangle (for sure there are more easier ways)
Detect the logo with a black-hat, Ellipse, Kernel = 24 - 38. My teacher gives me the idea to catch only logo's pixels but I have no idea how to do it in a proper way
Detect which pixels are inside or outside the contourn (as a previous to detect logo's pixels) I attach pointPolygonTest as given!
And the final, SURF detector taken from: https://www.youtube.com/watch?v=6UgyH...
Finally, any usefull link showing how to solve some situation woul be great. My backproblem is that I don't know ho to search solutions of the problem on the internet.
I really like what you are trying to achieve! Do you have a pincushion distortion in every Photo you take of the Eraser? With the Surf Detector in the end, you should make some tests with false and right eraser. You need to get a proper threshold of matches that you let pass. I think that would probably difficult. In addition, you could only check the Print on the Eraser with SURF, but you also try to detect it through black-hat? I think you can drop the Surf at the End, when you already check the Print with the black-hat.
But I'm using SURF because it was able to detect rotation, and i feel like we are using an atomic bomb to kill some rats in a house
Related to SURF, how many points should I use? At university the told me that only 3 points are necessary to only known which is the rotation and movement... because there is no perspective change between all images (are taken from the same place)
when you use the example Image above from Sift, it would be enough when you have 3-5 points to recognize the Object. Even if you only have the first image 5 would be a quite good number I think (but you should better test that!). Still, I'm not quite sure, what would be the usability of your SURF detection.