0

I would like to detect the pattern in a 2D image, which is similar to a data matrix or a qr code, but without the locator/timing information. Here is an example image (which is a part of a data matrix):

enter image description here

In this particular case I would like to have a 0-1 matrix of size 17x17 as a result. Ideally, I would like to be able to recognize the pattern from a photograph.

I am new to image processing, I would like to get some tips on where to start.

So far I was trying to see how QR code/data matrix code readers work, but without success. I was hoping that these readers start with some image processing to get the 0-1 matrix corresponding to the image and then use the locator information for only decoding the information. If this were the case, then I would not need to do any image processing (so it would be an easy solution for me), but I was not able to figure out how these readers work (and use only the part I need).

On the other hand, I can imagine that these readers do the image processing using already the locator information, in which case I need to do the image processing from scratch.

I know that this is a very general question, but if someone can point me to where to start or to some sample code to something that does similar image processing task, I would appreciate it.

5
  • is this always axis-aligned? or might it ever be rotated by any amount? do you already know the region (bounding box) of the code, or do you still have to find it? Commented Jan 29 at 22:02
  • To start with, I would be happy with an axis-aligned solution. As a general goal, I would like to be able to work with images taken by a phone (like when you scan a qr-code), so dealing with rotation, perspective distortion would be ideal. This is why I was thinking about finding out if parts of qr-code readers can work, since these readers already deal with all sorts of image distortion. This is also the answer to your second question. To start with, I would be happy with the solution when the bounding box is known, but ideally, it would be good to separate the code from the background. Commented Jan 29 at 22:06
  • I don't know of any readymade solutions. finding out what might be out there is a research task (i.e. you can do it). if there are solutions, they'd have significant commercial value because the involved algorithms would almost implicitly be able to detect and decipher distorted codes (most libraries assume flat codes with affine distortion, only modest perspective distortion). Commented Jan 29 at 23:59
  • starting from an axis-aligned picture, you can look for grids. the code's "modules" form a grid. apply a gradient (magnitude) filter (e.g. sobel or laplacian), then project/reduce/pool (max or sum/mean) over pixel rows and columns respectively. you'll get 1D signals with peaks where the code's "modules" have edges, i.e. that'll give you the grid. -- the 1-module quiet zone around the code is a common requirement of various code types. you should be able to detect that well in the 1D signals, depending on reduction function. Commented Jan 30 at 0:01
  • with a radon transform (related to hough transform), this can be lifted to handle rotation and skew/shear (so, affine distortion). this approach might even support analysis of perspective-distorted codes but that's unlikely to be trivial. Commented Jan 30 at 0:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.