1 | initial version |
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...