-1

i have 4 shapes in image

i want to get pixels of one shape in list of point

the shapes have same color

List<point> GetAllPixelInShape(point x)
{
//imp
}

where x point of this shape

Nour Sammour
  • 2,822
  • 1
  • 20
  • 19
  • What types of shapes are you using? What have you tried so far? – Hand-E-Food Feb 09 '12 at 00:47
  • need more code/explanation to help you/see what your doing – pyCthon Feb 09 '12 at 00:50
  • the shapes do not have type i make Arabic OCR program in arabic language the character is connected with other characters this mean the shape do not have type but it's only shape and i want coordinates of this pixles emgu or openCV can help me ? – Nour Sammour Feb 09 '12 at 01:24
  • I would recommend that you post an image and also make your question more clear. However, I have some sense of what you're asking, so I'll post a reply. – Rethunk Feb 09 '12 at 02:49

2 Answers2

0

Long story short, you could begin with a connected components / region labeling algorithm.

http://en.wikipedia.org/wiki/Connected-component_labeling

In OpenCV you can call findContours() to identify contours, which are the borders of your connected regions.

http://dasl.mem.drexel.edu/~noahKuntz/openCVTut7.html

OCR is an extremely difficult task, especially for a script like Arabic. Creating an OCR algorithm from scratch takes a lot of work and numerous algorithms working together. OCR for machine printed text is hard enough. Implementing an algorithm to read handwriting is not something I'd suggest trying until you have a year or two of image processing experience. If you haven't read textbooks and academic papers on OCR, you're likely to spend a lot of time reproducing work that has already been done.

If you're not familiar with contour tracing and/or blob analysis, then working with OpenCV may not be a good first step. Since you have a specific goal in mind, you might first try different algorithms in a user-friendly GUI that will save you coding time.

Consider downloading ImageJ so that you can see how the algorithms work. There are plugins for a variety of common image processing algorithms.

http://rsbweb.nih.gov/ij/

Rethunk
  • 3,976
  • 18
  • 32
0

Your proposed method signature doesn't provide enough information to solve this. Your method will need to know the bounds of your shape, how long and wide it is etc, ideally a set of points that indicate those bounds.

Once you have those, you could potentially apply the details of this article, in particular the algorithms specified in the answer to solve your problem.

Community
  • 1
  • 1
Fooksie
  • 480
  • 7
  • 25