opencv3.1

Detecting simple geometric shapes using OpenCV [Java]

末鹿安然 提交于 2020-06-17 07:23:30
问题 I'm programming a Java application that detects simple geometric shapes. The following Python code is used as a reference: How to detect simple geometric shapes using OpenCV This is some of the code [Python]: contours,h = cv2.findContours(thresholdedImage,1,2) for cnt in contours: approx = cv2.approxPolyDP(cnt,0.01*cv2.arcLength(cnt,True),True) print len(approx) if len(approx)==5: print "pentagon" cv2.drawContours(img,[cnt],0,255,-1) elif len(approx)==3: print "triangle" cv2.drawContours(img,

Setting up OpenCV 3.1 in Visual Studio 2015

痞子三分冷 提交于 2020-02-12 16:51:14
问题 I've downloaded opencv 3.1 and I want to start a project in Visual Studio 2015. I don't know how to link this library to my project. Also I want to know if I can continue with this opencv cause it just have a x64 and my project doesn't target on 64bits systems. 回答1: Download opencv 3.1 for windows Extract to folder like c:/opencv Set environment variables by setx -m . This depends on your path. Type this into command line started by cmd. setx -m OPENCV_DIR C:\opencv\build\x64\vc14 In the path

Setting up OpenCV 3.1 in Visual Studio 2015

僤鯓⒐⒋嵵緔 提交于 2020-02-12 16:50:52
问题 I've downloaded opencv 3.1 and I want to start a project in Visual Studio 2015. I don't know how to link this library to my project. Also I want to know if I can continue with this opencv cause it just have a x64 and my project doesn't target on 64bits systems. 回答1: Download opencv 3.1 for windows Extract to folder like c:/opencv Set environment variables by setx -m . This depends on your path. Type this into command line started by cmd. setx -m OPENCV_DIR C:\opencv\build\x64\vc14 In the path

Setting up OpenCV 3.1 in Visual Studio 2015

早过忘川 提交于 2020-02-12 16:49:14
问题 I've downloaded opencv 3.1 and I want to start a project in Visual Studio 2015. I don't know how to link this library to my project. Also I want to know if I can continue with this opencv cause it just have a x64 and my project doesn't target on 64bits systems. 回答1: Download opencv 3.1 for windows Extract to folder like c:/opencv Set environment variables by setx -m . This depends on your path. Type this into command line started by cmd. setx -m OPENCV_DIR C:\opencv\build\x64\vc14 In the path

Image loses quality with cv2.warpPerspective

爷,独闯天下 提交于 2020-01-11 08:33:07
问题 I am working with OpenCV 3.1 and with Python. My problem comes when I try to deskew (fix the tilt of) an image with text. I am using cv2.warpPerspective to make it possible, but the image loses a lot of quality. You can see here the original part of the image: and then, here, the "rotated" image: it is like smoothed . I was using morphological transformation like: kernel = np.ones((2, 2), np.uint8) blur_image = cv2.erode(tresh, kernel, iterations=1) and white_mask2 = cv2.morphologyEx(white

How To Detect Red Color In OpenCV Python?

萝らか妹 提交于 2020-01-03 01:46:41
问题 I am trying to detect red color from the video that's being taken from my webcam. The following code example given below is taken from OpenCV Documentation. The code is given below: import cv2 import numpy as np cap = cv2.VideoCapture(0) while(1): # Take each frame _, frame = cap.read() # Convert BGR to HSV hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # define range of blue color in HSV lower_blue = np.array([110,50,50]) upper_blue = np.array([130,255,255]) # Threshold the HSV image to get

Issue: Bag of Features Training SIFT or SURF for car detection within Video with OpenCV + Python

主宰稳场 提交于 2020-01-01 19:59:34
问题 I am trying to dump keypoints of cars with SIFT or SURF and match these keypoints to a video in order to detect cars. Keypoints are more convenient to use instead of Haar Cascades because I would have to use a lot of images for example 5000 to train, which will take a lot of computation process. Keypoints from SURF or SIFT are scale invariant which will be almost the same in every car. The code for dumping keypoints into a txt file is: import cv2 import numpy as np import os import cPickle

openh264 - bEnableFrameSkip=0, bitrate can't be controlled

旧城冷巷雨未停 提交于 2019-12-22 10:35:33
问题 there are a lot of questions asked regarding opencv + H.264 but none of them gave detailed explanation. i am using openh264(openh264-1.4.0-win32msvc.dll) along with opencv 3.1(custom build with cmake having ffmpeg enabled) in visual studio, i wanted to save video coming from webcam in mp4 format with H.264 compression VideoWriter write = VideoWriter("D:/movie.mp4", CV_FOURCC('H', '2', '6', '4'), 10.0, cv::Size(192, 144), true); before using openh264, in console window i was seeing an warning

module object has no attribute 'DescriptorExtractor_create()'

落爺英雄遲暮 提交于 2019-12-22 08:10:07
问题 I installed opencv3.1.0 with opencv_contrib correctly installed but I am getting the error no module 'DescriptorExtractor_create()' and everything is fine. Suggestions??? :) 回答1: In OpenCV 3.x, SIFT and SURF have been removed because they are patented algorithms and as such are not installed by default. However they are available in the 'opencv_contrib' package which is not installed by default with the normal OpenCV installation. You need to install them manually. Consider this for details

Error installing OpenCV on Ubuntu 16.04

夙愿已清 提交于 2019-12-22 03:25:10
问题 I have being trying to install OpenCV on Ubuntu 16.04 unsing several tutorials and i always end up with an error. This is the last one i've got following this tutorial: https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-OpenCV-3.1-Installation-Guide What can i do? [ 48%] Linking CXX executable ../../bin/opencv_test_viz //usr/lib/x86_64-linux-gnu/libvtkIOImage-6.2.so.6.2: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0' //usr/lib/x86_64-linux-gnu/libvtkIOImage-6.2.so.6.2: undefined