cv2.error:Opencv(3.4.3)

s = robot.get_camera_data()
plt.imshow(s)
plt.show()
s_ = robot.get_camera_data()
print (s_.shape)
plt.imshow(s_)
plt.show()
flow = cv2.calcOpticalFlowFarneback(s, s_, None, 0.5, 3, 15, 3, 5, 1.2, 0)

s与s_分别为在仿真环境中采集到的3通道图片数据,但是 运行代码报错,在网上也没有找到相关问题,谢谢大家。

cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\video\src\optflowgf.cpp:1114: error: (-215:Assertion failed) prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyrScale_ < 1 in function 'cv::`anonymous-namespace'::FarnebackOpticalFlowImpl::calc'
此处为代码运行错误。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
请教:尝试opencv2.4.13在linux下编译程序的报错
源代码:#include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/core/core.hpp> using namespace cv; int main() { VideoCapture cap(0); if(!cap.isOpened()) { return -1; } Mat frame; bool stop = false; while(!stop) { cap.read(frame); imshow("Video",frame); if(waitKey(30)==27) //Esc键退出 { stop = true; } } return 0; } 报错:~$ g++ -o opencvq opencv.cpp /tmp/ccQJKVIi.o: In function `main': opencv.cpp:(.text+0x29): undefined reference to `cv::VideoCapture::VideoCapture(int)' opencv.cpp:(.text+0x38): undefined reference to `cv::VideoCapture::isOpened() const' opencv.cpp:(.text+0x80): undefined reference to `cv::VideoCapture::read(cv::Mat&)' opencv.cpp:(.text+0xf9): undefined reference to `cv::Mat::ones(cv::Size_<int>, int)' opencv.cpp:(.text+0x146): undefined reference to `cv::VideoCapture::read(cv::Mat&)' opencv.cpp:(.text+0x33d): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' opencv.cpp:(.text+0x356): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' opencv.cpp:(.text+0x36f): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' opencv.cpp:(.text+0x3a1): undefined reference to `cv::addWeighted(cv::_InputArray const&, double, cv::_InputArray const&, double, double, cv::_OutputArray const&, int)' opencv.cpp:(.text+0x3ba): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' opencv.cpp:(.text+0x3fd): undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)' opencv.cpp:(.text+0x425): undefined reference to `cv::waitKey(int)' opencv.cpp:(.text+0x489): undefined reference to `cv::VideoCapture::~VideoCapture()' opencv.cpp:(.text+0x51a): undefined reference to `cv::VideoCapture::~VideoCapture()' /tmp/ccQJKVIi.o: In function `cv::Mat::~Mat()': opencv.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to `cv::fastFree(void*)' /tmp/ccQJKVIi.o: In function `cv::Mat::release()': opencv.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x47): undefined reference to `cv::Mat::deallocate()' /tmp/ccQJKVIi.o: In function `cv::Mat::operator()(cv::Rect_<int> const&) const': opencv.cpp:(.text._ZNK2cv3MatclERKNS_5Rect_IiEE[_ZNK2cv3MatclERKNS_5Rect_IiEE]+0x27): undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)' collect2: error: ld returned 1 exit status 第一次使用,在此请教各位前辈,谢谢了
图像分类OpenCV中svm使用报错
参考代码:https://blog.csdn.net/xq920831/article/details/85052318 第123行 用我自己的图片集的时候会报错: cv2.error: OpenCV(3.4.1) C:\projects\opencv-python\opencv\modules\ml\src\data.cpp:298: error: (-215) (layout == ROW_SAMPLE && responses.rows == nsamples) || (layout == COL_SAMPLE && responses.cols == nsamples) in function cv::ml::TrainDataImpl::setData 有人能帮帮我吗
opencv hello.obj : error LNK2001: unresolved external symbol _cvNamedWindow
使用的是vs2012 ultimate 和opencv2.4.2,配置基本成功,配置情况贴在后面 源程序如下: #include <cv.h> #include <highgui.h> //#pragma comment(lib,"cv.lib") //#pragma comment(lib,"highgui.lib") int main() { cvNamedWindow("my window",1); return 0; } 环境配置都是正常的: 在环境变量中配置:D:\Program Files (x86)\opencv2.4.2\opencv\build\x64\vc10\bin;D:\Program Files (x86)\opencv2.4.2\opencv\build\common\tbb\intel64\vc10 在vc++包含目录中配置 库目录中配置 连接器的附加依赖项中配置如下: opencv_calib3d242.lib opencv_contrib242.lib opencv_core242.lib opencv_features2d242.lib opencv_flann242.lib opencv_gpu242.lib opencv_haartraining_engine.lib opencv_highgui242.lib opencv_imgproc242.lib opencv_legacy242.lib opencv_ml242.lib opencv_nonfree242.lib opencv_objdetect242.lib opencv_photo242.lib opencv_stitching242.lib opencv_ts242.lib opencv_video242.lib opencv_videostab242.lib 当然debug和release都进行了如此的配置,debug下多一个字母d 以前也是如此配置,基本成功,但是这次始终成功不了,总是出现问题如下: hello.obj : error LNK2001: unresolved external symbol _cvNamedWindow 网上找了很多种解决方案都不奏效: 1说连接器和库不匹配 2说没有cv.lib 和higugui.lib几个文件,所以添加了 #pragma comment(lib,"cv.lib") #pragma comment(lib,"highgui.lib") 但还是运行不成功,求大神帮忙啊!!
Unrecognized or unsupported array type in function 'cvGetMat'问题
``` import numpy as np import cv2 img = cv2.imread('messi_2.jpg') mask = cv2.imread('mask2.png',0) dst = cv2.inpaint(img,mask,3,cv2.INPAINT_TELEA) cv2.imshow('dst',dst) cv2.waitKey(0) cv2.destroyAllWindows() ``` (base) C:\Users\lenovo>D:/anaconda/python.exe e:/Desktop/test/test.py Traceback (most recent call last): File "e:/Desktop/test/test.py", line 7, in <module> dst = cv2.inpaint(img,mask,3,cv2.INPAINT_TELEA) cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\core\src\array.cpp:2492: error: (-206:Bad flag (parameter or structure field)) Unrecognized or unsupported array type in function 'cvGetMat' 最终结果这样,哪里错了啊
opencv运行的时候报错,求解决办法
gray_image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 代码运行这一部分的时候经常不定期的发出这种错误 cv2.error: C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:11111: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor 有没有什么好的解决办法呢
python使用opencv处理视频流调用cv2.resizeWindow方法报错?
错误信息如下: Traceback (most recent call last): File "./tools/test.py", line 36, in <module> cv2.resizeWindow("enhanced", 640, 360); cv2.error: OpenCV(4.1.0) /io/opencv/modules/highgui/src/window_QT.cpp:592: error: (-27:Null pointer) NULL guiReceiver (please create a window) in function 'cvResizeWindow' 代码: ``` # -*- coding: utf-8 -*- import PIL import cv2 if __name__ == '__main__': writeVideo_flag = True video_src = "rtsp://admin:Admin123@85.18.13.222" video_capture = cv2.VideoCapture(video_src) source_file = '/approot1/ioth/ai/tf-faster-rcnn-master' print(video_capture.isOpened()) if writeVideo_flag: # 将检测的视频结果输出到output.avi,detection.txt # Define the codec and create VideoWriter object w = int(video_capture.get(3)) print(w) h = int(video_capture.get(4)) print(h) fourcc = cv2.VideoWriter_fourcc(*'MJPG') out = cv2.VideoWriter(source_file + '/img/output.avi', fourcc, 15, (w, h)) list_file = open(source_file + '/img/detection.txt', 'w') frame_index = -1 fps = 0.0 fpscount = 0 #while True: ret, frame = video_capture.read() # frame shape 640*480*3 print(frame) while True: if ret == True: #窗口可以随意调整大小 #这行报错 cv2.resizeWindow("detect Inout", 640, 360); fpscount += 1 else: break; if fpscount % 1 == 0: image = PIL.Image.fromarray(frame) ```
OPencv使用下cvtColor 出错
环境:树莓派3 raspberry 代码片段: import cv2 import numpy as np cap = cv2.VideoCapture(0) faceCasecade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") while(True): ret,frame = cap.read() gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiscale( gray, scaleFactor=1.2, minNeighbors = 5, minSize = (30, 30) ) print("Found {0} faces!".format(len(faces))) for(x, y, w, h) in faces: cv2.rectangele(frame,(x,y),(x+w,y+h),(0,255,0),2) cv.inshow('frame',frame) if cv2.waitKey(1)& 0xFF ==ord('q'): break cap.release() cv2.destroyAllwindows() 报错: Traceback (most recent call last): File "/home/pi/Desktop/OPenCV/live.py", line 11, in <module> gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(3.4.3) /home/pi/opencv-3.4.3/modules/imgproc/src/color.cpp:181: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor' 如何解决
谁能帮忙看一下OpenCV 3.4.1源码的类型转换编译错误?
环境: 1. Ubuntu 12.04 LTS 2. cmake 3.5.1 3. OpenCV 3.4.1源码 4. Arm Cortex-A7 NXP i.MX6Q 5. 已经sudo为root 执行过程 cd opencv-3.4.1 mkdir build cd build cmakd -D CMAKE_BUILD_TYPE=Relase -D CMAKE_INSTALL_PREFIX=/usr/local .. make make install 出错提示: [ 0%] Built target gen-pkgconfig [ 9%] Built target libwebp [ 14%] Built target IlmImf [ 20%] Built target libprotobuf [ 23%] Built target carotene_objs [ 24%] Built target tegra_hal [ 24%] Built target opencv_ts_pch_dephelp [ 24%] Built target pch_Generate_opencv_ts [ 25%] Built target opencv_core_pch_dephelp [ 25%] Built target pch_Generate_opencv_core [ 31%] Built target opencv_core [ 31%] Built target opencv_imgproc_pch_dephelp [ 31%] Built target pch_Generate_opencv_imgproc [ 31%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/smooth.cpp.o /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth1N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2676:31: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2676:31: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth1N1(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2693:24: error: conversion from ‘const {anonymous}::ufixedpoint16’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2693:24: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:289:22: note: {anonymous}::ufixedpoint16::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:288:22: note: {anonymous}::ufixedpoint16::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:287:22: note: {anonymous}::ufixedpoint16::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth3N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2740:71: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2740:71: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth5N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2816:109: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2816:109: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2919:18: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2914:23: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] make[2]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/smooth.cpp.o] Error 1 make[1]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/all] Error 2 make: *** [all] Error 2 说明: 关键之处是 /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2919:18: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous 类型转换错误。 请教各位大侠,这个错误出在哪里,如何解决呢? 谢谢!
YOLO v3 OpenCV-3.4.1
balbal..... 下载完weight后,在终端输入: ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg 我是根据网上Yolo v3教程一步一步来的,装了最新的opencv,发现如下问题: 104 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BFLOPs 105 conv 255 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 255 0.353 BFLOPs 106 yolo Loading weights from yolov3.weights...Done! data/dog.jpg: Predicted in 0.045922 seconds. dog: 99% truck: 92% bicycle: 99% OpenCV(3.4.1) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in type, file /home/kiraq/home/installation/opencv-3.4.1/modules/core/src/matrix_wrap.cpp, line 807 terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(3.4.1) /home/kiraq/home/installation/opencv-3.4.1/modules/core/src/matrix_wrap.cpp:807: error: (-215) (flags & FIXED_TYPE) != 0 in function type Aborted (core dumped) 请问如何解决?
我在使用Python对图像进行二值化的时候,用如下的代码却出现了这样的错误,求教?????????
代码:import cv2 gaosi = cv2.adaptiveThreshold(huidu, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 5, 7) io.imshow(gaosi)# 错误:error: OpenCV(3.4.1) C:\Miniconda3\conda-bld\opencv-suite_1533128839831\work\modules\imgproc\src\thresh.cpp:1524: error: (-215) src.type() == (((0) & ((1 << 3) - 1)) + (((1)-1) << 3)) in function cv::adaptiveThreshold
QT opencv C++ Android编译问题
最近想把windows下写好的opencv代码移植到Android平台上运行,于是搭建了一个QT for Android的编译环境,然后把代码放到QT里面编译。 刚开始用-Desktop_Qt_5_4_1_MinGW_32bit编译运行正常,可是把编译器换成Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1之后就就报错,在网上查了好几天都没有找到解决方案。 有没有哪位大神知道的,帮帮忙,在下不胜感激!! 以下是关键的代码部分: .pro文件: INCLUDEPATH += E:\opencv\build\include\opencv2\ E:\opencv\build\include\opencv\ E:\opencv\build\include LIBS += E:\opencv_cmake\lib\libopencv_core249.dll.a\ E:\opencv_cmake\lib\libopencv_highgui249.dll.a\ E:\opencv_cmake\lib\libopencv_imgproc249.dll.a\ E:\opencv_cmake\lib\libopencv_calib3d249.dll.a\ E:\opencv_cmake\lib\libopencv_contrib249.dll.a\ E:\opencv_cmake\lib\libopencv_features2d249.dll.a\ E:\opencv_cmake\lib\libopencv_flann249.dll.a\ E:\opencv_cmake\lib\libopencv_gpu249.dll.a\ E:\opencv_cmake\lib\libopencv_legacy249.dll.a\ E:\opencv_cmake\lib\libopencv_ml249.dll.a\ E:\opencv_cmake\lib\libopencv_objdetect249.dll.a\ E:\opencv_cmake\lib\libopencv_video249.dll.a 包含的opencv头文件: #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> opencv代码部分 image = cv::imread("./1.jpg"); if(!image.data) { QMessageBox msgBox; msgBox.setText(tr("image data is null")); msgBox.exec(); } else { cv::cvtColor(image,image,CV_BGR2RGB); img = QImage((const unsigned char*)(image.data),image.cols,image.rows, image.cols*image.channels(), QImage::Format_RGB888); ui->label->clear(); ui->label->setPixmap(QPixmap::fromImage(img)); //ui->processPushButton->setEnabled(true); ui->label->resize(ui->label->pixmap()->size()); } 报错情况: ![图片说明](https://img-ask.csdn.net/upload/201607/28/1469671885_529743.png) E:\opencv\build\include\opencv2\core\mat.hpp:278: error: undefined reference to `cv::fastFree(void*)' E:\opencv\build\include\opencv2\core\mat.hpp:298: error: undefined reference to `cv::Mat::copySize(cv::Mat const&)' E:\opencv\build\include\opencv2\core\mat.hpp:367: error: undefined reference to `cv::Mat::deallocate()' E:\QT_Work\build-testAndroid-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug\mainwindow.obj:-1: In function `cv::Mat::operator=(cv::Mat const&)': E:\QT_Work\build-testAndroid-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug\mainwindow.obj:-1: In function `cv::Mat::release()': E:\QT_Work\testAndroid\mainwindow.cpp:28: error: undefined reference to `cv::imread(std::string const&, int)'
opencv3.4 加载tensorflow模型 net.forward()总是报错?
OpenCV Error: Assertion failed (!_aspectRatios.empty(), _minSize > 0) in cv::dnn::PriorBoxLayerImpl::PriorBoxLayerImpl, file C:\build\master_winpack-build-win64-vc14\opencv\modules\dnn\src\layers\prior_box_layer.cpp, line 207 C:\build\master_winpack-build-win64-vc14\opencv\modules\dnn\src\layers\prior_box_layer.cpp:207: error: (-215) !_aspectRatios.empty(), _minSize > 0 in function cv::dnn::PriorBoxLayerImpl::PriorBoxLayerImpl
为什么Opencv3.4.0使用make编译时出现错误?
环境:Debian(Raspiberry Pi Buster) cmake version: 3.0.2 gcc version: 8.2.0 python version: 3.7.2 make version: 4.2.1 本来计划用opencv基于python进行图像辨别 在使用cmake配置完成后使用make命令编译: ``` sudo make ``` 编译到大约90%时,出现如下错误: ``` #这是之前很多条控制台信息中的warning warning: cast between incompatible function types from ‘PyObject* (*)(PyObject*, PyObject*, PyObject*)’ {aka ‘_object* (*)(_object*, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* (*)(_object*, _object*)’} [-Wcast-function-type] ``` ``` #make错误,退出 make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/build.make:56: modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:21149: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2 make: *** [Makefile:138: all] Error 2 ``` 如图(图1中使用了make -i选项忽略错误,继续编译剩余部分,但open_cv python3没有成功编译): ![图片说明](https://img-ask.csdn.net/upload/201908/11/1565498546_278259.png) (图2显示了make的错误) ![图片说明](https://img-ask.csdn.net/upload/201908/11/1565499335_385379.png) ``` #忽略错误后出现的c++error c++: error: Cmakefiles/opencv_python3.dir/__/src2/cv2.cpp.o No such file or dictionary ``` 在网上看到的编译错误的例子都和这个有所区别,没有能够很好地解决问题。有的说这是gcc编译器的问题 希望各位大佬们能够帮忙分析一下错误的原因,因为我的项目急需配置好opencv,也没有其它更好的替代,谢谢~
opencv3.1.0交叉编译出错
我在给mini2440移植opencv3.1.0的时候,make编译opencv过程中出错了。log如下: CMakeFiles/opencv_perf_core.dir/perf/perf_math.cpp.obj: In function `cv::Mat::~Mat()': perf_math.cpp.text._ZN2cv3MatD1Ev[cv::Mat::~Mat()]+0x1c): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj: In function `Size_MatType_CmpType_compare:erfTestBody()': perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x30c): undefined reference to `__sync_fetch_and_add_4' perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x378): undefined reference to `__sync_fetch_and_add_4' perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x3ec): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj: In function `Size_MatType_CmpType_compareScalar:erfTestBody()': perf_compare.cpp.text._ZN34Size_MatType_CmpType_compareScalar12PerfTestBodyEv+0x32c): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj:perf_compare.cpp.text._ZN34Size_MatType_CmpType_compareScalar12PerfTestBodyEv+0x3a0): more undefined references to `__sync_fetch_and_add_4' follow collect2: ld returned 1 exit status make[2]: *** [bin/opencv_perf_core] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2 make: *** [all] Error 2 我用的是Ubuntu14.04,32位虚拟机。 查网上说是CMAKE_C_FLAGS要设为-march=armv4t 可是我安装提示设置了CMAKE_C_FLAGS 和 CMAKE_CXX_FLAGS的值,错误还是没有消失。 我试过了opencv3.1。0和opencv3.2.0了,都会出现这个问题。因为项目需求要用到opencv3 所以只能自己编译最新版,,泪奔 有大神遇到过这个问题吗?
QT5.9+OpenCV3.10_contrib,GitHub上人脸识别找不到face相关类和hpp
调配了很多天的环境,网上说OpenCV3以后face.hpp在contrib扩展包里面,我都配置好之后还是有如下毛病:(之前用的OpenCV2.410也是如下毛病) #如果在头文件加上 ``` #include<opencv2/contrib/contrib.hpp> #include<opencv2/face.hpp> ``` 就会报错 ``` error: opencv2/face.hpp: No such file or directory ``` ## 如果把这个注释掉(依然保留#include<opencv2/contrib/contrib.hpp>) 就会报错 ![图片说明](https://img-ask.csdn.net/upload/201709/13/1505307425_541519.png) 即 face名词空间还是没找到,和face有关的类还是没找到 百度了很深的程度也没有解决,希望有前辈指点一下,很想完成一个人脸识别的功能 下面把代码都贴出来(UI就不放了) 1、pro文件: ``` #------------------------------------------------- # # Project created by QtCreator 2015-11-11T08:11:51 # #------------------------------------------------- QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = face_recognition TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui INCLUDEPATH+=C:\OpenCV_contrib\include\opencv\ C:\OpenCV_contrib\include\opencv2\ C:\OpenCV_contrib\include LIBS += -LC:/OpenCV_contrib/lib -lopencv_core2410.dll \ -lopencv_highgui2410.dll -lopencv_imgproc2410.dll -lopencv_features2d2410.dll \ -lopencv_calib3d2410.dll \ -lopencv_objdetect2410.dll \ -lopencv_contrib2410.dll ``` MainWindow.h : ``` #ifndef MAINWINDOW_H #define MAINWINDOW_H #include<QMainWindow> #include<QCloseEvent> #include<opencv2/highgui/highgui.hpp> #include<opencv2/imgproc/imgproc.hpp> #include<opencv2/core/core.hpp> #include<opencv2/objdetect/objdetect.hpp> #include<opencv2/contrib/contrib.hpp> //#include<opencv2/face.hpp> #include<iostream> using namespace std; using namespace cv; using namespace face; namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: void on_loadButton_clicked(); void on_testButton_clicked(); void on_regButton_clicked(); void closeEvent(QCloseEvent *e); private: Ui::MainWindow *ui; Ptr<LBPHFaceRecognizer> model; QString fileName,saveXml,saveName,name[10]; }; #endif // MAINWINDOW_H ``` cpp文件: ``` #include "mainwindow.h" #include "ui_mainwindow.h" #include<QDebug> #include<QFileDialog> #include<QPixmap> #include<QFile> #include<QTextStream> //正面,上,下,左,右5张.阉值85.00 MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); saveName = "Names.txt"; saveXml = "att_model.xml"; model = createLBPHFaceRecognizer(); if(QFile::exists(saveXml)&&QFile::exists(saveName)) { model->load(saveXml.toStdString()); QFile file(saveName); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return; QTextStream in(&file); QString lineText; while(!in.atEnd()) { lineText = in.readLine(); QString i = lineText.split(":").first(); name[i.toInt()] = lineText.split(":").last(); } } // for(int i=1;i<11;i++) // for(int j=1;j<10;j++) // { // QString file = "att_faces/s%1/%2.pgm"; // images.push_back(imread(file.arg(i).arg(j).toStdString(), CV_LOAD_IMAGE_GRAYSCALE)); // labels.push_back(i); // } // model = createLBPHFaceRecognizer(); // //model->train(images, labels); // //model->save("att_model.xml"); // model->load("att_model.xml"); } MainWindow::~MainWindow() { delete ui; } void MainWindow::closeEvent(QCloseEvent *e) { model->save(saveXml.toStdString()); QFile file(saveName); if(!file.open(QIODevice::WriteOnly|QIODevice::Text)) return; QTextStream out(&file); for(int i=0;i<10;i++) { if(name[i].isEmpty()) continue; out<<i<<":"<<name[i]<<"\n"; } e->accept(); } void MainWindow::on_loadButton_clicked() { fileName = QFileDialog::getOpenFileName(this,tr("选择图片"),tr(".")); if(fileName.isEmpty()) return; ui->showLabel->setPixmap(QPixmap(fileName)); ui->textBrowser->append(tr("打开图片%1").arg(fileName.split("/").last())); } void MainWindow::on_testButton_clicked() { if(fileName.isEmpty()||ui->nameEdit->text().isEmpty()) return; vector<Mat> images; vector<int> labels; images.push_back(imread(fileName.toStdString(),CV_LOAD_IMAGE_GRAYSCALE)); labels.push_back(ui->labelBox->value()); name[ui->labelBox->value()] = ui->nameEdit->text(); ui->textBrowser->append(tr("准备训练: 姓名:%1 标签:%2 ...").arg(ui->nameEdit->text()).arg(ui->labelBox->value())); model->update(images,labels); ui->textBrowser->append(tr("训练完成")); } void MainWindow::on_regButton_clicked() { ui->nameLabel->clear(); if(fileName.isEmpty()) return; Mat image = imread(fileName.toStdString(), CV_LOAD_IMAGE_GRAYSCALE); model->setThreshold(ui->doubleSpinBox->value()); ui->textBrowser->append(tr("准备识别Threshold:%1 ...").arg(ui->doubleSpinBox->value())); int result = model->predict(image); ui->textBrowser->append(tr("识别完成")); if(result < 0) ui->nameLabel->setText(tr("无法识别此人")); else ui->nameLabel->setText(tr("%1").arg(name[result])); } ``` main.cpp: #include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
arm-Fedaro 调用opencv 失败
问题如下,请问怎么解决啊? [toybrick@localhost LSF]$ python3 cv_test Failed to query video capabilities: Inappropriate ioctl for device libv4l2: error getting capabilities: Inappropriate ioctl for device VIDEOIO ERROR: V4L: device /home/toybrick/LSF/input.mp4: Unable to query number of channels mpi: mpp version: Without VCS info mpp_rt: NOT found ion allocator mpp_rt: found drm allocator mpp: deprecated block control, use timeout control instead warning: GStreamer: unable to query duration of stream (/builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:904) warning: Cannot query video position: status=1 value=1 duration=-1 (/builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:952)
ubuntu16.04安装opencv时,make不通过该怎么办?
cmake已经完成,情况如下: ``` cmake .. -- Detected version of GNU GCC: 54 (504) -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") -- Checking for module 'gstreamer-base-1.0' -- No package 'gstreamer-base-1.0' found -- Checking for module 'gstreamer-video-1.0' -- No package 'gstreamer-video-1.0' found -- Checking for module 'gstreamer-app-1.0' -- No package 'gstreamer-app-1.0' found -- Checking for module 'gstreamer-riff-1.0' -- No package 'gstreamer-riff-1.0' found -- Checking for module 'gstreamer-pbutils-1.0' -- No package 'gstreamer-pbutils-1.0' found -- Checking for module 'gstreamer-base-0.10' -- No package 'gstreamer-base-0.10' found -- Checking for module 'gstreamer-video-0.10' -- No package 'gstreamer-video-0.10' found -- Checking for module 'gstreamer-app-0.10' -- No package 'gstreamer-app-0.10' found -- Checking for module 'gstreamer-riff-0.10' -- No package 'gstreamer-riff-0.10' found -- Checking for module 'gstreamer-pbutils-0.10' -- No package 'gstreamer-pbutils-0.10' found -- Looking for linux/videodev.h -- Looking for linux/videodev.h - not found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - found -- Looking for sys/videoio.h -- Looking for sys/videoio.h - not found -- Checking for module 'libavresample' -- No package 'libavresample' found -- Looking for libavformat/avformat.h -- Looking for libavformat/avformat.h - found -- Looking for ffmpeg/avformat.h -- Looking for ffmpeg/avformat.h - not found -- Checking for module 'libgphoto2' -- No package 'libgphoto2' found -- found IPP (ICV version): 9.0.1 [9.0.1] -- at: /home/quxutao/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx -- CUDA detected: 7.5 -- CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30 -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake -- Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "2.7" (found /home/quxutao/.virtualenvs/cv/bin/python) -- Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "2.6" (found /home/quxutao/.virtualenvs/cv/bin/python) -- Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "3.4" (found /home/quxutao/.virtualenvs/cv/bin/python) -- Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "3.2" (found /home/quxutao/.virtualenvs/cv/bin/python) -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) -- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file -- Caffe: NO -- Protobuf: YES -- Glog: NO -- HDF5: YES -- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags -- Tesseract: NO -- HDF5: YES -- Build libprotobuf from sources: -- The protocol buffer compiler not found -- Tesseract: NO -- -- General configuration for OpenCV 3.1.0 ===================================== -- Version control: unknown -- -- Platform: -- Host: Linux 4.15.0-47-generic x86_64 -- CMake: 3.5.1 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/make -- Configuration: RELEASE -- -- C/C++: -- Built as dynamic libs?: YES -- C++ Compiler: /usr/bin/c++ (ver 5.4.0) -- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG -- C Compiler: /usr/bin/cc -- C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG -- C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG -- Linker flags (Release): -- Linker flags (Debug): -- Precompiled headers: YES -- Extra dependencies: /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libtiff.so /usr/lib/x86_64-linux-gnu/libjasper.so /usr/lib/x86_64-linux-gnu/libjpeg.so gtk-3 gdk-3 pangocairo-1.0 pango-1.0 atk-1.0 cairo-gobject cairo gdk_pixbuf-2.0 gio-2.0 gobject-2.0 gthread-2.0 glib-2.0 dc1394 v4l1 v4l2 avcodec-ffmpeg avformat-ffmpeg avutil-ffmpeg swscale-ffmpeg /usr/lib/x86_64-linux-gnu/libbz2.so /usr/lib/x86_64-linux-gnu/hdf5/openmpi/lib/libhdf5.so /usr/lib/x86_64-linux-gnu/libsz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so dl m pthread rt cudart nppc nppi npps cufft -L/usr/lib/x86_64-linux-gnu -- 3rdparty dependencies: libwebp IlmImf libprotobuf -- -- OpenCV modules: -- To be built: cudev core cudaarithm flann hdf imgproc ml reg surface_matching video cudabgsegm cudafilters cudaimgproc cudawarping dnn fuzzy imgcodecs photo shape videoio cudacodec highgui objdetect plot ts xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo datasets rgbd stereo structured_light superres tracking videostab xfeatures2d ximgproc aruco optflow stitching -- Disabled: world contrib_world -- Disabled by dependency: - -- Unavailable: java python2 python3 viz cvv matlab sfm -- -- GUI: -- QT: NO -- GTK+ 3.x: YES (ver 3.18.9) -- GThread : YES (ver 2.48.2) -- GtkGlExt: NO -- OpenGL support: NO -- VTK support: NO -- -- Media I/O: -- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8) -- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver ) -- WEBP: build (ver 0.3.1) -- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.54) -- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.6) -- JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1) -- OpenEXR: build (ver 1.7.1) -- GDAL: NO -- -- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: YES (ver 2.2.4) -- FFMPEG: YES -- codec: YES (ver 56.60.100) -- format: YES (ver 56.40.101) -- util: YES (ver 54.31.100) -- swscale: YES (ver 3.1.101) -- resample: NO -- gentoo-style: YES -- GStreamer: NO -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- OpenNI2: NO -- PvAPI: NO -- GigEVisionSDK: NO -- UniCap: NO -- UniCap ucil: NO -- V4L/V4L2: Using libv4l1 (ver 1.10.0) / libv4l2 (ver 1.10.0) -- XIMEA: NO -- Xine: NO -- gPhoto2: NO -- -- Parallel framework: pthreads -- -- Other third-party libraries: -- Use IPP: 9.0.1 [9.0.1] -- at: /home/quxutao/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx -- Use IPP Async: NO -- Use VA: NO -- Use Intel VA-API/OpenCL: NO -- Use Eigen: NO -- Use Cuda: YES (ver 7.5) -- Use OpenCL: YES -- Use custom HAL: NO -- -- NVIDIA CUDA -- Use CUFFT: YES -- Use CUBLAS: NO -- USE NVCUVID: NO -- NVIDIA GPU arch: 20 21 30 35 -- NVIDIA PTX archs: 30 -- Use fast math: NO -- -- OpenCL: -- Version: dynamic -- Include path: /home/quxutao/opencv-3.1.0/3rdparty/include/opencl/1.2 -- Use AMDFFT: NO -- Use AMDBLAS: NO -- -- Python 2: -- Interpreter: NO -- -- Python 3: -- Interpreter: NO -- -- Python (for build): NO -- -- Java: -- ant: NO -- JNI: NO -- Java wrappers: NO -- Java tests: NO -- -- Matlab: Matlab not found or implicitly disabled -- -- Documentation: -- Doxygen: NO -- PlantUML: NO -- -- Tests and samples: -- Tests: YES -- Performance tests: YES -- C/C++ Examples: YES -- -- Install path: /usr/local -- -- cvconfig.h is in: /home/quxutao/opencv-3.1.0/build -- ----------------------------------------------------------------- -- -- Configuring done -- Generating done -- Build files have been written to: /home/quxutao/opencv-3.1.0/build ``` 但是make的时候,就报错: ``` make [ 4%] Built target libwebp [ 4%] Built target IlmImf [ 4%] Built target opencv_cudev [ 4%] Built target opencv_core_pch_dephelp [ 4%] Built target pch_Generate_opencv_core [ 4%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o /usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’: /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope return (char *) memcpy (__dest, __src, __n) + __n; ^ CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:266 (message): Error generating file /home/quxutao/opencv-3.1.0/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o modules/core/CMakeFiles/opencv_core.dir/build.make:399: recipe for target 'modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o' failed make[2]: *** [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o] Error 1 CMakeFiles/Makefile2:2307: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:160: recipe for target 'all' failed make: *** [all] Error 2 ``` 弄了一下午了,没有找到相关的解决办法。我的cuda是7.5,其实不用GPU也可以的,我只是想用KAZE滤波。。。跪求大神帮忙。。。
import cv2 error : dll load failed
我的环境: python 3.6.5 windows 2008 r2 enterprise 我通过 ``` pip install opencv-python pip install opencv-contrib-python ``` 安装opencv 然后当我导入cv2的时候却出现了如下的错误 ``` In [2]: import cv2 --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-c8ec22b3e787> in <module>() ----> 1 import cv2 c:\python36\lib\site-packages\cv2\__init__.py in <module>() 1 import importlib 2 ----> 3 from .cv2 import * 4 from .data import * 5 ImportError: DLL load failed: 找不到指定的模块。 ``` 查找了很多的资料我尝试去下载安装C++ Redistributable Package的各个版本并且去更新系统和去https://www.lfd.uci.edu/~gohlke/pythonlibs/上下载对应whl文件来安装仍旧不能解决这个问题,奇怪的是在我的win7上安装opencv然后导入就没有问题,难道是系统的问题?那么我该如何去查找问题的根源并且去解决呢 万分感谢
opencv3.0 error C2065: SurfFeatureDetector未定义标识符
编程环境:win7旗舰版+opencv3.0(含opencv_contrib-master)+vs2013 我在opencv3.0下使用SURF算法提取特征时出现了以下错误:error C2065: “SurfFeatureDetector”未定义标识符 我在nonfree.hpp文件下查看了SurfFeatureDetector的定义,在路径“opencv2/xfeatures2d/nonfree.hpp”下可以找到nonfree.hpp(这个路径是用CMAKE 编译 opencv_contrib-master下 源代码后下的相应路径)。 在nonfree.hpp中明明可以看到SURF类的定义和SurfFeatureDetector的类型定义,nonfree.hpp下的一段代码如下 class CV_EXPORTS_W SURF : public Feature2D { public: /** @param hessianThreshold Threshold for hessian keypoint detector used in SURF. @param nOctaves Number of pyramid octaves the keypoint detector will use. @param nOctaveLayers Number of octave layers within each octave. @param extended Extended descriptor flag (true - use extended 128-element descriptors; false - use 64-element descriptors). @param upright Up-right or rotated features flag (true - do not compute orientation of features; false - compute orientation). */ CV_WRAP static Ptr<SURF> create(double hessianThreshold=100, int nOctaves = 4, int nOctaveLayers = 3, bool extended = false, bool upright = false); CV_WRAP virtual void setHessianThreshold(double hessianThreshold) = 0; CV_WRAP virtual double getHessianThreshold() const = 0; CV_WRAP virtual void setNOctaves(int nOctaves) = 0; CV_WRAP virtual int getNOctaves() const = 0; CV_WRAP virtual void setNOctaveLayers(int nOctaveLayers) = 0; CV_WRAP virtual int getNOctaveLayers() const = 0; CV_WRAP virtual void setExtended(bool extended) = 0; CV_WRAP virtual bool getExtended() const = 0; CV_WRAP virtual void setUpright(bool upright) = 0; CV_WRAP virtual bool getUpright() const = 0; }; typedef SURF SurfFeatureDetector; typedef SURF SurfDescriptorExtractor; ``` 我已经在VC++包含目录中添加了include, opencv 和 opencv2三个文件夹下的路径。也在连接器中添加了相应的*.lib文件。#include "opencv2/xfeatures2d/nonfree.hpp"时也没有报错,为什么还是提示SurfFeatureDetector是未定义的标识符呢?
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
使用 Docker 部署 Spring Boot 项目
Docker 技术发展为微服务落地提供了更加便利的环境,使用 Docker 部署 Spring Boot 其实非常简单,这篇文章我们就来简单学习下。首先构建一个简单的 S...
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
redis分布式锁,面试官请随便问,我都会
文章有点长并且绕,先来个图片缓冲下! 前言 现在的业务场景越来越复杂,使用的架构也就越来越复杂,分布式、高并发已经是业务要求的常态。像腾讯系的不少服务,还有CDN优化、异地多备份等处理。 说到分布式,就必然涉及到分布式锁的概念,如何保证不同机器不同线程的分布式锁同步呢? 实现要点 互斥性,同一时刻,智能有一个客户端持有锁。 防止死锁发生,如果持有锁的客户端崩溃没有主动释放锁,也要保证锁可以正常释...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Java世界最常用的工具类库
Apache Commons Apache Commons有很多子项目 Google Guava 参考博客
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
为什么要学数据结构?
一、前言 在可视化化程序设计的今天,借助于集成开发环境可以很快地生成程序,程序设计不再是计算机专业人员的专利。很多人认为,只要掌握几种开发工具就可以成为编程高手,其实,这是一种误解。要想成为一个专业的开发人员,至少需要以下三个条件: 1) 能够熟练地选择和设计各种数据结构和算法 2) 至少要能够熟练地掌握一门程序设计语言 3) 熟知所涉及的相关应用领域的知识 其中,后两个条件比较容易实现,而第一个...
Android 9.0 init 启动流程
阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:一、启动流程概述一、 启动流程概述Android启动流程跟Linux启动类似,大致分为如下五个阶段。1.开机上电,加载固化的ROM。2.加载BootLoader,拉起Android OS。3.加载Uboot,初始外设,引导Kernel启动等。...
相关热词 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件 c#注册dll文件 c#安装.net
立即提问