Image spot detection in Python
I do not know if there is a library but you could segment these areas using a simple thresholding segmentation algorithm. Say, you want to find red spots. Extract the red channel from the image, select a threshold, and eliminate pixels that are below the threshold. The resulting pixels are your spots. To find a suitable threshold you can build the image's red channel histogram and find the valley there. The lowest point in the valley is the threshold that you could use. If there are more than one valley, smooth the histogram until there is one valley and two peaks. You can use a Gaussian function to smooth the histogram. To find the spots from the remaining pixels you can use the labeling algorithm and then find the connected components in the graph that the labeling algorithm produced. Yes, it is simple. :)
I have millions of images containing every day photos. I'm trying to find a way to pick out those in which some certain colours are present, say, red and orange, disregarding the shape or object. The size may matter - e.g., at least 50x50 px.
Is there an efficient and lightweight library for achieving this? I know there is OpenCV and it seems quite powerful, but would it be too bloated for this task? It's a relatively simple task, right?
Thanks