I tried to get the camera matrix using calibrateCamera() function:
double x= calibrateCamera(objectPoints,imagePoints,imageSize,cameraMatrix,distCoeffs,rvecs,tvecs,0);
and i got
‘calibrateCamera’ was not declared in this scope
i didn't forgot to write
using namespace cv;
what can it be?
thanks in advance.
ok i got it:
i was missing the header:
#include "opencv2/calib3d/calib3d.hpp"
thanks anyway
Related
I have old project, where I did something like this:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
(...)
CvCapture* capture;
cv::Mat frame;
capture = cvCaptureFromCAM(0);
frame = cvQueryFrame(capture);
(...)
And it worked.
Now I have created new project and now I have error:
error C2440: '=' : cannot convert from 'IplImage *' to 'cv::Mat *'
Only difference between these projects I notice is that the new one is written in CLR C++. Both use openCV 2.4.11.
Why cvQueryFrame() in my old project was able to return cv::Mat and new one doesnt? What did I missed?
I have the following code, which runs fine:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
using namespace std;
using namespace cv;
void main() {
bool running = true;
cv::OrbFeatureDetector OrbDetector;
while (running) {
IplImage *newFrame = cvLoadImage("x1.jpg");
IplImage *newFrameBW = cvCreateImage(cvGetSize(newFrame), newFrame->depth, 1);
cvConvertImage(newFrame, newFrameBW);
vector<KeyPoint> KeyPoints;
}
}
However, adding the line:
OrbDetector.detect(newFrameBW, KeyPoints);
to the while loop results in the following error:
HEAP[Example 4.exe]: Invalid address specified to RtlFreeHeap( 006B0000, 02474D20 )
Example 4.exe has triggered a breakpoint.
I am sure there is nothing wrong with the code, as I have just seen it run successfully on someone elses machine. Is there anything non code related that could be causing this?
The problem is that the OpenCV version you are using does not deal OK with MCVS 2012. Is not a problem of code, as I had a similar one that include vectors and didn't work.
Take a look to this tutorial that will show you how to rebuild the OpenCV library and your code will work pretty well ;)
Here is the link:
http://answers.opencv.org/question/6495/visual-studio-2012-and-rtlfreeheap-error/
I have a problem, in ROS I process a camera feed with openCv.
Now i try to implement the cvKalman, but this type is not recognized, however the opencv example works well.
What am i missing, why is not recognized this type?
here is my include to the ROS node:
#include <ros/ros.h>
#include <math.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
// for img processing
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv/cv.h>
Try including with "s not <s such as:
#include "ros/ros.h"
I solves the problem by using the KalmanFilter wrapper class, but still I dont understand why I cant use the simple Kalman class.
These are includes which I am using
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc_c.h>
This is namespace
using namespace cv;
But when I am using matchTemplate function, I am catching the following problem
error C3861: 'matchTemplate': identifier not found
Can anyone help me to solve this problem?
Additional information:
I am using OpenCV2.3
thank you for spending time to view and comment my problem
Best Regards
Hayk
You need imgproc.hpp included, the one that you included has the C version only : cvMatchTemplate
I have setup a new project and used compass to generate the blueprint style sheets. I now have the following code in my screen.scss
body.bp {
#include blueprint-typography(true);
#include blueprint-utilities;
#include blueprint-debug;
#include blueprint-interaction;
$font-color: #C6C6C6;
}
The font in my document does not change however. Using just color:#C6C6C6; works fine. What am I missing here
$font-color is a variable, not the color specification itself, so it should be something like this:
$font-color: #C6C6C6;
body.bp {
#include blueprint-typography(true);
#include blueprint-utilities;
#include blueprint-debug;
#include blueprint-interaction;
color: $font-color;
}