I have the cluster centers (vectors) which I calculated using Kmeans. And I can calculate the feature vectors of an image and store it in a matrix. My problem is, how to get the histogram of occurrences of visual words of a particular image using the data I have. Im using OPENCV.
Can someone help please?
Related
I have fungus images data set and each image has its mask of ROI. I want to use the given mask and extract ROI from the fungus image.
Following is the Mask using which I want to extract ROI using some Machine Learning techniques.
Thanks in Advance.
What you would need to do is, train a machine learning model using the masks as an input and the ROI numbers as an output.
For instance, let's say you have a dataset of 30,000 mushrooms with a mask so that only the ROI part is visible. For each image, you would make its label be the ROI of that specific mushroom (you would need to know this already).
After training, you would be able to input a new image of a mushroom with a mask, and the machine learning model would likely tell you what the ROI is.
If you'd like I can help you with this, I get hired for projects like this all the time. I would charge you though.
I am trying to develop an android application for paper currency identification by capturing images, I have tried template matching method but it is a scale variance, and it doesn't give an accurate match, I am thinking to use calculate Histogram method, will I get a better results?
Also, how can I classify currencies of different colors based on Hue channel ??
This seems a case where a recognition based on SIFT or SURF features can give you good results.
Extract SURF features from those images and build a FlannBasedMatcher (or other matcher). Then, extract SURF features from the input image, use the matcher to compute distances between the input features and those in your training images. Select corresponding features with lower descriptor distance and check if you have enough of them. If your input image has a lot of background, to check if your guess is correct, you can also compute a homography with those correspondences.
There is an example in the OpenCV doc to do something very similar to this.
I want to generate SURF descriptor (a vector of length 64).
In the original paper, here it says:
The region is split up regularly into smaller 4*4 square sub-regions. For each sub-region, we compute Haar wavelet responses at 5*5 regularly spaced sample points.
With OpenCV help, I can get keypoint and its relating region (by using KeyPoint::size and angle), but my questions are:
1. how to compute Haar wavelet responses?
2. what is "at 5 x 5 regularly spaced sample points" mean?
I've read the wiki and introduction about Harr wavelet but still have no idea how to write the code.
I've known how to use the OpenCV SurfDescriptorExtractor, but I cannot use it because I need to enlarge or shrink the original region and get new descriptor.
Thanks for any hint about how to generate SURF descriptor.
I'm new in Scilab and currently working on a project on barcode.
How can I locate barcode in an image of a product?
Is there any clue on what I can research on?
Divide image into NxM sub-images. Then folow either:
a) Make FFT on each sub-image and compare result with pre-computed 2D FFT of standard barcode image. (Because barcodes are pretty monotone and highly repetitive images they should generate similar FFT patterns)
b) Execute some thining (skeletonization) algorithm to leave only skeletons in images. Then do Radon or Hough transform on each skeleton sub-image and look for bunch of lines which has same deflection angle withing error bounds.
I personally would choose second way with pre-skeletonizing step because Radon/Hough transforms are especially designed for searching lines in images.
If the barcode is the only significant thing in the image, you could do a Radon transform and then calculate the RMS of each rotation, and keep the row with the highest value.
I'm implementing an ancient coins recognition system. I have used contours detection to extract features of coins. And I thought to use SVM for training images.
My question is how I can give those features to SVM? I got to know that I have to save those features into a file and then that file should feed to the SVM. But, I don't have an idea to save features to a file.
Saving features to a file means save the number of contours in the image, x, y, width and height of each contour right?
Can someone please help me? I am stuck here for two months. Still, I couldn't find the solution for this.
Once I save features to a file, do I have to give the coin name also to the same file or to another file?
Appreciate your help a lot.
Nadeeshani
It depends on what computer vision / image processor library are you using. For example, OpenCV has builtin SVM functionality:
http://opencv.willowgarage.com/documentation/cpp/support_vector_machines.html
so you don't even have to export the features. But LIBSVM ( http://www.csie.ntu.edu.tw/~cjlin/libsvm/) has many more bindings, also for Matlab, for example.
As for how to give the features to the SVM... the input of most categorizers (including SVMs) is a multi-dimensional vector, so you could get one for example concatenating the first 10 x-y-width-height tuples. However, this naive solution is unlikely to work, because if you change the order of the tuples (or you rotate the coin so that the x-y coordinates change), you will get totally different vectors. So try to make up a coin image -> feature vector mapping that doesn't change when the coin is rotated / moved / noise is added. (second idea: features ordered by size, first 5-10, with some shape descriptors instead of simple width / height maybe?)
Coin names are mostly irrelevant at this phase, use 1-of-N encoding for the SVM output.