I'm currently creating an algorithm to detect incorrectly sandblasted components via image.
I've separated the component from the background, but need to detect the defect (depicted by more "sparkly bits"). I assume that I could compare the quantity of white pixels ("sparkly bits") with a healthy component in order to detect the defect. How can i measure the quantity of white pixels?
This may be a broad question but any direction would be greatly appreciated.