Face value recognition

I am trying to create a simple application that recognizes the values ​​of two 6-sided dice. I am looking for some general pointers or maybe even an open source project.

The two bones will be black and white, with white and black pips, respectively. Their distance to the camera will always be the same, but their position and orientation on the playing surface will be random.

Dice http://www.freeimagehosting.net/uploads/9160bdd073.jpg
(not a better example, the surface will be a sharper color and the shadows will disappear)

I have no experience in developing such recognition software, but I suggest that the trick is to isolate faces first by looking for a square profile with dominant white or black color (the rest of the image, i.e. the table / playing surface, will have completely different colors) and then isolate the points for counting. Shadows will be eliminated from top to bottom.

I hope that the described scenario is so simple (read: regular) that it can even be used as an “introductory exercise” for developers working with OCR technologies or similar computer tasks.

Update:

I made another search engine and stumbled upon this video , which, oddly enough, is exactly what I'm looking for. It also seems that the OpenCV project is my best choice, I will try to use it with this other project, OpenCVDotNet or Emgu CV .

Update:
Still struggling, can't get Emgu CV to work.

Ideas, pointers, thoughts, etc. still very welcome!

+13
c # opencv image-recognition emgucv
Apr 08 '10 at 2:56
source share
7 answers

Although image training is “non-trivial,” as @Brian said, it will actually be a fairly simple recording program. What you need to do is develop hara classifiers for cubes. You will need only 6 classifiers. Classifiers are the key to good image handling, and hara classifiers are the best there are now. They take a lot of time. Here are some good links to introduce you to hara cascades:

http://www.computer-vision-software.com/blog/2009/11/faq-opencv-haartraining/

http://www.cognotics.com/opencv/docs/1.0/haartraining.htm

http://note.sonots.com/SciSoftware/haartraining.html

Watch this video with youtube guys, and then download its source from the link that it provides in the video to see how it applied cascading files to EmguCV. This will be something for you.

http://www.youtube.com/watch?v=07QAhRJmcKQ

This site provides a source link for a small tool that adds a little automation to crop images and create index files needed to create cascades of hara. I used it a few months ago, and I could not get it to work correctly, but I modified it and it worked fine for the hara (not HMM). If you want the version to modify me, send it back, and I will receive it for you.

http://sandarenu.blogspot.com/2009/03/opencv-haar-training-resources.html

+9
May 03 '10 at 4:56
source share

While I have little technical support, you can help the developer of Dice-O-Matic mark II .

+3
Apr 08 2018-10-10T00:
source share

Good,

Algorithms for recognizing images with a high level of abstraction (for example, the type of abstraction needed to create reliable handwriting recognition software or facial recognition software) remain one of the most difficult problems in computer science today. However, pattern recognition for well-constrained applications, such as the application you described, is a solvable and very fun algorithmic problem.

I would suggest two possible strategies to accomplish your task:

The first strategy involves using third-party software that can pre-process your image and return data about the low-level components of the image. I have experience using a software called pixcavator that has an SDK. Pixavator will execute your image and examine the discrepancy between the color values ​​of each of the pixels in order to return the borders of the various image components. Software such as pixcavator should be able to easily determine the boundaries for comopents in your image and, most importantly, each of the pips. Then your work will be available based on the data that the third-party software will return to you, and find the components that correspond to the description of the small circular sections, which are either white or black. You will be able to calculate how many of these image components have been split and use this to return the number of pixels in your image.

If you are ambitious enough to solve this problem without using third-party software, the problem is still solvable. Essentially, you want to define a circular scanner, which is a set of pixels in a circular shape that will scan through your image test, looking for a pip (just like an eye can scan an image to look for something hidden in a picture). As your algorithmic “eye” scans the image, it will take on a lot of pixels from the image (call it test sets) and compare with a predefined set of pixels (what we will call your exercise sets) and check to see if the set tests corresponds to one of the training sets within a predetermined margin of error. The easiest way to run such a test is to simply compare the color data for each of the pixels in the test set with each of the pixels in the training set to create a third set of pixels called your discrepancy set. If the values ​​in your inconsistent set are small enough (which means that the test set is quite similar to the set of workouts), you will define this area in the image as a pip and proceed to scan other parts of your image.

Guess a little and check to find the correct error of errors, so that you catch every pip, and you do not experience positive results regarding things that are not pipes.

+3
May 03 '10 at 6:01 a.m.
source share
+2
Apr 08 2018-10-10T00:
source share

This is a familiar question. Recognizing objects from templates , to which I have provided an answer that, in my opinion, can be useful.

While the various types of classifiers are likely to work well, I will probably try to use the method I set out first. Classifiers are often difficult to implement and especially for proper preparation. In addition, when something does not work, it is very difficult to understand where the problem is: did you have a classifier in your implementation, did you choose the wrong method, were the parameters incorrect, did you really train it properly, or were you just out of luck?

No, stay away from classifiers, matching patterns and neural networks if the problem can (easily) be solved using simlpe image processing methods and some math.

+2
May 03 '10 at 6:53 a.m.
source share

Another possibility is to first use the more general image manipulation / recognition algorithm to align the position of the bones, then rotate and scale the image to some standard one (for example, images in halftone pixels of 512x512 pixels that were rotated to be Straight). Then try to train 6 different neural networks to recognize the different number of cubes on the screen. AForge.Net is a good library of artificial intelligence (including neural networks), and you should get a fair bitte from you.

+1
May 03 '10 at 6:46 a.m.
source share

In this video , I think you can see pretty much the behavior you want. The author uses several white blocks, but he provides the code (python / opencv), and perhaps you can build your project on this.

+1
May 21 '13 at 20:37
source share



All Articles