Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

Binary Image

This is a binary image. I want to remove the portion in the red region, and keep the one in the green region.

The red region has the property of double parallel edges, whereas green does not. If someone could suggest an algorithm it would be helpful.

share|improve this question
    
Its not clear what your asking. Are you looking for a way to remove pixels from an already defined area, or are you looking for an algorithm for defining the area? –  slayton Oct 19 '12 at 16:23
    
@slayton no I am talking about the whole image. I want to detect the parallel edges(the type inside red region). and set them to black –  crack_addict Oct 19 '12 at 16:35
    
The problem that the "lines" are not really "parallel", first they are curved lines and are only approximately parallel to one another. –  natan Oct 19 '12 at 16:47
1  
@nate - yes I have to implement this to other images also, but if something works on this, it will work on others also. I was trying something on moving a small kernel and finding lines based on hough transform. –  crack_addict Oct 19 '12 at 16:56
1  
@crack_addict I think you are one step too far in the pipeline, this might be able to be done better before thresholding. There looks like there are many double lines in the image, but with gaps due to the thresholding. IMO thresholding is towards the end of the pipeline. Can you post the image before this step? –  geometrikal Oct 22 '12 at 1:12
show 3 more comments

migrated from stackoverflow.com Oct 21 '12 at 0:33

This question came from our site for professional and enthusiast programmers.

1 Answer

Just a suggestion:

  1. perform binary skeletonization
  2. detect lines as connected sets of pixels
  3. for every line, find distance to nearest pixel on some other line
  4. compute average distance between inspected line and the nearest line
  5. if the computed distance lays within some predefined interval (say, 3-8 pixels), consider it a double-line and remove both lines

The interval can be determined statistically because double lines have distances forming a distribution, which can be separated well from other line distances in the image.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.