open cv functions in matlab
i have installed open cv libraries in matlab by this instructions https://github.com/kyamagu/mexopencv now i want to get BOW output in a single vector. in order to train the neural network i have found this in matlab in order to get the BOW **
a = imread('C:\Users\commongh\Pictures\Images for Project\rocks.png');
I = rgb2gray(a);
trainer = cv.BOWKMeansTrainer();
dictionary = trainer.cluster(train_descs);
extractor = cv.BOWImgDescriptorExtractor('SURF','BruteForce');
extractor.setVocabulary(dictionary);
keypoints = cv.SURF(I);
descs = extractor.compute(I,keypoints);**
can you please tell me what inputs we should input to cv.BOWKMeansTrainer?
here, the inputs are number of clusters (aka
k
), TermCriteria, attempts, flags. it is also mentioned that the input parameters are the ones from kmeans(). I know that you are asking the parameters in MATLAB, but they should be the same, if it is OpenCV :)thank you I find it. and I re written the code like this please verify this is this correct or not
%BOW clc; clear all;
Am I getting the correct Bag of Words which I can input the neural network?