Categorizing lines on a shirt

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

Category 2 : Only Horizontal

Category 3 : Only Vertical

Category 4 : Neither Vertical nor Horizontal

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.

QUESTION

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

edit retag close merge delete

Sort by » oldest newest most voted

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...

more