opencv3.1

OpenCV stitcher fails to stitch undistorted images

牧云@^-^@ 提交于 2019-12-11 00:33:41
问题 I am trying to stitch a panorama using mobile phone camera with an attachable 170 degree wide angle lens. The resulting photo is distorted (fisheye). I understand that to stitch these photos using Stitcher::stitch(InputArrayOfArrays images, OutputArray pano) they must be undistorted first. First, I did the undistort(InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray newCameraMatrix=noArray() ) and save the results to jpg files. Then, I read the jpg

Makefile error causes undefined reference to symbol 'GOMP_parallel@@GOMP_4.0'

放肆的年华 提交于 2019-12-10 22:32:16
问题 Warning: Newbie Ubuntu/g++/makefile user I'm trying to build a C++ app (C++11, OpenMP, OpenCV3, experimental filesystem) that works if I build directly, but fails if I use a makefile with a linker error. This works: g++ \ -std=c++11 -std=c++1y -fopenmp -DNDEBUG \ -O3 -fprofile-generate -march=native -fomit-frame-pointer \ docproc.cpp \ -flto -L/usr/local/lib -lstdc++fs \ -lpthread -lboost_thread -lboost_system \ -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_calib3d -lopencv

How to load SVM data from file in OpenCV 3.1?

 ̄綄美尐妖づ 提交于 2019-12-10 15:43:41
问题 I have a problem with load trained SVM from file. I use Python and OpenCv 3.1.0. I create svm object by: svm = cv2.ml.SVM_create() Next, I train svm and save to file by: svm.save('data.xml') Now i want to load this file in other Python script. In docs i can't find any methods to do it. Is there a trick to load svm from file? Thanks for any responses. 回答1: I think it's a litte bit confusing that there is no svm.load(filepath) method as a counterpart of svm.save(filepath), but when I read the

Cropping live video feed in OpenCV

别说谁变了你拦得住时间么 提交于 2019-12-09 19:34:38
问题 I have a live video feed that tracks green objects and draws a rectangle over the object's area. I'm curious as to how I would be able to crop the feed to only show the area that the rectangle encompasses. Here's the section of relevance: while True: (success, frame) = webcam.read() frame = imutils.resize(frame, width = 1000) hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) mask = cv2.inRange(hsv, greenLower, greenUpper) mask = cv2.erode(mask, None, iterations=2) mask = cv2.dilate(mask, None,

HOG Descriptor using Python + OpenCV

夙愿已清 提交于 2019-12-08 12:56:43
问题 I am trying to implement HOG Descriptor with OpenCV to detect Pedestrians in a video. I am currently using the pre-made dataset by OpenCV hogcascade_pedestrians.xml . Unfortuntley the documentation on this part is very poor on the internet although the HOG Descriptor is very effective for human detection. I have been writing a code for pedestrians detection with Python, and I have stopped at the following code: import cv2 import numpy as np import imutils VidCap = cv2.VideoCapture(

Is it possible to change a part of the background color of an image, when the image is a table?

时光毁灭记忆、已成空白 提交于 2019-12-08 06:24:29
问题 I am using pytesseract, pillow,cv2 to OCR an image and get the text present in the image. Since my input is a scanned PDF document, I first converted it into an image (JPEG) format and then tried extracting the text. I am only half way there. The input is a table and the titles are not being displayed, since the titles have a black background. I also tried getstructuringelement but unable to figure out a way Here is what I did- import cv2 import os import numpy as np import pytesseract

Is it possible to change a part of the background color of an image, when the image is a table?

独自空忆成欢 提交于 2019-12-08 04:09:23
I am using pytesseract, pillow,cv2 to OCR an image and get the text present in the image. Since my input is a scanned PDF document, I first converted it into an image (JPEG) format and then tried extracting the text. I am only half way there. The input is a table and the titles are not being displayed, since the titles have a black background. I also tried getstructuringelement but unable to figure out a way Here is what I did- import cv2 import os import numpy as np import pytesseract #import pillow #Since scanned PDF can't be handled by pdf2image, convert the scanned PDF into a JPEG format

How To Detect Red Color In OpenCV Python?

让人想犯罪 __ 提交于 2019-12-06 14:48:12
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 only blue colors mask = cv2.inRange(hsv, lower_blue, upper_blue) # Bitwise-AND mask and original image

OpenCV 3.1.0: Save and load trained SVMs

家住魔仙堡 提交于 2019-12-05 07:01:57
问题 At the moment I am trying to train different SVMs for the recognition of different emotions. So for example to recognize the emotion happy I train a SVM with images of happy people as positives and images where people express other emotions such as anger, fear, disgust, ... as negatives. The images are stored in a database that I have partitioned in a training section and testing section. When I have trained the SVMs, I immediatly use them to test the accuracy on the test images of the

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