computer vision systems toolbox question

1 view (last 30 days)
Hae-Jong
Hae-Jong on 30 Mar 2015
Commented: Hae-Jong on 30 Mar 2015
When I generated an executable file using mcc -m BowClassifierTest_executable, it succeeded, but when I run it in command window, it complains about one error as below. The source code is the all the way bottom.
C:\FP\DB2_orig>BoWClassifierTest_executable.exe "0.5"
Creating Bag-Of-Features from 10 image sets. -------------------------------------------- * Image set 1: 1. * Image set 2: 10. * Image set 3: 2. * Image set 4: 3. * Image set 5: 4. * Image set 6: 5. * Image set 7: 6. * Image set 8: 7. * Image set 9: 8. * Image set 10: 9.
  • Extracting SURF features using the Grid selection method. The GridStep is [8 8] and the BlockWidth is [32 64 96 128].
  • Extracting features from 6 images in image set 1...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 2...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 3...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 4...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 5...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 6...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 7...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 8...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 9...done. Extracted 84000 features.
  • Extracting features from 6 images in image set 10...done. Extracted 84000 features.
  • Keeping 80 percent of the strongest features from each image set.
  • Using K-Means clustering to create a 500 word visual vocabulary.
  • Number of features : 672000
  • Number of clusters (K) : 500
  • Clustering...done.
  • Finished creating Bag-Of-Features
Training an image category classifier for 10 categories. -------------------------------------------------------- * Category 1: 1 * Category 2: 10 * Category 3: 2 * Category 4: 3 * Category 5: 4 * Category 6: 5 * Category 7: 6 * Category 8: 7 * Category 9: 8 * Category 10: 9
  • Encoding features for category 1...done.
  • Encoding features for category 2...done.
  • Encoding features for category 3...done.
  • Encoding features for category 4...done.
  • Encoding features for category 5...done.
  • Encoding features for category 6...done.
  • Encoding features for category 7...done.
  • Encoding features for category 8...done.
  • Encoding features for category 9...done.
  • Encoding features for category 10...done.
Undefined function 'fitcecoc' for input arguments of type 'classreg.learning.Fit Template'.
Error in imageCategoryClassifier/trainEcocClassifier (line 476)
Error in imageCategoryClassifier (line 436)
Error in imageCategoryClassifier.create (line 320)
Error in trainImageCategoryClassifier (line 82)
Error in BoWClassifierTest_executable (line 23)
MATLAB:UndefinedFunction
C:\FP\DB2_orig>
//////////////////////////////////////////////////////////////////////////
function BoWClassifierTest_executable(ratio)
if(isdeployed) ratio = str2num(ratio); end imgSets = imageSet(pwd,'recursive'); %% [trainingSets,testSets] = partition(imgSets,ratio,'randomize'); %% bag = bagOfFeatures(trainingSets,'Verbose',true); %% img = read(imgSets(1), 1); featureVector = encode(bag, img);
% Plot the histogram of visual word occurrences figure bar(featureVector) title('Visual word occurrences') xlabel('Visual word index') ylabel('Frequency of occurrence') %% opts = templateSVM('BoxConstraint', 1.1, 'KernelFunction', 'gaussian'); categoryClassifier = trainImageCategoryClassifier(trainingSets, bag, 'LearnerOptions', opts, 'Verbose',true );
%% confMatrix_train = evaluate(categoryClassifier, trainingSets);
%% confMatrix_test = evaluate(categoryClassifier, testSets);
save([ 'result_' num2str(ratio) '.mat']);

Answers (1)

Dima Lisin
Dima Lisin on 30 Mar 2015
Hi Hae-Jong,
Does this code run in MATLAB? Do you have the Statistics Toolbox installed? If so, then you should contact Mathworks tech support.
  1 Comment
Hae-Jong
Hae-Jong on 30 Mar 2015
Yes, it is installed. I will contact them directly. Thanks.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by