AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Money Value Detection

The forum is to discuss topics related to different areas of image processing and computer vision.

Money Value Detection

Postby mnmhm2004 » Sat Feb 05, 2011 12:25 pm

Hi
First of all i want to thank Andrew for his great work
Go forward Andrew
:D

i try to build an application to detect money values
Following is the ideas i have to done this :
1: detect the value of money ( eg. 1 , 2 ,3)
2: ocr the value
3: print the result

What is done so far is:
1: detect the numbers in white paper as in attachment
2: making some image processing (resizing, convert to gray and convert to array)
3: ocr the image, Andrew’s article http://www.codeproject.com/KB/cs/neural ... k_ocr.aspx help me a lot

But there something i want to help in:
1: is what is done can help in money detection, or try another approach like pattern matching ?
2: how can i increase the accuracy of neural network to detect numbers?
3: is there any approach to convert Bitmap into a double array according to the pixels intensity, so i used the array as pattern to match with the network?
I using this following code to convert bitmap into an array:

Code: Select all
private double[] convertBitmaptoArray(Bitmap bitmap, int width, int hight)
        {
            int increment = 0;
            int noOfelements = width * hight;
            double[] finalarray = new double[noOfelements];
            Color[][] colormatrix = new Color[hight][];

            Bitmap resizedbitmap = ResizeBitmap(bitmap, width, hight);
           
            Bitmap grayImage = grayFilter.Apply(resizedbitmap);

            for (int i = 0; i < resizedbitmap.Width; i++)
            {
                colormatrix[i] = new Color[hight];
                for (int j = 0; j < resizedbitmap.Height; j++)
                {
                    colormatrix[i][j] = grayImage.GetPixel(i, j);
                   
                    Color c = colormatrix[i][j];
                    System.Diagnostics.Debug.Flush();
                    System.Diagnostics.Debug.Print("" + c.R + " " + c.B + " " + c.G);

                    if (c.R < 60  && c.B < 60 && c.G < 60 )
                    {
                        finalarray[increment] = -0.5f;
                        increment++;
                    }
                    else
                    {

                        finalarray[increment] = 0.5f;
                        increment++;
                    }

                }

            }
            grayImage.Dispose();

            return finalarray;

        }



waiting your reply
thanks in advance
:D
Attachments
Untitled.jpg
Untitled.jpg (46.25 KiB) Viewed 463 times
mnmhm2004
 
Posts: 2
Joined: Sat Feb 05, 2011 11:58 am

Re: Money Value Detection

Postby andrew.kirillov » Sat Feb 05, 2011 7:39 pm

Hello,

mnmhm2004 wrote:1: is what is done can help in money detection, or try another approach like pattern matching ?

You may try some advanced template matching algorithms like SURF and SIFT. Also you may take a look at Haar-like features, which were initially discussed for face detection, but also were applied to detection of eyes and other objects, since the idea is generic.

mnmhm2004 wrote:2: how can i increase the accuracy of neural network to detect numbers?

First, you may not need neural networks at all, if you start with something else like mentioned above. Second, why do you think there is a problem with NN? Maybe you did something wrong on preprocessing step?

mnmhm2004 wrote:3: is there any approach to convert Bitmap into a double array according to the pixels intensity, so i used the array as pattern to match with the network?
I using this following code to convert bitmap into an array:

It depends on what you are going to do with the double array. For some applications you may represent black as 0.0 and white as 1.0. For some others - -0.5 and 0.5 or -1.0 and 1.0. It really depends. In general your code is fine, it is just slow and inefficient.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 2567
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Money Value Detection

Postby mnmhm2004 » Sun Feb 06, 2011 7:36 am

Hi
thanks a lot Andrew , i appreciate your help
i will try to implement this using SURF and SIFT algorithms
thanks a lot for your time
:D
mnmhm2004
 
Posts: 2
Joined: Sat Feb 05, 2011 11:58 am




Return to Image Processing and Computer Vision