Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, this may be a very simple matter, but i have conflict with that. I have split a particular binary image(28 x 28) into (4 x 4) samples. Now i want to calculate the pixel densities of each sample(i use those density values as features in a OCR application). As i know density defines the number of pixels in a particular area, like 7 pixels per square inch. Is that the same in here? all of my samples have 4 pixels. Is there are relationship between Moment->m00 and pixel density ? can someone explain this ? plz help
Posted
Updated 2-Jun-13 22:46pm
v2

1 solution

I would say that all of your samples have 4 x 4 = 16 pixels. If the original image is a binary image, the density of that sample is simply the number of 1 pixels in that 4 by 4 square. Or you might want to divide that number by 16 to normalize the result to the interval [0,1].

The moment M00 of an image is by definition the sum of the gray values of its pixels. For each 4 by 4 square the number of pixels is hence equal to M00 of that part of your image.

Hope that helps.
 
Share this answer
 
Comments
David Jhones 3-Jun-13 9:48am    
hi nv3 - good explanation, thank you very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900