feature-detection

How to train and predict using bag of words?

依然范特西╮ 提交于 2019-12-02 17:17:48
I have a folder of images of a car from every angle. I want to use the bag of words approach to train the system in recognizing the car. Once the training is done, I want that if an image of that car is given it should be able to recognize it. I have been trying to learn the BOW function in opencv in order to make this work and have come at a level where I do not know what to do now and some guidance would be appreciated. Here is my code that I used to make the bag of words: Ptr<FeatureDetector> features = FeatureDetector::create("SIFT"); Ptr<DescriptorExtractor> descriptors =

General approach to developing an image classification algorithm for Dilbert cartoons

为君一笑 提交于 2019-12-02 16:23:09
As a self-development exercise, I want to develop a simple classification algorithm that, given a particular cell of a Dilbert cartoon, is able to identify which characters are present in the cartoon (Dilbert, PHB, Ratbert etc.). I assume the best way to do this is to (1) apply some algorithm to the image, which converts it into a set of features, and (2) use a training set and one of many possible machine learning algorithms to correlate the presence/absence of certain features with a particular character being present in the cell. So my questions are - (a) is this the correct approach, (b)

BoW in OpenCV using precomputed features

半城伤御伤魂 提交于 2019-12-02 15:28:44
问题 I need to do BOW (bag of words) but I only have the described keypoints of the images. For the moment, I have obtained the vocabulary using: cv::BOWKMeansTrainer bowtrainerCN(numCenters); //num clusters bowtrainerCN.add(allDescriptors); cv::Mat vocabularyCN = bowtrainerCN.cluster(); So now I need to do the assignment but I can't use the compute function because it calculates the descriptors of the images and I already have that. Is there any function to do the assignment or have I to compute

Improve cvFindChessboardCorners

时光怂恿深爱的人放手 提交于 2019-12-02 14:46:25
问题 Unfortunately, I was not able to find any solution to my question. What I'm trying to do is to improve the results using the OpenCV-method cvFindChessboardCorners in order to be able to achieve a better camera calibration, because I think that this is the reason why I get poor results undistorting/rectifying images like in my question before (Question: Undistorting/rectify images with OpenCV). So, what I want to know is, how I can improve the algorithm in order to be able to detect the

OpenCV FAST detector

好久不见. 提交于 2019-12-02 08:19:09
In my main.cpp I have an excerpt: Ptr<FastFeatureDetector> fastDetector = FastFeatureDetector::create(80, true); while (true) { Mat image = // get grayscale image 1280x720 timer.start(); detector->detect(image, keypoints); myfile << "FAST\t" << timer.end() << endl; // timer.end() is how many seconds elapsed since last timer.start() keypoints.clear(); timer.start(); for (int i = 3; i < image.rows - 3; i++) { for (int j = 3; j < image.cols - 3; j++) { if (inspectPoint(image.data, image.cols, i, j)) { // this block is never entered KeyPoint keypoint(i, j, 3); keypoints.push_back(keypoint); } } }

Improve cvFindChessboardCorners

廉价感情. 提交于 2019-12-02 07:46:55
Unfortunately, I was not able to find any solution to my question. What I'm trying to do is to improve the results using the OpenCV-method cvFindChessboardCorners in order to be able to achieve a better camera calibration, because I think that this is the reason why I get poor results undistorting/rectifying images like in my question before ( Question: Undistorting/rectify images with OpenCV ). So, what I want to know is, how I can improve the algorithm in order to be able to detect the chessboard corners in all images of this link: http://abload.de/img/cvfindchessboardcorneoxs73.jpg

Using FeatureDetector in OpenCV gives access violation

两盒软妹~` 提交于 2019-12-01 18:57:38
I need to find and match feature points in stereo images. Therefore I want to compare the different Feature Detection algorithms that are supported in OpenCV 2.4.5. by passing "SURF", "SIFT", etc. to the function. The code snippet: #include "opencv2/opencv.hpp" #include <opencv/highgui.h> #include <opencv2/nonfree/features2d.hpp> using namespace cv; using namespace std; ... void DisparityAnalysis::detectKeyPoints(Mat1b leftImageGrey, Mat1b rightImageGrey, string algorithmName) { Ptr<FeatureDetector> detector = FeatureDetector::create(algorithmName); detector->detect(leftImageGrey, keypoints_1)

In MATLAB, find zero crossings within a threshold, given a vector of data

与世无争的帅哥 提交于 2019-12-01 08:27:25
问题 I have written a function in MATLAB to count the number of zero crossings given a vector of signal data. If I find a zero crossing, I also check whether the absolute difference between the two vector indices involved is greater than a threshold value - this is to try to reduce the influence of signal noise. zc = []; thresh = 2; for i = 1:length(v)-1 if ( (v(i)>0 && v(i+1)<0) || (v(i)<0 && v(i+1)>0) ) && abs(v(i)-v(i+1)) >= thresh zc = [zc; i+1]; end end zcCount = length(zc); I used the vector

how to find local maxima in image

泪湿孤枕 提交于 2019-12-01 06:27:58
The question is about feature detection concept. I'm stuck after I finding the corner of image and I want to know how to finding the feature point within the computed corners. Suppose I have grayscale image that have data like this A = [ 1 1 1 1 1 1 1 1; 1 3 3 3 1 1 4 1; 1 3 5 3 1 4 4 4; 1 3 3 3 1 4 4 4; 1 1 1 1 1 4 6 4; 1 1 1 1 1 4 4 4] if I use B = imregionalmax(A); the result would be like this B = [ 0 0 0 0 0 0 0 0; 0 1 1 1 0 0 1 0; 0 1 1 1 0 1 1 1; 0 1 1 1 0 1 1 1; 0 0 0 0 0 1 1 1; 0 0 0 0 0 1 1 1] The question is how do I pick the highest peak inside max local region (in sample how did I

How to use feature detection to know if browser supports border-radius? (Including IE9)

丶灬走出姿态 提交于 2019-12-01 04:50:21
I've seen plenty of examples for detecting support for border radius using something like: var cssAttributeNames = ['BorderRadius', 'MozBorderRadius', 'WebkitBorderRadius', 'OBorderRadius', 'KhtmlBorderRadius']; for (var i = 0; i < cssAttributeNames.length; i++) { var attributeName = cssAttributeNames[i]; if (window.document.body.style[attributeName] !== undefined) { this._useCss = true; break; } } But this doesn't seem to work for IE9, which does support border-radius. Am I missing something? Got it - the detection array needs 'borderRadius' added - it's case-sensitive. Modernizr is a