opencv3.0

OpenCV Tone Curve progrommatically

南楼画角 提交于 2019-12-05 04:08:57
问题 I want to realize smth like tone curve. I have predefined set of curves that I should apply to the image. For instance: as I understand on this chart we see dependences of current tone value to new, for example: if we get first dot on the left - every r,g and b that = 0 will be converted to 64 or every value more than 224 will be converted to 0 and ect. so I tried to change every pixel of image to new value for test purpose i've simplified curve: and here the code I have: //init original

Create instances of class Rect from opencv 3 in Python

一世执手 提交于 2019-12-05 02:56:44
问题 I would like to know how I can get an opencv rect object by providing two Points. The c++ version provides this datastructre. http://docs.opencv.org/java/2.4.9/org/opencv/core/Rect.html I cant find a way to instantiate rects in python. I tried cv2.Rect(p1,p2) but this method seems not be existent. Is it even possible? Thanks in adavance :) 回答1: Look for example at this tutorial face detection http://docs.opencv.org/trunk/d7/d8b/tutorial_py_face_detection.html and you'll see that in Python

Opencv detect changes between two photos taken by different time

时光总嘲笑我的痴心妄想 提交于 2019-12-05 02:54:31
问题 We have one original image / photo of the item. (ie sculpture). Time to time we are taking new photos of the item. Photo always taken same angle 90 degree to the item. but there will be some slightly movement up down / left right there will be different length of the same object ( we are taking with line camera and the object moving in front of it so time to time speed of the object changing so the final image will be longer than the original) Also lighting changes so colour and lightning

Using native OpenCV 3.0.0 in Android Studio 1.5 with Gradle experimental 0.4.0

十年热恋 提交于 2019-12-05 02:34:40
问题 I'm trying to get OpenCV 3.0.0 native to run in my Android Studio 1.5 with Gradle experimental 0.4.0. I can already use the Java components of OpenCV and the regular NDK functions. But as soon as I try to use the namespace cv in my native code I get the following exception (it is shortened. The complete exception was too long): app\src\main\jniLibs\armeabi\libopencv_core.a(matrix.cpp.o):matrix.cpp:function std::vector<unsigned char, std::allocator<unsigned char> >::resize(unsigned int,

contrib module missing in opencv 3.0?

醉酒当歌 提交于 2019-12-05 02:05:51
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 opencv 3.0? If they are not defined,how can we add this module in addition to the existing modules?

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

拟墨画扇 提交于 2019-12-05 01:16:50
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 opening and closing the capture device just before and after grabbing (which won't work for me as my

How to detect multiple objects with OpenCV in C++?

久未见 提交于 2019-12-05 00:55:06
I got inspiration from this answer here , which is a Python implementation, but I need C++ , that answer works very well, I got the thought is that: detectAndCompute to get keypoints , use kmeans to segment them to clusters, then for each cluster do matcher->knnMatch with each's descriptors , then do the other stuffs like the common single detecting method. The main problem is, how to provide descriptors for each cluster's matcher->knnMatch process? I thought we should set value of the other keypoints corresponding descriptor to 0(useless), am I right? And got some problems in my trying: how

Maintaining code compatibility between OpenCV 2 and OpenCV 3

蹲街弑〆低调 提交于 2019-12-04 20:02:53
问题 My library currently uses OpenCV 2. Now, I am trying to compile the library to use OpenCV 3. It seems that some header files were moved and some constants were renamed. For example, CV_INTER_LINEAR is not defined in OpenCV 3. As my library needs to be compiled and run on both OpenCV 2 and 3, Is there any simple way to overcome this incompatibility? I can change my code, but then it doesn't work in OpenCV 2. 回答1: I had the same problem a few months ago, and I have to contraddict Kiran: I got

how can integrate the javadoc with a project

隐身守侯 提交于 2019-12-04 19:35:57
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; Rahal Kanishka 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 Tab Select "Java Platforms" You will see Java Platform Manger Window Select the tab "Javadoc"

Building OpenCV 3.0.0-beta Windows Python 3.4

无人久伴 提交于 2019-12-04 19:18:50
I wish to get OpenCV working on my Windows 7 x64 for Python 3.4. Even though the OpenCV 3 Alpha page states that there is Python 3 support ( http://opencv.org/opencv-3-0-alpha.html ), the pre-compiled package only contains opencv/build/python/2.7 and no 3(.4). So following the answer on How to use OpenCV in python 3.4 on windows 7 x64? , I'm trying to build OpenCV 3.0.0 from source following the following tutorial: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html . However since this tutorial is a bit outdated, I've some problems following certain steps.