opencv3.0

Use path as key in FileStorage

一笑奈何 提交于 2019-12-24 04:30:47
问题 I am trying to write a file (json/yaml/xml, the format does not matter) that stores a filepath with a specific cv::Mat . As I ended up realizing here, the key combination does not allow for a path (/home/user, for example). void persist_histograms(const QString& filepath, const QHash<QString, Mat>& histograms) { cv::FileStorage storage(filepath.toStdString(), cv::FileStorage::WRITE); QHashIterator<QString, Mat> it(histograms); while (it.hasNext()) { it.next(); storage << it.key().toStdString(

OpenCV Error through calibration tutorial (solvePnPRansac)

左心房为你撑大大i 提交于 2019-12-24 04:23:33
问题 Can anyone know what is going on with this opencv error ? cv2.error: /home/desktop/OpenCV/opencv/modules/core/src/matrix.cpp:2294: error: (-215) d == 2 && (sizes[0] == 1 || sizes[1] == 1 || sizes[0]*sizes[1] == 0) in function create Line code which raise it is : rvecs, tvecs, inliers = cv2.solvePnPRansac(objp, corners2, cameraMatrix, dist) I followed step by step this tutorial: http://docs.opencv.org/master/dc/dbb/tutorial_py_calibration.html It seems that cameraMatrix is incorrect, but why ?

Resize HOG feature for Scikit-Learn classifier

。_饼干妹妹 提交于 2019-12-23 10:06:13
问题 I'm trying to execute this code that processes 70 images and extracts Histogram of Oriented Gradients (HOG) features. These are passed to a classifier (Scikit-Learn). However, an error is raised: hog_image = hog_image_rescaled.resize((200, 200), Image.ANTIALIAS) TypeError: an integer is required I do not understand why, because with attempting with a single image works correctly. #Hog Feature from skimage.feature import hog from skimage import data, color, exposure import cv2 import

opencv (emgucv) not working in unity in osx?

痴心易碎 提交于 2019-12-23 06:00:43
问题 i am at the point, where i just would want to know if anybody out there has emguCV.unity running inside unity in osx? there are many tips concerning DllNotFoundExceptions and unity. all of them do not work in my case. i spent allmost four days searching and trying out everything. the exact error is: System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.OCR.OcrInvoke ---> System.TypeInitializationException: An exception was thrown by the type

Out of memory error in opencv3.0 which is running inside docker container

只愿长相守 提交于 2019-12-23 04:14:20
问题 OpenCV Error: Insufficient memory (Failed to allocate 995522496 bytes) in OutOfMemoryError. base_features, base_descs = detector.detectAndCompute(base_img, None) In this particular line the length("len(base_descs)") of base_desc is around 70000. base_desc is a numpy array . I am currently using 4 GB RAM but still it is showing this error. I am running this code inside a docker container , The above code is working fine when i run the python code without using the container in the system. 回答1:

Kivy Simple Multithreading python

痴心易碎 提交于 2019-12-23 04:02:29
问题 Not sure if anyone can help me with this. I have been unable to find a simple answer to this anywhere. I am building a GUI in Kivy which shows the webcam feed (using openCV) and has two buttons (Button A and B). When I press Button A, it calls a function which does something. However, my screen and GUI freezes as the called function is executing. How to I implement the function called by the button press to run on a different thread in python? 回答1: If your button calls a function which takes

How can I move mouse by detected face and Eye using OpenCV and Python

扶醉桌前 提交于 2019-12-23 03:35:18
问题 I have managed to detect face and eyes by drawing cycles around them and it works fine with the help of Python tutorials Python tutorial & Learn Opencv. Now I would like to make the mouse (Cursor) moves when Face moves and Eyes close/open to do mouse clicking. (PYTHON & OPENCV). Please help to give me more ideas on how I can make it works. Thanks. Check the codes below: import cv2 import sys face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') eye_cascade = cv2

Opencv ANN_MLP training in Android

北城以北 提交于 2019-12-23 02:36:57
问题 I have implemented an ANN character classifier in opencv C++. I have created a model: cv::Mat layers(3,1,CV_32S); layers.at<int>(0,0) = ATTRIBUTES;//400 layers.at<int>(1,0)=25;//hidden layer layers.at<int>(2,0) =CLASSES;// eg. 10 CvANN_MLP nnetwork(layers, CvANN_MLP::SIGMOID_SYM,0.6,1); CvANN_MLP_TrainParams params( cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 1000, 0.000001), CvANN_MLP_TrainParams::BACKPROP, 0.1, 0.1); int iterations = nnetwork.train(training_set, training_set

Detecting and Removing Vertical and Horizontal Lines in OpenCV

不想你离开。 提交于 2019-12-23 02:21:18
问题 I'm trying to remove the square boxes(vertical and horizontal lines) from a filled out form using opencv (Python). I am trying to detect the vertical and horizontal lines through morphological operations of OpenCV. After detecting the Vertical and Horizontal lines. Vertical Lines After the horizontal and vertical lines are detected , i am simply adding them and subtracting it from processed image. res = verticle_lines_img + horizontal_lines_img exp = img_bin - res The final results is not so

Frame from video is upside down after extracting

走远了吗. 提交于 2019-12-22 12:16:14
问题 My problem here is that when I extracting a video into a frame using opencv, sometimes the frame that I get will flip up which happened to me for both my machine(window) and VM(ubuntu) But some of the video I tested, frames are not flip. So, I wonder what factor or what should be changed/added in my code to make the extract fixed without a flip def extract_frame(video,folder): global fps os.mkdir('./green_frame/{folder}/'.format(folder=folder)) vidcap = cv2.VideoCapture(video) success,image =