Hello,
I was debuging my code when I saw a memory leak with VideoCapture.
There you have the memory of my computer : it's go up realy fast
http://i.imgur.com/wXtpKS0.png
I tested this two code :
while (1)
{
VideoCapture test;
test = VideoCapture(0);
test.~VideoCapture();
}
while (1)
{
VideoCapture test;
test = VideoCapture(0);
test.release();
}
is this normal? do you have any solution?
Thank you
↧
memory leak with VideoCapture
↧
Opencv 3.1 and Visual Studio 2015 (cannot open file 'opencv_calib3d310d.lib')
Hello there,
I followed the [Installation by Using the Pre-built Libraries
](http://docs.opencv.org/3.1.0/d3/d52/tutorial_windows_install.html) article (I didn't make my Own Libraries from the Source Files), the [Set the OpenCV enviroment variable and add it to the systems path](http://docs.opencv.org/3.1.0/d3/d52/tutorial_windows_install.html#tutorial_windows_install_path) article (the link to pathEditor was dead so I downloaded form somewhere else) and the [How to build applications with OpenCV inside the "Microsoft Visual Studio"
](http://docs.opencv.org/3.1.0/d6/d8a/tutorial_windows_visual_studio_Opencv.html) article using the local method, with the provided code example but I get an **Error LNK1104 cannot open file 'opencv_calib3d300d.lib'** . I really cannot understand where the problem is.
I also noticed that
1 opencv_calib3d300d.lib
2 opencv_core300d.lib
3 opencv_features2d300d.lib
.....
lib files do not exist in my pre-built library.
I'm on x64 platform in my Solution and in Debug mode, and logged in as administrator.
Thank you.
↧
↧
Process image coming from a OpenGL rendering context
Hi all!
I have an image coming from an OpenGL rendering context:

We have alpha background both inside and outside the black contour. I'd like to know whether the image inside the black contour contains alpha values. If yes, I'll do some processing in the scene in order to reduce the alpha (basically scaling the image sprite), then export the render again and do the same process, until we have no alpha pixels inside the contour.
I think that OpenCV is right technology to do the image scanning. I have done some basic stuff before with OpenCV, like altering the colors of each pixel of an image, but I think I need more experience this time.
Do you know which could be the best approach?
We are using OpenCV 2.4.7 in a C++ project.
Thanks,
Robert.
↧
Python's Numpy.transpose by axes equivalent for cv::Mat?
Hi there
I'm trying to translate the below Python code that uses numpy arrays into C++ and use cv::Mat instead of numpy:
def get_face_mask(im, landmarks):
im = numpy.zeros(im.shape[:2], dtype=numpy.float64)
for group in OVERLAY_POINTS:
draw_convex_hull(im,
landmarks[group],
color=1)
im = numpy.array([im, im, im]).transpose((1, 2, 0))
im = (cv2.GaussianBlur(im, (FEATHER_AMOUNT, FEATHER_AMOUNT), 0) > 0) * 1.0
im = cv2.GaussianBlur(im, (FEATHER_AMOUNT, FEATHER_AMOUNT), 0)
return im
(Full source code can be seen here)
I'm finding it a bit difficult to understand what the below lines does:
im = numpy.array([im, im, im]).transpose((1, 2, 0))
I don't seem to be able to find the equivalent of this in OpenCV C++ version.
Any help would be much appreciated.
↧
Issue with meanStdDev() result and Mat channels
**meanStdDev()** is not giving the correct calculation of mean and standard. I want it to give mean/stdev for each corresponding column. The code follows,
Mat_ C = (Mat_(2,6) << 1, 0, 3, 1, 0, 5, 6, 2, 0, 4, 0, 9), E=Mat::zeros(9, 9, CV_8UC1);
Mat mn, stdev;
meanStdDev(C.reshape(C.cols),mn,stdev);
std::cout << C.reshape(C.cols) << endl<< mn << std::endl;
It gives the following results,
[1, 0, 3, 1, 0, 5;
6, 2, 0, 4, 0, 9]
[2.5;
1;
0;
0;
0;
0]
You can see that the calculated mean value is corrent only for the first 2 positions
↧
↧
Problem with drawmatches()
Hi there,
I making logo detection program that uses the SIFT method to detect a logo on image. The source code is [here](https://drive.google.com/open?id=0B7CADV0PAD_rcVpqR0p4amxwd0k). The folder with source images and logos("references" folder) is [here](https://drive.google.com/open?id=0B7CADV0PAD_rcjdBVjhxNXAtSjA). When I scrolling results of drawmatches(), program falling on image "13380-sony.jpg".
What could be the problem? And how a source code could be optimized?
P.S. Sorry my English.
P.P.S. I am beginner in OpenCV.
P.P.S. I am beginner in OpenCV.
↧
Convert bmp to linear jpeg
Hello,
I want to convert a bmp image to jpeg. But I want to be able to change the parameters of the jpeg image that is created. I want to use linear gamma, because i want to get linear jpeg in the end. Is there a function that does this in C++?
Thanks
↧
How to install opencv with C++ bindings on raspberry pi?
I would like to install the opencv packages and libraries on the RPi 3. I have already installed cmake and i will be coding on codeblocks. Could someone explain as to how could one go about the opencv with C++ bindings on Raspberry Pi 3 running on Raspbian Jessie.
Thanks!
↧
Every thing works fine except for: CommandLineParser has no member named ‘about’,print message,has,check
#include
#include
#include
#include /// include most of core headers
#include // include GUI-related headers
using namespace cv;
using namespace std;
// OpenCV command line parser functions
// Keys accecpted by command line parser
const char* keys =
{
"{help h usage ? | | print this message}"
"{@video | | Video file, if not defined try to use webcamera}"
};
int main(int ac, const char** av)
{
CommandLineParser parser(ac,av,keys);
parser.about("Chapter 2. v1.0.0");
//If requires help show
if (parser.has("help"))
{
parser.printMessage();
return 0;
}
String videoFile= parser.get(0);
// Check if params are correctly parsed in his variables
if (!parser.check())
{
parser.printErrors();
return 0;
}
cv::VideoCapture cap;
const std::string kWinName1 = "Exercise 1 - Original Image";
const std::string kWinName2 = "Exercise 1 - Thresholded Image";
std::cout << "Startup (Press ESC to quit)" << std::endl;
namedWindow( kWinName1, CV_WINDOW_AUTOSIZE);
cv::namedWindow( kWinName2, CV_WINDOW_NORMAL);
initVideoStream(cap);
int slider_value = 100;
cv::createTrackbar( "Threshold", "Exercise 1 - Thresholded Image", &slider_value, 255, trackbarHandler, &slider_value);
Mat img_bgr;
cv::Mat img_gray;
cv::Mat img_filtered;
while (1) {
cap >> img_bgr;
if(img_bgr.empty()){
printf("Could not query frame. Trying to reinitialize.\n");
initVideoStream(cap);
cv::waitKey(1000); /// Wait for one sec.
continue;
}
cv::cvtColor( img_bgr, img_gray, CV_BGR2GRAY );
//threshold( img_gray, img_filtered, slider_value, 255, CV_THRESH_BINARY);
adaptiveThreshold(img_gray, img_filtered, 255, CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY, 33, 8);
cv::imshow(kWinName1, img_bgr);
cv::imshow(kWinName2, img_filtered);
char key = (char) cv::waitKey (0);
if (key == 27) break;
}
cv::destroyWindow (kWinName1);
cv::destroyWindow (kWinName2);
std::cout << "Finished\n";
}
Error Output:
/usr/local/clion-2016.1.3/bin/cmake/bin/cmake
--build /home/mh/.CLion2016.1/system/cmake/generated/augmented_1-aa43292c/aa43292c/Debug
--target augmented_1 -- -j 4
Scanning dependencies of target augmented_1
[ 50%] Building CXX object CMakeFiles/augmented_1.dir/main.cpp.o
/home/mh/ClionProjects/augmented_1/main.cpp: In function ‘int main(int, const char**)’:
/home/mh/ClionProjects/augmented_1/main.cpp:40:12: error: ‘class cv::CommandLineParser’ has no member named ‘about’
parser.about("Chapter 2. v1.0.0");
^
In file included from /usr/local/include/opencv2/opencv.hpp:49:0,
from /home/mh/ClionProjects/augmented_1/main.cpp:3:
/usr/local/include/opencv2/core/core.hpp:4807:10: error: ‘bool cv::CommandLineParser::has(const string&)’ is protected
bool has(const std::string& keys);
^
/home/mh/ClionProjects/augmented_1/main.cpp:42:26: error: within this context
if (parser.has("help"))
^
/home/mh/ClionProjects/augmented_1/main.cpp:44:16: error: ‘class cv::CommandLineParser’ has no member named ‘printMessage’
parser.printMessage();
^
/home/mh/ClionProjects/augmented_1/main.cpp:49:17: error: ‘class cv::CommandLineParser’ has no member named ‘check’
if (!parser.check())
^
/home/mh/ClionProjects/augmented_1/main.cpp:51:16: error: ‘class cv::CommandLineParser’ has no member named ‘printErrors’
parser.printErrors();
^
↧
↧
Efficiently passing Mat object in different classes
I am currently doing a project which has around 6-7 classes and requires me to use an image across multiple classes.
The project code that I am referring to write my own code , does it by saving the image and loading it across different classes.
What doubt I have is
Is this method efficient or I should set class variables and clone the image for the other classes.
Which one of them will be efficient.
↧
need help to change this code to live web cam streaming
Hello I followed this video(https://www.youtube.com/watch?v=Y3ac5rFMNZ0) and it was perfectly worked..
but when i change code for web cam capturing it only gets static image.. then i commented lines 54 - 58,
lines 177 - 183,(as mentioning in video comment) but still not working...
Anyone knows to solve this.I need to apply this to my conveyor design undergraduate project to count objects..
Below shows my edited code(only main cpp)....
// main.cpp
#include
#include
#include
#include
#include // it may be necessary to change or remove this line if not using Windows
#include "Blob.h"
#define SHOW_STEPS // un-comment or comment this line to show steps or not
// global variables ///////////////////////////////////////////////////////////////////////////////
const cv::Scalar SCALAR_BLACK = cv::Scalar(0.0, 0.0, 0.0);
const cv::Scalar SCALAR_WHITE = cv::Scalar(255.0, 255.0, 255.0);
const cv::Scalar SCALAR_YELLOW = cv::Scalar(0.0, 255.0, 255.0);
const cv::Scalar SCALAR_GREEN = cv::Scalar(0.0, 200.0, 0.0);
const cv::Scalar SCALAR_RED = cv::Scalar(0.0, 0.0, 255.0);
// function prototypes ////////////////////////////////////////////////////////////////////////////
void matchCurrentFrameBlobsToExistingBlobs(std::vector&existingBlobs, std::vector¤tFrameBlobs);
void addBlobToExistingBlobs(Blob ¤tFrameBlob, std::vector&existingBlobs, int &intIndex);
void addNewBlob(Blob ¤tFrameBlob, std::vector&existingBlobs);
double distanceBetweenPoints(cv::Point point1, cv::Point point2);
void drawAndShowContours(cv::Size imageSize, std::vector> contours, std::string strImageName);
void drawAndShowContours(cv::Size imageSize, std::vector blobs, std::string strImageName);
bool checkIfBlobsCrossedTheLine(std::vector&blobs, int &intHorizontalLinePosition, int &carCount);
void drawBlobInfoOnImage(std::vector&blobs, cv::Mat &imgFrame2Copy);
void drawCarCountOnImage(int &carCount, cv::Mat &imgFrame2Copy);
///////////////////////////////////////////////////////////////////////////////////////////////////
int main(void) {
cv::VideoCapture capVideo;
cv::Mat imgFrame1;
cv::Mat imgFrame2;
std::vector blobs;
cv::Point crossingLine[2];
int carCount = 0;
capVideo.open(0);
if (!capVideo.isOpened()) { // if unable to open video file
std::cout << "error reading video file" << std::endl << std::endl; // show error message
_getch(); // it may be necessary to change or remove this line if not using Windows
return(0); // and exit program
}
/*if (capVideo.get(CV_CAP_PROP_FRAME_COUNT) < 2) {
std::cout << "error: video file must have at least two frames";
_getch(); // it may be necessary to change or remove this line if not using Windows
return(0);
}*/
capVideo.read(imgFrame1);
capVideo.read(imgFrame2);
int intHorizontalLinePosition = (int)std::round((double)imgFrame1.rows * 0.35);
crossingLine[0].x = 0;
crossingLine[0].y = intHorizontalLinePosition;
crossingLine[1].x = imgFrame1.cols - 1;
crossingLine[1].y = intHorizontalLinePosition;
char chCheckForEscKey = 0;
bool blnFirstFrame = true;
int frameCount = 2;
while (capVideo.isOpened() && chCheckForEscKey != 27) {
std::vector currentFrameBlobs;
cv::Mat imgFrame1Copy = imgFrame1.clone();
cv::Mat imgFrame2Copy = imgFrame2.clone();
cv::Mat imgDifference;
cv::Mat imgThresh;
cv::cvtColor(imgFrame1Copy, imgFrame1Copy, CV_BGR2GRAY);
cv::cvtColor(imgFrame2Copy, imgFrame2Copy, CV_BGR2GRAY);
cv::GaussianBlur(imgFrame1Copy, imgFrame1Copy, cv::Size(5, 5), 0);
cv::GaussianBlur(imgFrame2Copy, imgFrame2Copy, cv::Size(5, 5), 0);
cv::absdiff(imgFrame1Copy, imgFrame2Copy, imgDifference);
cv::threshold(imgDifference, imgThresh, 30, 255.0, CV_THRESH_BINARY);
cv::imshow("imgThresh", imgThresh);
cv::Mat structuringElement3x3 = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(3, 3));
cv::Mat structuringElement5x5 = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(5, 5));
cv::Mat structuringElement7x7 = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(7, 7));
cv::Mat structuringElement15x15 = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15));
for (unsigned int i = 0; i < 2; i++) {
cv::dilate(imgThresh, imgThresh, structuringElement5x5);
cv::dilate(imgThresh, imgThresh, structuringElement5x5);
cv::erode(imgThresh, imgThresh, structuringElement5x5);
}
cv::Mat imgThreshCopy = imgThresh.clone();
std::vector> contours;
cv::findContours(imgThreshCopy, contours, cv::RETR_EXTERNAL, cv::CHAIN_APPROX_SIMPLE);
drawAndShowContours(imgThresh.size(), contours, "imgContours");
std::vector> convexHulls(contours.size());
for (unsigned int i = 0; i < contours.size(); i++) {
cv::convexHull(contours[i], convexHulls[i]);
}
drawAndShowContours(imgThresh.size(), convexHulls, "imgConvexHulls");
for (auto &convexHull : convexHulls) {
Blob possibleBlob(convexHull);
if (possibleBlob.currentBoundingRect.area() > 400 &&
possibleBlob.dblCurrentAspectRatio > 0.2 &&
possibleBlob.dblCurrentAspectRatio < 4.0 &&
possibleBlob.currentBoundingRect.width > 30 &&
possibleBlob.currentBoundingRect.height > 30 &&
possibleBlob.dblCurrentDiagonalSize > 60.0 &&
(cv::contourArea(possibleBlob.currentContour) / (double)possibleBlob.currentBoundingRect.area()) > 0.50) {
currentFrameBlobs.push_back(possibleBlob);
}
}
drawAndShowContours(imgThresh.size(), currentFrameBlobs, "imgCurrentFrameBlobs");
if (blnFirstFrame == true) {
for (auto ¤tFrameBlob : currentFrameBlobs) {
blobs.push_back(currentFrameBlob);
}
}
else {
matchCurrentFrameBlobsToExistingBlobs(blobs, currentFrameBlobs);
}
drawAndShowContours(imgThresh.size(), blobs, "imgBlobs");
imgFrame2Copy = imgFrame2.clone(); // get another copy of frame 2 since we changed the previous frame 2 copy in the processing above
drawBlobInfoOnImage(blobs, imgFrame2Copy);
bool blnAtLeastOneBlobCrossedTheLine = checkIfBlobsCrossedTheLine(blobs, intHorizontalLinePosition, carCount);
if (blnAtLeastOneBlobCrossedTheLine == true) {
cv::line(imgFrame2Copy, crossingLine[0], crossingLine[1], SCALAR_GREEN, 2);
}
else {
cv::line(imgFrame2Copy, crossingLine[0], crossingLine[1], SCALAR_RED, 2);
}
drawCarCountOnImage(carCount, imgFrame2Copy);
cv::imshow("imgFrame2Copy", imgFrame2Copy);
//cv::waitKey(0); // uncomment this line to go frame by frame for debugging
// now we prepare for the next iteration
currentFrameBlobs.clear();
imgFrame1 = imgFrame2.clone(); // move frame 1 up to where frame 2 is
/*if ((capVideo.get(CV_CAP_PROP_POS_FRAMES) + 1) < capVideo.get(CV_CAP_PROP_FRAME_COUNT)) {
capVideo.read(imgFrame2);
}
else {
std::cout << "end of video\n";
break;
} */
blnFirstFrame = false;
frameCount++;
chCheckForEscKey = cv::waitKey(1);
}
if (chCheckForEscKey != 27) { // if the user did not press esc (i.e. we reached the end of the video)
cv::waitKey(0); // hold the windows open to allow the "end of video" message to show
}
// note that if the user did press esc, we don't need to hold the windows open, we can simply let the program end which will close the windows
return(0);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void matchCurrentFrameBlobsToExistingBlobs(std::vector&existingBlobs, std::vector¤tFrameBlobs) {
for (auto &existingBlob : existingBlobs) {
existingBlob.blnCurrentMatchFoundOrNewBlob = false;
existingBlob.predictNextPosition();
}
for (auto ¤tFrameBlob : currentFrameBlobs) {
int intIndexOfLeastDistance = 0;
double dblLeastDistance = 100000.0;
for (unsigned int i = 0; i < existingBlobs.size(); i++) {
if (existingBlobs[i].blnStillBeingTracked == true) {
double dblDistance = distanceBetweenPoints(currentFrameBlob.centerPositions.back(), existingBlobs[i].predictedNextPosition);
if (dblDistance < dblLeastDistance) {
dblLeastDistance = dblDistance;
intIndexOfLeastDistance = i;
}
}
}
if (dblLeastDistance < currentFrameBlob.dblCurrentDiagonalSize * 0.5) {
addBlobToExistingBlobs(currentFrameBlob, existingBlobs, intIndexOfLeastDistance);
}
else {
addNewBlob(currentFrameBlob, existingBlobs);
}
}
for (auto &existingBlob : existingBlobs) {
if (existingBlob.blnCurrentMatchFoundOrNewBlob == false) {
existingBlob.intNumOfConsecutiveFramesWithoutAMatch++;
}
if (existingBlob.intNumOfConsecutiveFramesWithoutAMatch >= 5) {
existingBlob.blnStillBeingTracked = false;
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void addBlobToExistingBlobs(Blob ¤tFrameBlob, std::vector&existingBlobs, int &intIndex) {
existingBlobs[intIndex].currentContour = currentFrameBlob.currentContour;
existingBlobs[intIndex].currentBoundingRect = currentFrameBlob.currentBoundingRect;
existingBlobs[intIndex].centerPositions.push_back(currentFrameBlob.centerPositions.back());
existingBlobs[intIndex].dblCurrentDiagonalSize = currentFrameBlob.dblCurrentDiagonalSize;
existingBlobs[intIndex].dblCurrentAspectRatio = currentFrameBlob.dblCurrentAspectRatio;
existingBlobs[intIndex].blnStillBeingTracked = true;
existingBlobs[intIndex].blnCurrentMatchFoundOrNewBlob = true;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void addNewBlob(Blob ¤tFrameBlob, std::vector&existingBlobs) {
currentFrameBlob.blnCurrentMatchFoundOrNewBlob = true;
existingBlobs.push_back(currentFrameBlob);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
double distanceBetweenPoints(cv::Point point1, cv::Point point2) {
int intX = abs(point1.x - point2.x);
int intY = abs(point1.y - point2.y);
return(sqrt(pow(intX, 2) + pow(intY, 2)));
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void drawAndShowContours(cv::Size imageSize, std::vector> contours, std::string strImageName) {
cv::Mat image(imageSize, CV_8UC3, SCALAR_BLACK);
cv::drawContours(image, contours, -1, SCALAR_WHITE, -1);
cv::imshow(strImageName, image);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void drawAndShowContours(cv::Size imageSize, std::vector blobs, std::string strImageName) {
cv::Mat image(imageSize, CV_8UC3, SCALAR_BLACK);
std::vector> contours;
for (auto &blob : blobs) {
if (blob.blnStillBeingTracked == true) {
contours.push_back(blob.currentContour);
}
}
cv::drawContours(image, contours, -1, SCALAR_WHITE, -1);
cv::imshow(strImageName, image);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
bool checkIfBlobsCrossedTheLine(std::vector&blobs, int &intHorizontalLinePosition, int &carCount) {
bool blnAtLeastOneBlobCrossedTheLine = false;
for (auto blob : blobs) {
if (blob.blnStillBeingTracked == true && blob.centerPositions.size() >= 2) {
int prevFrameIndex = (int)blob.centerPositions.size() - 2;
int currFrameIndex = (int)blob.centerPositions.size() - 1;
if (blob.centerPositions[prevFrameIndex].y > intHorizontalLinePosition && blob.centerPositions[currFrameIndex].y <= intHorizontalLinePosition) {
carCount++;
blnAtLeastOneBlobCrossedTheLine = true;
}
}
}
return blnAtLeastOneBlobCrossedTheLine;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void drawBlobInfoOnImage(std::vector&blobs, cv::Mat &imgFrame2Copy) {
for (unsigned int i = 0; i < blobs.size(); i++) {
if (blobs[i].blnStillBeingTracked == true) {
cv::rectangle(imgFrame2Copy, blobs[i].currentBoundingRect, SCALAR_RED, 2);
int intFontFace = CV_FONT_HERSHEY_SIMPLEX;
double dblFontScale = blobs[i].dblCurrentDiagonalSize / 60.0;
int intFontThickness = (int)std::round(dblFontScale * 1.0);
cv::putText(imgFrame2Copy, std::to_string(i), blobs[i].centerPositions.back(), intFontFace, dblFontScale, SCALAR_GREEN, intFontThickness);
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void drawCarCountOnImage(int &carCount, cv::Mat &imgFrame2Copy) {
int intFontFace = CV_FONT_HERSHEY_SIMPLEX;
double dblFontScale = (imgFrame2Copy.rows * imgFrame2Copy.cols) / 300000.0;
int intFontThickness = (int)std::round(dblFontScale * 1.5);
cv::Size textSize = cv::getTextSize(std::to_string(carCount), intFontFace, dblFontScale, intFontThickness, 0);
cv::Point ptTextBottomLeftPosition;
ptTextBottomLeftPosition.x = imgFrame2Copy.cols - 1 - (int)((double)textSize.width * 1.25);
ptTextBottomLeftPosition.y = (int)((double)textSize.height * 1.25);
cv::putText(imgFrame2Copy, std::to_string(carCount), ptTextBottomLeftPosition, intFontFace, dblFontScale, SCALAR_GREEN, intFontThickness);
}
↧
getting unresolved external symbols Visual Studio 2015
I'm tring to build a solution that uses openCV. I'm now down to 12 errors in the link stage. What library would have the cv::String::allocate, cv::String::deallocate, and cv::Mat::Mat. What additional libraries do I need to add to the list below to clean these last one up?
I'm using visual studio 2015 C++ with the following
opencv-2.4.13
Linker additional dependencies
opencv_core2413d.lib
opencv_imgproc2413d.lib
opencv_highgui2413d.lib
opencv_ml2413d.lib
opencv_video2413d.lib
opencv_features2d2413d.lib
opencv_calib3d2413d.lib
opencv_objdetect2413d.lib
opencv_contrib2413d.lib
opencv_legacy2413d.lib
opencv_flann2413d.lib
VC++ Directories, Library Directories
C:\Darrah\openCV-2-4-13\opencv\build\x86\vc12
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "private: char * __thiscall cv::String::allocate(unsigned int)" (?allocate@String@cv@@AAEPADI@Z) referenced in function "public: __thiscall cv::String::String(char const *)" (??0String@cv@@QAE@PBD@Z) Pixmicro C:\Darrah\PCB\Pixmicro-master\Pixmicro\CaptureThread.obj
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "private: void __thiscall cv::String::deallocate(void)" (?deallocate@String@cv@@AAEXXZ) referenced in function "public: __thiscall cv::String::~String(void)" (??1String@cv@@QAE@XZ) Pixmicro C:\Darrah\PCB\Pixmicro-master\Pixmicro\CaptureThread.ob)
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "void __cdecl cv::error(int,class cv::String const &,char const *,char const *,int)" (?error@cv@@YAXHABVString@1@PBD1H@Z) referenced in function "public: __thiscall cv::Mat::Mat(class cv::Mat &&)" (??0Mat@cv@@QAE@$$QAV01@@Z) Pixmicro C:\Darrah\PCB\Pixmicro-master\Pixmicro\CaptureThread.obj 1
↧
How to define a matrix with 5000 specific elements
Hello, I need to define a matrix M, M is 5000*2. In matlab, M=[1,45;89,3;....], it's not regular, so I can't define it in a loop.
In my code I tried to define it like
Mat M = (Mat_(num, 3) << 994, 323, 0, 4014, 4295, 4395, 4906, 3423, 2792.....);
But when I use
`printf("number: %f", M.at(2, 1)`,
it gives me 0.
So could anyone tell me how to define such a matrix like in matlab M=[1 2 3; 4 5 6;....]
↧
↧
No Make file found
I need to install opencv extra modules.. so I followed the steps given :https://github.com/opencv/opencv_contrib
I did:
C:\Users\research lab>cd C:\opencv3.1\build
C:\opencv3.1\build> cmake -DOPENCV_EXTRA_MODULES_PATH=C:\opencv_ex\opencv_contrib-master\modules C:\opencv3.1\sources
I got:-- Configuring done
-- Generating done
-- Build files have been written to: C:/opencv3.1/build
but when i run : make-j5
i got an error : no targets specified and no makefile found..
I checked my build folder, no MAKEFILE was there .
WHY is it happening? does makefile is not being generated or some other issue is there?????
↧
textdetection sample producing errors
i am trying o run the file textdetection.cpp file present[ here ](https://github.com/opencv/opencv_contrib/tree/master/modules/text/samples) .. i tried it with different images but every time an exception is thrown of some memory location like *Microsoft C++ exception: cv::Exception at memory location 0x00CEC6BC.*
why is dis happening ?? any solutions ?? I m stuck wid this text detection from several days... :(
↧
How to pass values to main function (vs2015,opencv,c++)
if i have downloaded the code from somewhere lets say its abc.cpp and its having main as :
int main(int argc, char* argv[])
{
Mat image;
if (argc>1)
image = imread(argv[1]);
else
{
cout << " Usage: " << argv[0] << " [ ... ]" << endl;
return(0);
}}
how should i run this code ?? normally from the vs platform??? how to pass the image to be read????
how can we give values to argc or argv???
i have gone thru all the other similar questions here but dint found any solution to my problem??
↧
GUI for OpenCv with visual studio
Hi
I have implemented a code using C++ visual studio 2013, with external library: boost and opencv.
Now I'm trying to make a simple graphical user interface for the OpenCv with visual studio. The GUI is:
1. The user enters a text and this text then saved in a variable..
2. And when the user press "start" button, the system starts calling the functions.
Can we implement it with highgui? Or we need other tools?
Any suggestions for other tools would be appreciated.
Thanks in advance.!
[image description](/upfiles/14594411729415934.jpg)
↧
↧
Delaunay triangulation - edge flip?
I used this code: http://www.learnopencv.com/delaunay-triangulation-and-voronoi-diagram-using-opencv-c-python/ for Delaunay triangulation, now I'm trying to figure out how to flip edges like this: http://i.imgur.com/RqAQKN5.png.
I found that there is a member function of subdiv2d called "swapedges" which potentionally does exactly what I need but I don't know how it's supposed to be used, I'm pretty new at C++ and OpenCV and if there's anyone who could help me by showing an example of how it should work, I would be very thankful.
Thanks in advance.
↧
Problem with compiling a code opencv2.4.9
It's been two weeks that I try with the installation of opencv2.4.9, tdm-gcc-5.1.0-3, cmake-2.8.12.2-win32-x86, and codeblocks 10.05. I want to modify the viola&jones code (Haartraining), but I blocked because of this error:
C:\opencv\build\x86\mingw\lib\libopencv_haartraining_engine.a(cvboost.cpp.obj):cvboost.cpp:(.text$_ZL19cvEvalBtClassifierKP12CvClassifierP5CvMat+0x16c)||undefined reference to `cvStartReadSeq'|
C:\opencv\build\x86\mingw\lib\libopencv_haartraining_engine.a(cvboost.cpp.obj):cvboost.cpp:(.text$_ZL19cvEvalBtClassifierKP12CvClassifierP5CvMat+0x1fe)||undefined reference to `cvChangeSeqBlock'|
||=== Build finished: 2 errors, 0 warnings ===|
The simple image processing codes work well.
I want to know is this-that these two functions belong to a reference that I have to make.
plaise help me.
↧
OpenCV Error: Bad argument (Default classifier file not found!)
I am trying to run textdetection.cpp present here
OpenCV Error: Bad argument (Default classifier file not found!) in cv::text::ERClassifierNM1::ERClassifierNM1, file C:\opencv_ex\opencv_contrib-master\modules\text\src\erfilter.cpp,
Is there anyone having some idea about this error??? i have already added extra modules in to my opencv
↧