Automatic detection of bottle caps
Use K-means, Canny edge detection and Hough transform to detect bottle caps. And then tell you good or bad.
- Hough transform - https://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
- Paper - https://ieeexplore.ieee.org/document/8844942
step1 - Set image cluster number.
step2 - Image preprocessing (set same size, Gaussian Blur).
step3 - Use K-means's output to search quickly bottle caps's cluster(which group).
step4 - Canny edge detection
step5 - Hough transform (vector space -> parameter space)
step6 - bad status condition -> 80<=theta | theta<=-80 , good status condition -> 87<=theta | theta<=-87.
step7 - If there is a bad straight line, we sa this bottle is bad status.