Ask Your Question

Categorizing lines on a shirt

asked 2014-10-29 08:45:11 -0500

jatt-5015 gravatar image

updated 2015-10-02 16:15:27 -0500


I am interested in detection of texture on a shirt i.e. whether there are -

  1. Both Horizontal and vertical lines
  2. Only Horizontal lines
  3. Only Vertical lines
  4. Neither Horizontal nor Vertical

My images are as under -

Category 1 : Both horizontal and vertical lines

image description image description image description

Category 2 : Only Horizontal

image description image description

Category 3 : Only Vertical

image description image description

Category 4 : Neither Vertical nor Horizontal

image description image description

Methods I have tried

I have tried -

  1. Hough Lines -- A single line is broken into multiple lines. Results, were poor.
  2. Feature Extraction -- I extracted keypoints using SIFT and SURF and tried to check their orientation, could not find any pattern.
  3. Edge Detection -- I tried using Sobel Edge Detection, both in horizontal and vertical direction but could not figure out how to use that data.


How should I approach this task? What image processing algorithms should I use? How can I use the available OpenCV functionality?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-10-29 15:57:37 -0500

Hi! Your first guess is I think the best way to handle this problem. The fact that a line is broken into multiple lines is not a problem : just take the orientation of each line (in degree for example), put them into a vector and try to count vertical lines ((angle>80&&angle<100) || (angle>260&&angle<280)) and horizontal lines (angle<10 || angle>350 || (angle>170&&angle<190)). Using the ratio of those values to the total number of lines, you will probably be able to find the right class... But of course, if the image is slightly rotated, this method will not work...

If you want to be more robust, you can try to cluster this vector using K-Means, for instance. Using 2 or 3 class, and analyzing variances of each class, you can have some guess about the type of the shirt (horizontal/vertical ; both ; neither). Then the problem is easier: you have to choose between vertical or horizontal shirt...

edit flag offensive delete link more

Question Tools


Asked: 2014-10-29 08:45:11 -0500

Seen: 308 times

Last updated: Oct 29 '14