Skip to main content

Using image processing to automatically detect labels (part 6)

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:
  1. 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)
  2. if no label was found try to detect outer edges
  3. if only one outer edge is found, crop the image, resize the donut shaped mask and try the histogram method again
Step 2 and 3 are actually repeated several times for different values of the size of the kernel used for blurring.

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

Popular posts from this blog

SID codes (part 1)

One thing that I only learned about after using Discogs is the so called Source Identification Code, or SID. These codes were introduced in 1994 to combat piracy and to find out on which machines a CD was made. It was introduced by Philips and adopted by IFPI, and specifications are publicly available which clearly describe the two available SID codes (mastering SID code and mould SID code). Since quite a few months Discogs has two fields available in the " Barcode and Other Identifiers " (BaOI) section: Mould SID code Mastering SID code A few questions immediately popped up in my mind: how many releases don't have a SID field defined when there should be (for example, the free text field indicates it is a SID field)? how many releases have a SID field with values that should not be in the SID field? how many release have a SID field, but a wrong year (as SID codes were only introduced in 1994) how many vinyl releases have a SID code defined (which is impossi...

SPARS codes (part 1)

Let's talk about SPARS codes used on CDs (or CD-like formats). You have most likely seen it used, but maybe don't know its name. The SPARS code is a three letter code indicating if recording, mixing and mastering were analogue or digital. For example they could look like the ones below. There is not a fixed format, so there are other variants as well. Personally I am not paying too much attention to these codes (I simply do not care), but in the classical music world if something was labeled as DDD (so everything digital) companies could ask premium prices. That makes it interesting information to mine and unlock, which is something that Discogs does not allow people to do when searching (yet!) even though it could be a helpful filter. I wanted to see if it can be used as an identifier to tell releases apart (are there similar releases where the only difference is the SPARS code?). SPARS code in Discogs Since a few months SPARS is a separate field in the Discogs ...

Using matrix numbers of CDs to verify release years (1)

One of the first steps when making CDs is to produce a "glass master". From that (using a few more steps) a "stamper" is created which is then used to press the actual CDs. When looking at a CD you can often see text in a ring in the middle of the CD. This is the so called matrix which comes from the glass master. Apart from the matrix other text (like the IFPI mastering SID code) could possibly also come from the glass master. A bit of background information can be found on page 7 of the IFPI SID code implementation guide although I would also highly recommend watching some of the clips about glass masters on YouTube, which are highly informative. One company making a lot of these glass masters is Cinram . For most of their glass masters they stored the production date in matrix. This is good news, because it means that it could possibly be used to verify releases and see if the declared year of the release is right: it could never have been released before...