Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I would add another answer.

  • Compute the gradients in the original (color) image
  • Get the mean direction in a sliding window: make a 2x2 matrix containing:

    [ Sum(Gx²)    Sum(GxGy) ]
    [ Sum(GxGy)   Sum(Gy²)  ]
    
  • Compute the PCA of this matrix. The first eigenvector will give you the mean gradient direction.

  • Use the segmented image as a mask to eliminate unwanted areas.
  • Segment the direction image to get the different lines. You can also check the histogram of the gradient directions.