opencv3.0

Python 2.7/OpenCV 3.3: Error in cv2.initUndistortRectifyMap . Not showing undistort rectified images

耗尽温柔 提交于 2020-01-13 19:55:47
问题 I want to distort and rectified my stereo images. For which I used Opencv 3.3 in Python 2.7. Code I used is : import cv2 import numpy as np cameraMatrixL = np.load('mtx_left.npy') distCoeffsL = np.load('dist_left.npy') cameraMatrixR = np.load('mtx_right.npy') distCoeffsR = np.load('dist_right.npy') R = np.load('R.npy') T = np.load('T.npy') imgleft = cv2.imread('D:\python\camera calibration and 3d const\left\left60.png',0) imgright = cv2.imread('D:\python\camera calibration and 3d const\Right

contrib module missing in opencv 3.0?

大憨熊 提交于 2020-01-13 08:33:13
问题 I am using OpenCV 3.0 beta. I tried to create a face recogniser using createLBPHFaceRecognizer(); class as, **Ptr <FaceRecognizer> model = createLBPHFaceRecognizer();** the error I have is **error: 'createLBPHFaceRecognizer' was not declared in this scope** I have researched and found that the class exists in contrib module of opencv2 (opencv2/contrib/contrib.hpp) in previous versions of OpenCV But this module is not available in opencv 3.0 beta. So where are the recogniser classes defined in

CMake error when building OpenCV - CMakeLists not match

笑着哭i 提交于 2020-01-12 23:04:38
问题 I tried to build OpenCV 3.1.0 on my Raspberry Pi 2B. Unfortunetly, when I trying: cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=OFF \ -D INSTALL_PYTHON_EXAMPLES=OFF /home/pi/Downloads/opencv-3.1.0 It gave me a error :( : CMake Error: The source "/home/pi/Downloads/opencv-3.1.0/CMakeLists.txt" does not match the source "/home/pi/Downloads/opencv-3.1.0/modules/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.

OpenCV 3.0.0-beta missing KNN?

一笑奈何 提交于 2020-01-10 03:11:05
问题 Having just upgraded from opencv-2.4.11, KNearest seems to be missing In [27]: import cv2 In [28]: print(cv2.__version__) 3.0.0-beta In [29]: cv2.KNearest() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-29-d2ea29abad59> in <module>() ----> 1 cv2.KNearest() AttributeError: 'module' object has no attribute 'KNearest' In [30]: cv2.K cv2.KAZE_DIFF_CHARBONNIER cv2.KAZE_DIFF_WEICKERT cv2.KMEANS_RANDOM

Why isn't inRange function detecting blue color when I have given it the entire possible Hue range for the blue color?

早过忘川 提交于 2020-01-07 08:46:51
问题 On the website colorizer.org, they have an HSV range of H=0-360, S=0-100, V=0-100. We are also aware that the HSV range in OpenCV is H=0-180, S=0-255, V=0-255. I wanted to select a range for any shade of (what we perceive as) blue color, so I looked at colorizer.org, and saw that blue Hue ranges roughly from 170 to 270. So I scaled this Hue range to OpenCV by dividing by 2, which gives 85-135. Now, I took the following screenshot of color [H=216, S=96, V=67] from the preview at the website

How to use STAR detector in openCV 3 with python?

风格不统一 提交于 2020-01-04 09:24:43
问题 I'm trying to use the STAR detector in openCV 3, and it's throwing an error: import cv2 image = cv2.imread('grand_central_terminal.png') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) star = cv2.xfeatures2d.StarDetector_create() (kps, descs) = star.detectAndCompute(gray, None) print("# of keypoints: {}".format(len(kps))) # should be 459 The error it gives is: Traceback (most recent call last): File "quiz.py", line 8, in <module> (kps, descs) = star.detectAndCompute(gray, None) cv2.error:

How to use STAR detector in openCV 3 with python?

杀马特。学长 韩版系。学妹 提交于 2020-01-04 09:22:19
问题 I'm trying to use the STAR detector in openCV 3, and it's throwing an error: import cv2 image = cv2.imread('grand_central_terminal.png') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) star = cv2.xfeatures2d.StarDetector_create() (kps, descs) = star.detectAndCompute(gray, None) print("# of keypoints: {}".format(len(kps))) # should be 459 The error it gives is: Traceback (most recent call last): File "quiz.py", line 8, in <module> (kps, descs) = star.detectAndCompute(gray, None) cv2.error:

Cannot read Video File OpenCV3

我与影子孤独终老i 提交于 2020-01-04 06:28:09
问题 I am trying to use OpenCV3 for video file reading. string packageRootPath = ros::package::getPath("visensor_dgem"); string videoFullPath = packageRootPath + "/dump/Video.avi"; cout << videoFullPath << endl; cv::VideoCapture cap; bool flag = cap.open( videoFullPath ); if( flag ) cout << "flag true\n"; else cout << "flag false\n"; The path to the video file is correct. I am guessing my issue has to do with the video codecs. The program compiles file, however when I run the code I get flag false

How to know if an OpenCV 3.0 algorithm has an OpenCL implementation in the transparent API

穿精又带淫゛_ 提交于 2020-01-02 03:39:17
问题 I am migrating my OpenCV 2.4.2 to OpenCV 3.0 for using OpenCL performance throught the Transparent-API. But, I note that some algorithms take the same time in CPU or GPU implementation. I searched in the official documentation, but I didn't find the answer. How to know if an algorithm has an automatic OpenCL translation in the Transparent API or not ? 回答1: If you have amd gpu, use codexl and create a new codexl project, attach your project and start session from codexl, or, start your project

Finding CheckerBoard Points in opencv for any random ChessBoard( pattern size not known)

你。 提交于 2020-01-02 03:06:50
问题 Well, OpenCv comes with its function findCheckerboardCorners() in C++ which goes like bool findChessboardCorners(InputArray image, Size patternSize, OutputArray corners, int flags=CALIB_CB_ADAPTIVE_THRESH+CALIB_CB_NORMALIZE_IMAGE ) After using this function for a while, one thing that i understood was that the pattern size must comply with the image to a very good extent, else the algorithm refuses to detect any Chessboard altogether. I was wondering if there were any random image of a