I am working on an ANPR system using OpenCV and have seen in a few articles a way of doing character segmentation. The idea is to make a graph showing the concentration on color across the image.
How do I do this?

This is the image that I have:

I need to detect the locations of the black areas as shown above to identify each of the characters.
I have tried adding the values up pixel by pixel but I am doing this on Android and the time this takes is unacceptable.
Ok, its a month later, but I wrote you a little bit of code (in python) for this 😉
(Assuming you are just after the image density histogram)
To speed things up, you need’nt alter your image files, just alter the bin width of the sampling (
column_widthin the script), obviously you lose some resolution if you do this (as you can see in the image below).In the image, I show the results (graphing
hist) with your file, usingcolumn_width‘s of 1, 10 and 100. They ran for me at 0.11, 0.02 and 0.01 seconds respectively.I wrote it in PIL too, but it runs around 5 to 10 times slower.