First time here? Check out the FAQ!

Ask Your Question
0

Texture recognition similar to Cascade Classifier with opencv

asked Apr 4 '13

Immi gravatar image

updated Apr 4 '13

Hello all,

I'm looking for a method to recognize and identify textures. Is there any possibility to create something similar to haarClassifier.xml for textures? I don't want to use template matching.

Thanks in advance!

Immi

Preview: (hide)

2 answers

Sort by » oldest newest most voted
1

answered Sep 26 '13

Immi gravatar image

updated Sep 26 '13

I solved the problem with:

  • calculating the mean color and a compare it with a threshold
  • calculating glcm and compare the glcm with PSNR function (Link to Tutorial)
Preview: (hide)

Comments

I am also looking into this area. Are you able to provide some guidance (perhaps share your code with me)? My email is duguowei1000@gmail.com

Thanks a lot!

mrdgw gravatar imagemrdgw (Oct 6 '15)edit
1

answered Apr 4 '13

Basically you could do this very simple.

  • Collect a set of images of what your texture looks like
  • Collect a set of negatives
  • Train a cascade classifier using the train_cascade approach
  • Classify each window as texture or not

However, there must be reasons why people haven't used cascade classifiers for texture recognition. I guess the downside is the amount of time it takes to actually train and create the classifier. Template matching performs more than well enough on textures and a lot of research acknowledges that fact.

Preview: (hide)

Comments

Hi Steven,

thank you for your answer. I've tried already Haar-Cascade-Classifier for my problem. It was working quite well(created cascade classifier with about 400 images). I don't want to use template matching on µC later. This is the reason I'm looking for a classifier.

Immi gravatar imageImmi (Apr 4 '13)edit
1

Immi, actually to get a better classification, I am guessing that using about 100 positives would be more than enough, considering you use a large set of negatives. In case of texture, the texture doesn't change that much, but the background does vary alot. You need to model that background variance.

StevenPuttemans gravatar imageStevenPuttemans (Apr 4 '13)edit
1

Hi, I'll try this and reply.

Immi gravatar imageImmi (Apr 4 '13)edit
2

For this task you don't need a cascade classifier, try out the other classifiers (if you are lazy with setting them all up, try WEKA or if you are a python guy ScikitLearn)

Guanta gravatar imageGuanta (Apr 5 '13)edit

Doesn't it depend on how hard your texture variates?

StevenPuttemans gravatar imageStevenPuttemans (Apr 5 '13)edit
2

Yeah in some kind you are right, of course you could use a cascade classifier here as well, in principle it is just a variant of AdaBoost which has the ability to reject mismatches very fast, however this may also be a weakness and another classifier, e.g. SVM, Random Forests, etc. may perform better. You should never try only one classifier! Try them all out!

Back to the original question: @Immi It will also depend much on your features you'll use, LBP for example are a popular choice for texture classification, see e.g. http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5652209 , in their paper they also state that they'd make their code publicly available. Good luck

Guanta gravatar imageGuanta (Apr 5 '13)edit
1

Thank you for your help, I' ll try it!

Immi gravatar imageImmi (Apr 8 '13)edit
1

I've solved it with average color and GLCM. Thank you for your hints!

Immi gravatar imageImmi (Sep 24 '13)edit

Then post your solution and accept it as the correct one, since it will help others finding solved topics.

StevenPuttemans gravatar imageStevenPuttemans (Sep 24 '13)edit

I can't accept my answer at myself. Got to less points.

Immi gravatar imageImmi (Sep 26 '13)edit

Question Tools

Stats

Asked: Apr 4 '13

Seen: 4,709 times

Last updated: Sep 26 '13