I'm a beginner in the field of pattern recognition and computer vision. I'm working on a project right now to classify t-shirt patterns into three categories i.e. solids, stripes and checks. I have close up training images of the t-shirt images. A sample shirt image looks like this

I have looked at a bank of gabor filter features, but they are computationally expensive. It would of great help if someone could point me out in the general direction for working forward. Any help is appreciated.

EDIT - I found the solution in D.W.'s answer below, though my solution is not very good. I'm classifying solid patterns by counting the number of line segments in the image. If they fall below a certain number, I'm classifying them as solid. If not, I further classify them into stripes or checkered using HoG features and a linear SVM. The accuracy achieved was around 91%. It was a little low due to some misclassified samples in the training set.

  • $\begingroup$ This is in the context of a course? Which classification algorithms were presented in class? $\endgroup$
    – Raphael
    Jun 25, 2014 at 9:04
  • $\begingroup$ @Raphael this isn't in the context of a course. I m just working on my own project. I have not taken a computer vision or image processing class per say, i have taken one on machine learning though. I was just researching on the topic, and found that local binary patterns and gabor filters might be helpful, but i might be wrong. I have read some papers on LBP and gabor filters though. $\endgroup$
    – m_amber
    Jun 25, 2014 at 9:08
  • 1
    $\begingroup$ Try a line segment detection algorithm like ipol.im/pub/art/2012/gjmr-lsd (source code included). This is the sort of output I get using the image you linked: imgur.com/ktQoclc ; the output looks quite usable for extracting useful features. The code can be made to output line segment coordinates directly. Simpler features, based on horizontal and vertical derivatives (assuming the lines of the shirt are aligned to the image axes), might work too. $\endgroup$
    – Aky
    Jun 25, 2014 at 12:20
  • 2
    $\begingroup$ Have a try with a 2D FFT spectrum. $\endgroup$
    – user16034
    Jun 25, 2014 at 14:15
  • 2
    $\begingroup$ I suggest you add the "EDIT:" part of your answer as a comment to D.W.'s answer. See e.g. here. Thanks! $\endgroup$
    – Juho
    Sep 22, 2014 at 14:16

2 Answers 2


I suggest you try looking at some different simple features and filters, to look for ones that might be useful in distinguishing the shirts, and then feed these feature values into a machine learning algorithm. You can use a training set of images that you've hand-annotated to train the machine learning model.

For instance, one natural feature would be something that looks for short horizontal lines or vertical lines. You could use @Aky's suggestions, and then count the number of locations in the image where such a line has been detected. You could also try filtering your algorithm with an edge detector.


If it is important for you to get a high accuracy, then use a convolutional neural network (ConvNet). These ConvNets hold the state of the art for most visual recognition tasks. If your training set size is small, you should use a pretrained ConvNet as a feature extractor and then apply a support vector machine (SVM) on top of the extracted features.

I can recommend Keras as a good toolbox for ConvNets that is simple to use. You should be able to find a pretrained ConvNet for Keras by searching Google. VGG or ImageNet are names of well-performing ConvNets (particularly the former) so that is worth searching for.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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