It is time to wrap up my quest to automatically detect labels from images in Discogs. If you haven't read it yet, I highly advise reading the previous post for more background information.
In the previous post I explained about edge detection and finding the outer edge. What I did next is that I cropped the image, adapted the size of the mask and then used my proven method with histograms on the cropped image.
The complete method that I use is like this:
For my extremely small set of test images this method allows me to correctly find an extra two labels that I missed using just histograms, so cropping really is necessary and edge detection makes it a lot easier
There are false negatives, as not all of my test images were recognized, mostly because of colours, or because not the entire label is on the picture. There was also one false positive, but it one is very tricky as it looks exactly like a record. My script detects the outer edge as follows:
and you can probably see why it is tricky, so I am giving myself a pass on this one.
So the solution is still not perfect, and manual inspecting is still needed for labels that are reported, but it is slowly getting where I want it to be. Next up is a more extensive test which might take me a few weeks to prepare (as the Discogs API is rate limited) and run.
In the previous post I explained about edge detection and finding the outer edge. What I did next is that I cropped the image, adapted the size of the mask and then used my proven method with histograms on the cropped image.
The complete method that I use is like this:
- use a donut shaped mask and compute histograms to see if there is a label (only works for perfectly cropped and centered images of labels)
- if no label was found try to detect outer edges
- if only one outer edge is found, crop the image, resize the donut shaped mask and try the histogram method again
For my extremely small set of test images this method allows me to correctly find an extra two labels that I missed using just histograms, so cropping really is necessary and edge detection makes it a lot easier
There are false negatives, as not all of my test images were recognized, mostly because of colours, or because not the entire label is on the picture. There was also one false positive, but it one is very tricky as it looks exactly like a record. My script detects the outer edge as follows:
and you can probably see why it is tricky, so I am giving myself a pass on this one.
So the solution is still not perfect, and manual inspecting is still needed for labels that are reported, but it is slowly getting where I want it to be. Next up is a more extensive test which might take me a few weeks to prepare (as the Discogs API is rate limited) and run.
Comments
Post a Comment