when i test my opencv package in c file by using the command
$ gcc cvtest.c -o cvtest `pkg-config opencv --cflags --libs`
There are with some error
/usr/bin/ld: cannot find -lcufft
/usr/bin/ld: cannot find -lnpps
/usr/bin/ld: cannot find -lnppi
/usr/bin/ld: cannot find -lnppc
/usr/bin/ld: cannot find -lcudart
According to this post in stackoverflow
http://stackoverflow.com/questions/24322466/makefile-opencv-stopped-working
i change the command with -L to my cuda lib path
$gcc -L /usr/local/cuda/lib64 cvtest.c -o cvtest `pkg-config opencv --cflags --libs`
it's working
or put the cuda lib path in LIBRARY_PATH
export LIBRARY_PATH=/usr/local/cuda/lib64
2015年3月22日 星期日
2015年1月14日 星期三
opencv anaconda error
when import cv2, there is an error
ImportError: /anaconda/bin/../lib/libm.so.6: version `GLIBC_2.15' not found (required by /usr/lib/x86_64-linux-gnu/libxvidcore.so.4)
just copy libm.so.6 from '/usr/lib/x86_64-linux-gnu' to '/home/username/anaconda/lib/'
then it can work
ImportError: /anaconda/bin/../lib/libm.so.6: version `GLIBC_2.15' not found (required by /usr/lib/x86_64-linux-gnu/libxvidcore.so.4)
just copy libm.so.6 from '/usr/lib/x86_64-linux-gnu' to '/home/username/anaconda/lib/'
then it can work
2014年10月30日 星期四
VC++ 2012 opencv error "0xc0000005讀取位置0x00000000時發生存取違規"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <opencv/cv.h>
using namespace cv;
using namespace std;
int main( int argc, char** argv ){
Mat image;
image = imread("1.jpg");
namedWindow( "show window", CV_WINDOW_AUTOSIZE );
imshow( "show window", image );
waitKey(0);
return 0;
}
應該是沒找到圖檔
建置VC++空專案時不要為方案建立目錄
將圖檔放在專案資料夾即可找到圖
x64系統
組態管理員->新增x64平台(來源複製Win32,勾選建立新專案平台
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <opencv/cv.h>
using namespace cv;
using namespace std;
int main( int argc, char** argv ){
Mat image;
image = imread("1.jpg");
namedWindow( "show window", CV_WINDOW_AUTOSIZE );
imshow( "show window", image );
waitKey(0);
return 0;
}
應該是沒找到圖檔
建置VC++空專案時不要為方案建立目錄
將圖檔放在專案資料夾即可找到圖
x64系統
組態管理員->新增x64平台(來源複製Win32,勾選建立新專案平台
2013年11月24日 星期日
compiling opencv with g++
There are two methods in compiling opencv with g++ without IDE
First is typing following command in command line directly
~$ g++ testcv.cpp -o testcv `pkg-config opencv --cflags --libs `
ps: ` place in the left of 1 on the keyboard, not ' in the left of Enter
Second is to set a makefile as below:
testcv: testcv.cpp
g++ -o ${@} $< `pkg-config opencv --cflags --libs `
and then type make in command line
~$ make
note:
keep the sequence of the command. put the `pkg-config opencv --cflags --libs ` after others.
If you make a command like
~$ g++ `pkg-config opencv --cflags --libs ` testcv.cpp -o testcv
there will be error
I don't know why...><
###########################################################################
opencv on qt creater ubuntu
set .pro
If an error occur like this
"Cannot connect creator comm socket /tmp/qt_temp.S27961/stub-socket: No such file or directory"
go to "Run Settings" and then cancel "Run in terminal"
First is typing following command in command line directly
~$ g++ testcv.cpp -o testcv `pkg-config opencv --cflags --libs `
ps: ` place in the left of 1 on the keyboard, not ' in the left of Enter
Second is to set a makefile as below:
testcv: testcv.cpp
g++ -o ${@} $< `pkg-config opencv --cflags --libs `
and then type make in command line
~$ make
note:
keep the sequence of the command. put the `pkg-config opencv --cflags --libs ` after others.
If you make a command like
~$ g++ `pkg-config opencv --cflags --libs ` testcv.cpp -o testcv
there will be error
I don't know why...><
###########################################################################
opencv on qt creater ubuntu
set .pro
INCLUDEPATH += /usr/local/include
LIBS += `pkg-config opencv --libs`
If an error occur like this
"Cannot connect creator comm socket /tmp/qt_temp.S27961/stub-socket: No such file or directory"
go to "Run Settings" and then cancel "Run in terminal"
2011年6月9日 星期四
open cv in python
Step 1: Download and install Python 2.7 & OpenCV 2.2
Step 2: Download and install NumPy 1.5.1 & SciPy 0.9.0rc5
Step 3: Setup Windows Path in Environment Variables(Add “C:/Python2.7;C:/OpenCV2.2/bin” to PATH)
Step 4: Copy the content of folder “C:/OpenCV2.2/Python2.7/Lib/site-packages” to folder “C:\Python27\Lib\site-packages“
訂閱:
文章 (Atom)