Cvloadimage Error
Contents |
●2 updated 2013-10-21 09:16:39 -0500 I installed "libopencv-dev version: 2.3.1-7" with "synaptic". when undefined reference to cvloadimage' ubuntu I(my os is ubuntu 12.04 32bit) .pro: QT +=
Cvloadimage Opencv
core gui TARGET = opencv_test1 TEMPLATE = app SOURCES += main.cpp\ widget.cpp HEADERS += widget.h javacv load image FORMS += widget.ui main.cpp: #include
Undefined Reference To Cv::imread
api ( preferred ) , cv::Mat, cv::imread(), etc.or include "opencv/cv.h" and "opencv/highgui.h"honestly, don't use the old c-api, it has restricted functionality (can't access anything invented after 2010) and support for it will go away fast.btw, which opencv version did you get via synaptic ? (current is 2.4.6)berak( 2013-10-21 08:52:17 -0500 )editthank you... libopencv-dev version: 2.3.1-7 . then I can't use any opencv2 functions?MohsenHk( 2013-10-21 09:22:58 -0500 )edit1oh, sure you can use opencv2 with 2.3.1.cvLoadImage amd IplImage are from the old c-api, avoid those. use cv::Mat img=cv::imread("my.png"), i.e, the c++ api2.3.1 is a bit old, no face-recognition, stitching, hdr stuff. maybe update the one or other dayoh, and i did not read properly:you need to link opencv_highgui231berak( 2013-10-21 09:32:58 -0500 )editthank you my friend :)MohsenHk( 2013-10-21 09:45:05 -0500 )edit1cvLoadImage should be fine as soon as you include library references in the .pro file, for example: INCLUDEPATH +=
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss cannot find -lippicv the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping http://answers.opencv.org/question/22804/undefined-reference-to-cvloadimage/ each other. Join them; it only takes a minute: Sign up OPENCV error: undefined reference to “cvLoadImage” up vote 1 down vote favorite I have two files: test.cpp : #include "highgui.h" #include
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about http://stackoverflow.com/questions/11042187/opencv-cvloadimage-function-doesnt-work-with-explicit-paths Stack Overflow the company Business Learn more about hiring developers or posting ads http://stackoverflow.com/questions/12418890/cvloadimage-returning-null with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up OpenCV cvLoadImage function doesn't work with explicit paths up vote 2 down vote undefined reference favorite I am new to using OpenCV and have run into an issue when I try to load an image using the cvLoadImage() function. The following code attempts to load the image "testImg.bmp" using (1) the working directory (the commented-out line of code) or (2) the explicit path to the file on the desktop. Note that the two image files are the exact same except that they are located in undefined reference to two locations (i.e. the working path is not the desktop). When I run the program using the first line (the commented-out line) the image is loaded and displays in a window. When I run the program as written (i.e. using the explicit path to the image on the desktop), however, an empty window pops up and the error message pops out (the "Unable to load image" message). Any help towards telling me what I have done wrong with the explicit path line is greatly appreciated as moving the image file to the working directory is, in general, not feasible/desirable. #include "stdafx.h" #include "opencv/cv.h" #include "opencv/highgui.h" using namespace std; int main(int argc, CHAR* argv[]) { //IplImage* img = cvLoadImage("testImg.bmp"); IplImage* img = cvLoadImage("C:\Users\Jeremy\Desktop\testImg.bmp"); if(!img) std::cerr<<"Unable to load image"< here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up cvLoadImage Returning NULL up vote 0 down vote favorite I am working on Ubuntu 12.04,32 bit platform with OpenCV Version 2.4.1 on eclipse ide. The cvLoadImage() function is returning me a NULL value even after putting the image in the current Location of the project where I have the cpp file. #include "highgui.h" #include