opencv3.0

Object of abstract class type “cv::BackgroundSubtractorMOG2” is not allowed. all the methods are pure virtual

坚强是说给别人听的谎言 提交于 2019-12-07 14:02:59
问题 I develop the code in VS2015 + OpenCV3.0 in Windows 7 64bit. This is a demo code that I want have a try. And I have tried many demo but I was coming across the same problem: object of abstract class type "cv::BackgroundSubtractorMOG2" is not allowed. all the methods are pure virtual function. The demo code is: using namespace cv; using namespace std; int main() { VideoCapture video("1.avi"); Mat frame, mask, thresholdImage, output; //video>>frame; Ptr<BackgroundSubtractor> pMOG2; pMOG2 = new

Windows环境下编译OpenCV3.0和OpenCV_contrib

流过昼夜 提交于 2019-12-07 13:54:51
一、下载安装 OpenCV3.0下载地址: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/ OpenCV contrib下载地址: https://github.com/Itseez/opencv contrib cmake-gui下载地址: http://www.cmake.org/cmake/resources/software.html 下载以上内容并安装opencv和cmake-gui,我的OpenCV安装路径为D:\opencv3 二、使用cmake生成OpenCV.sln 打开cmake-gui 在where is the source code选择opencv的安装目录,我的是D:\opencv3\opencv\sources 在where to build the binaries里面选择要将opencv编译到的目录下面,我的是:D:\opencv3\opencv\mybuild 点击configure,在弹出的对话框内选择 Visual Studio 2013和default参数,点击finish。 这个时候cmake会开始编译不知道什么东西,然后会在屏幕中间出现一堆参数包括Name和Value,在其中找到Name为OPENCV EXTRA MODULES PATH的参数

OpenCV matchTemplate threshold values for different methods

天大地大妈咪最大 提交于 2019-12-07 12:08:54
问题 I searched a lot for finding the threshold values for the below mention methods. methods = ['cv2.TM_CCOEFF', 'cv2.TM_CCOEFF_NORMED', 'cv2.TM_CCORR', 'cv2.TM_CCORR_NORMED', 'cv2.TM_SQDIFF', cv2.TM_SQDIFF_NORMED'] I also tried to figure them out by myself but I could only find thresholds for 3 methods which have max value of 1.0. The other methods values were in range of 10^5. I would like to know the bounds of these methods. Can somebody point me in the right direction. My agenda is to loop

Capturing RTSP stream fails when the script is turned into a standalone executable using pyinstaller

无人久伴 提交于 2019-12-07 07:50:28
Code: from imutils.video import VideoStream import cv2 # Read rtsp stream rtsp = u"rtsp://admin:admin@10.64.1.31:554/1/h264major" #vs = VideoStream(src=0).start() # for capturing from webcam vs = VideoStream(src=rtsp).start() while True: frame = vs.read() # show the output frame cv2.imshow("Frame", frame) key = cv2.waitKey(1) & 0xFF # if the `q` key was pressed, break from the loop if key == ord("q"): break # do a bit of cleanup cv2.destroyAllWindows() vs.stop() I have faced the same problem when using opencv's VideoCapture [ cap.isOpened() returns False ] The standalone executable works fine

Python OpenCV video format play in browser

大城市里の小女人 提交于 2019-12-07 06:49:35
问题 I'm trying to create a video from a sequence of images and display it in a browser but from some weird reason no matter what codec or file format I use I get the following error: No video with supported format and mime type found Here is my code: ready_images = [] import cv2 for img in videos['Images']: image = cv2.imread(img.fileName) ready_images.append(image) fourcc = cv2.VideoWriter_fourcc(*'MP4V') video_name = videos['Images'][0].gifLocationPath + "//" + videos['Name'] frame = cv2.imread

How to read/write a matrix from a persistent XML/YAML file in OpenCV 3 with python?

社会主义新天地 提交于 2019-12-07 02:33:59
问题 I've been trying to read and write matrices to persistent file storage (eg. XML) with anaconda's current cv2 (which I believe is actually OpenCV 3.x). I looked at the solutions online for this, and people reference something done like this: object = cv2.cv.Load(file) object = cv2.cv.Save(file) source. This does not work on the current anaconda python cv2 . People propose solutions like this yaml example, but I'm confused why so much boiler plate code is needed for this simple functionality, I

how to get the latest frame from capture device (camera) in opencv [python]

筅森魡賤 提交于 2019-12-06 19:43:33
问题 I want to connect to a camera, and only capture a frame when an event happens (e.g. keypress). A simplified version of what I'd like to do is this: cap = cv2.VideoCapture(device_id) while True: if event: img = cap.read() preprocess(img) process(img) cv.Waitkey(10) However, cap.read seems to only capture the next frame in the queue, and not the latest. I did a lot of searching online, and there seems to be a lot of questions on this but no definitive answer. Only some dirty hacks which involve

Kivy Simple Multithreading python

断了今生、忘了曾经 提交于 2019-12-06 16:48:48
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? If your button calls a function which takes time to execute, kivy window freezes till the function is done. You can use multi threading and have a

OpenCV 3.0 visual debug with CVV, crash cvv::showImage

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 15:39:02
I tried use visual debug like in this tutorial #define CVVISUAL_DEBUGMODE #include <opencv2/cvv/debug_mode.hpp> #include <opencv2/cvv/show_image.hpp> #include <opencv2/cvv/final_show.hpp> int main() { cv::Mat mat = imread("..."); imshow("img", mat); // works fine waitKey(); cvv::showImage(mat); // crash on this line cvv::finalShow(); return 0; } EXC_BAD_ACCESS (code=1, address=0x0) 来源: https://stackoverflow.com/questions/34897345/opencv-3-0-visual-debug-with-cvv-crash-cvvshowimage

how can integrate the javadoc with a project

。_饼干妹妹 提交于 2019-12-06 14:47:59
问题 my codes can be shown as follows, however when doing that net beans says that the relevant javadocs are not in libraries. Please help me to solve this problem. how can I integrate javadocs with libraries.please reply me soon import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.CvType; import org.opencv.core.Scalar; 回答1: Refer this link to get your javadoc .But when compared to previos version (OpenCV 2.4.10) it's not well constructed. In NetBeanse IDE, Go to Tools