01-22-2014 11:58 PM - edited 01-23-2014 12:01 AM
Textures in my samples vary. We would like to train new textures while we run vi. Is it possible to include and run NI Texture Training Interface program in my vi?
01-23-2014 02:31 AM
Hello,
take a look at the "classification" subpallete on the "machine vision" pallete. You can train the classifier engine (I think SVM is used in the texture training utility), add/delete/classify samples, etc...
Best regards,
K
01-24-2014 03:07 PM
Klemen-
I didn't know there are VIs for texture training. I am now trying to use them to add image samples with ROIs. Looks like I should be able to do it, but with little information or no examples, it is hard to make things work. It would be great if there are some example VIs for this type of training. Do you know if there is any?
Thanks!
01-25-2014 04:32 AM
Hello,
I've created a simple example on how to create a custom texture classifier sample(s). Please see the attachment (saved for LV2011).
1. Load the image (TAB 1)
2. Select ROI and name the class (TAB 1)
3. Add sample(s) (TAB 1) by iterating 1. - 2.
4. Check the samples info (TAB 2)
5. Train support vector for all samples (TAB3)
and (1. - 5.) MODIFY THE SETTINGS ACCORDING TO YOUR APPLICATION...
This should give you the basic idea... Mind that no safety features/error handling is implemented. You should implement error handling in your application.
Hope this helps.
Best regards,
K
01-25-2014 10:55 AM
I forgot to mention that you should also probably take a look at the "texture" subpallete under image processing...
Best regards,
K
01-27-2014 10:12 AM
Klemen-
Thank you so much for your example. That is very helpful.
Now I can ask a better question because I was looking for a way to generate classifier file ( xxx.clf). I was using 'IMAQ Read Classifier File' vi with a classifier file I got when I trained texture with NI Texture Training Interface. I could save texture classifier file (xxx.clf) in the NI Texture Training Interface and use it in my program. Now I am trying to generate a classifier file in my program not using the NI Texture Training Interface.
Should I just connect 'IMAQ Write Classifier File' just before 'IMAQ Dispose Classifier' vi after training? I wonder what parameters are saved in the classifier file.
Thanks a lot!
01-27-2014 11:19 AM
BTW, when I saved a classifier file in your example and used it in NI Texture Training Interface, it generates an error when I pressed 'Train Classifier' button. I attached the classifier file after changing the extension to 'txt' instead of 'clf'.
01-27-2014 01:26 PM - edited 01-27-2014 01:27 PM
Yes,you need to write to file before disposing the reference to the classifier.
What gets written in the classifier file? The parameters you set up in the initialization stage,the feature vectors,etc... How is it written - the structure of the file? Have no idea!
Did you train svm using the one-class model? The texture utility uses this model. I don't think its compatible with the others - read the documentation.
Best regards,
K