1
votes

I have used Canny edge detector to detect the edges and below is the output. I need to detect the density of edges in the image and select the region where ever the density is high. How to do that in opencv.How to find the density of high intensity pixels using opencv?

Below is the output after Canny Edge: enter image description here

How to get the below output?

enter image description here

1
One simple approach would be to use a large sliding window and threshold on the percentage of foreground pixels in the window. That will give you a mask that you can use to segment the "busy" regions.Roger Rowland
@RogerRowland Thanks, Can I get any samples for the technique you have mentioned.user2727765
please attach your trials and informations as an edit to your old question and continue discussion there. you still didn't get any answers and opening a the same question again and again will create a total mess. stackoverflow.com/questions/21287179/…baci
@CanberkBaci Thanks for your comments. I thought not to narrow down the idea, and that is the reason I made it as a seperate question.user2727765
One simple approach that might work for you: 1. sum pixels horizontally and get a histogram-like graph 2. sum pixels vertically and get a second histogram-like graph 3. combine high values on both graphs to get the locationssepdek

1 Answers

1
votes

Here is an idea.

  1. Traverse the external contour and remove it.
  2. Apply Horizontal histogram to get separate the strips.
  3. In each take vertical histogram and locate the bins with values within a neighbourhood of the peak. (Lets call these as Peak Bins)
  4. The longest contiguous sequence of peak bins should give the answer.