Ronak Shah
Ronak Shah

Reputation: 35

blob detection algorithm in aforge and C#.net for tiff image

I have to extract the red mark graph using Aforge blob extraction method but I am unable to extract that particular grid in order to read it. enter image description here

Upvotes: 1

Views: 1808

Answers (2)

user2302627
user2302627

Reputation: 11

If you want to just retain the graph in the grid and remove all other lines or line segments and if your image is a sample of all the images that you are planning to process, then I see two options to try out:

1) If there is a difference in greyscale threshold of area which is not having graph line to that of graph line, then use that and apply one of the Thresholding APIs of Aforge.Net, like IterativeThreshold.

2) You may try errosion API of AForge.Net and iterate that for N times, until all other lines are eroded except the graph line. If graph line becomes lighter due to erossion, apply Dillation on top of it.

Upvotes: 0

Ivan Kochurkin
Ivan Kochurkin

Reputation: 4481

This task may be pretty simply solved without further AForge using.

If all grids in your sample have a similar structure: i.e. homogeneous grid with vertical-horizonal graphic of function, you can use following algorithm:

  1. Calculating white pixel density for vertical direction as you can see at image below. It's just a normalized value of sum of all RGB components in each horizontal line (Dont know what's name of it. If anybody knows it, please report). white pixel density for the horizontal and vertical directions

  2. You must extract y-axis values with lowest white pixel density and ignore y-axis values in green ellipses. If this minimums has not been founded, you must consider values in green ellipses too. If in considered y-axis values there are white pixels at right in image too many, just ignore it. Otherwise, congrats! We found segment of black line until right angle.

  3. After that this process must be repeated for next horizontal line detection until end of image.

  4. Construction of final function from founded horizontal lines.

enter image description here

Upvotes: 2

Related Questions