Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

feature extraction for classification

Solved!
Go to solution

I am working on a project of sorting fruit by machine vision and I used k-NN classifier as classification. Are the feature extraction approach and also the appropriate features determined by the software itself? cant The person participate in select them?

best regards

 

0 Kudos
Message 1 of 7
(3,479 Views)

There are two approaches for this:

 

1) Particle Classifier (IMAQ Create Particle Classifier and related, or using the Vision Particle Classification Tool) where you have very limited control over the features. They use 8 features - circularity, elongation, two convexity descriptors, two hole descriptors, spread, slenderness). These features are rotation/scale-invariant. 

 

2) Custom Classifier (IMAQ Create Custom Classifier and related). Here you supply your own feature vector.

 

You can read about these in the Vision Concept Manual, but I'm afraid there is not much more info than what I just gave you.

 

Cheers, 
Birgit

0 Kudos
Message 2 of 7
(3,445 Views)

Hello!

The NI Particle Classification Training Interface tool can help you create a classifier file that you use within your application. With this, you can select your method and various other training parameters as well (Nearest Neighbor, K-Nearest Neighbor, and Minimum Mean Distance built in). You can find this by searching your computer using the Windows search bar or by going to Start>>Programs>>National Instruments>>Vision>>Particle Classification Training. Once you've made this classifier file, you can use it in your application by loading in your classifier file image and comparing it using the Classification Particle Analysis VI. 

image.png

 

A good example to reference in the LabVIEW environment can be found in the NI Example Finder. Select Help >> Find Examples >> Browse >> Toolkits and Modules >> Vision >> Classification >> Particle Classification. 

Additionally here's a couple links that might be helpful to you moving forward: 
Nearest Neighbor : http://zone.ni.com/reference/en-XX/help/370281AD-01/nivisionconcepts/classification_methods/
In-Depth Discussion : http://zone.ni.com/reference/en-XX/help/372916M-01/nivisionconcepts/classification_indepth_discussio...

If you need something more custom, you may have to go with the Custom Classification route that Birgit mentioned. 

R Dahlman

0 Kudos
Message 3 of 7
(3,428 Views)

Hi

Thank you Dear b.ploetzeneder

I have used particle classifier. I need the more authority in using of features. I could not find custom classifier approach in concept manual. could you help me please?

0 Kudos
Message 4 of 7
(3,392 Views)

Hi

Thank you dear DahlmanR 

I have used this and I want to know more about features used in classification by this approach.

0 Kudos
Message 5 of 7
(3,391 Views)

Hello!

I'm not sure I understand what your question is. With the nearest neighbor selected, it will use the algorithm to classify a region of interest into a class, and your classification file that is created using the dialog box has the definitions of the various classes based on the samples that you have added to the class. 

Are you currently using our particle classification for an application and not getting the classification results you expect? 

R. Dahlman

0 Kudos
Message 6 of 7
(3,377 Views)
Solution
Accepted by topic author nesar_m

Custom classification requires a training and a classification stage. 

 

The training stage looks like this:

1 Loop through a folder with images

2 Calculate any arbitrary feature vector. The values should be a DBL array, and bound (so no infinity). Normalization is not needed

3 Add the sample and class name. I usually include the class name in my file name of the training data, so that's what you see.

4 Train

5 Write File.


training.PNG

 

You can use IMAQ Cross Validation and IMAQ Classifier Accuracy for quick test if your classifier is good, but you should of course use a verification data set..

 

To then use the classifier in your program, you just have to implement the following code

use.PNG

Message 7 of 7
(3,347 Views)