opencv3.0

Unable to find SIFT or xfeatures2d in OpenCV Python [duplicate]

♀尐吖头ヾ 提交于 2019-12-13 04:42:57
问题 This question already has answers here : PyCharm: Installation of non-free OpenCV modules for operations like SIFT, SURF (2 answers) Closed last year . I recently switch back to python for facial detection and pattern recognition using OpenCV 3.4.1 However when running OpenCV for point recongnition, I get the error AttributeError: module 'cv2.cv2' has no attribute 'SIFT_create' I have read that changing the line from sift = cv2.SIFT_create() to sift = sift = cv2.xfeatures2d.SIFT_create()

python opencv HSV range finder creating trackbars

ε祈祈猫儿з 提交于 2019-12-13 03:52:43
问题 I want to find the HSV value of a LASER dot using opencv and python. I got the code http://opencv-srf.blogspot.com.au/2010/09/object-detection-using-color-seperation.html from here but it is in c++, installing visual studio and opencv takes time so i changed the code in python import cv2 import numpy as np def callback(x): pass cap = cv2.VideoCapture(0) cv2.namedWindow('image') ilowH = 0 ihighH = 179 ilowS = 0 ihighS = 255 ilowV = 0 ihighV = 255 # create trackbars for color change cv2

Opencv4Android grabcut's output image has different colors(brighter colors) than the input image

自作多情 提交于 2019-12-13 02:51:57
问题 public class Grabcut extends Activity { ImageView iv; Bitmap bitmap; Canvas canvas; Scalar color = new Scalar(255, 0, 0, 255); Point tl, br; int counter; Bitmap bitmapResult, bitmapBackground; Mat dst = new Mat(); final String pathToImage = Environment.getExternalStorageDirectory()+"/gcut.png"; public static final String TAG = "Grabcut demo"; static { if (!OpenCVLoader.initDebug()) { // Handle initialization error } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

Displaying multiple image on single window not working properly (C++ VS12)

穿精又带淫゛_ 提交于 2019-12-13 02:20:49
问题 I have tried this code I gotten here. Its for displaying multiple images on a single window for C++. I have included the opencv 3.0 library on the program as well. Below is the code. I am trying to load 2 images but only the first one (1.jpg) appears but when i put image2 to be equal to cv::imread("1.jpg"); two images of 1.jpg appears. I am really new to this and I dont understand where i am going wrong here. I hope someone can help me. Thank you. int main(int argc, char *argv[]) { // read an

Why is createBackgroundSubtractorGMG considered obsolete, and how can I use it

烂漫一生 提交于 2019-12-12 16:15:14
问题 I am rather new to OpenCV and image processing in general. I am looking into background subtraction to facilitate motion tracking (people counting). Looking at the openCV documentation on background subtracting, GMG gives rather nice results. Also when looking at a video comparing the methods, I feel that GMG gives the best results, at least for my purpose. I installed the latest version of opencv to use with python3 thus: git clone --depth=1 https://github.com/Itseez/opencv.git cd opencv

Finding extreme points in contours with OpenCV C++

♀尐吖头ヾ 提交于 2019-12-12 14:15:01
问题 I have tried to implement this code, but I have a trouble when I want to determine the most extreme point of the contour follow this tutorial. # determine the most extreme points along the contour extLeft = tuple(c[c[:, :, 0].argmin()][0]) extRight = tuple(c[c[:, :, 0].argmax()][0]) extTop = tuple(c[c[:, :, 1].argmin()][0]) extBot = tuple(c[c[:, :, 1].argmax()][0]) Can anyone help me to solve this problem? 回答1: Starting from a std::vector<cv::Point> , you can use std::max_element and std::min

CV2 Cannot connect to X server:

ⅰ亾dé卋堺 提交于 2019-12-12 14:01:47
问题 When I try to use cv2.imshow(), I get an error saying that it can't conect to X server. I'm running this locally, using bash in Windows Command Prompt. No servers, no VPNS, etc. Python 3.4, CV2 3.4 img = cv2.imread(fileName) cv2.imshow("Image", img) cv2.waitKey(0) 回答1: Encountered the same issue with bash on windows. had to install OpenCV using conda install instead. everything worked fine after the install. check out the anaconda page for details here. if you do have anaconda already you can

KalmanFilter always predict 0,0 in first time

淺唱寂寞╮ 提交于 2019-12-12 13:08:48
问题 The following code use to scan image from bottom to top. However, the prediction of Kalman filter always show 0,0 in first time. So that, it will draw line from bottom to 0,0. How to make path(Kalman filter) more similar to actual path? The following code and image was updated. import cv2 import matplotlib.pyplot as plt import numpy as np img = cv2.imread('IMG_4614.jpg',1) img = cv2.resize(img, (600, 800)) hsv_image = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) low_yellow = np.array([18, 94, 140])

OpenCV Error: Assertion failed in undistort.cpp at line 293

℡╲_俬逩灬. 提交于 2019-12-12 12:29:13
问题 Found solution at https://github.com/opencv/opencv/issues/4943 OpenCV Error: Assertion failed (CV_IS_MAT(_src) && CV_IS_MAT(_dst) && (_src->rows == 1 || _src->cols == 1) && (_dst->rows == 1 || _dst->cols == 1) && _src->cols + _src->rows - 1 == _dst->rows + _dst->cols - 1 && (CV_MAT_TYPE(_src->type) == CV_32FC2 || CV_MAT_TYPE(_src->type) == CV_64FC2) && (CV_MAT_TYPE(_dst->type) == CV_32FC2 || CV_MAT_TYPE(_dst->type) == CV_64FC2)) in cvUndistortPoints, file /home/javvaji/opencv-3.2.0/modules

OpenCV SVM Training Data

旧巷老猫 提交于 2019-12-12 09:03:19
问题 I would like to learn svm implementation by using opencv 3.00 library in C++ and Visual Studio 2013. My code: #include<stdio.h> #include<math.h> #include<opencv\cv.h> #include<opencv\highgui.h> #include<opencv2\objdetect\objdetect.hpp> #include<opencv2\highgui\highgui.hpp> #include<opencv2\imgproc\imgproc.hpp> #include<vector> #include <windows.h> #include <atlstr.h> #include <iostream> #include <sstream> #include <iomanip> #include <opencv2\imgproc\imgproc.hpp> #include <opencv2\core\core