OpenCV

Python multiprocess can't pickle opencv videocapture object

蓝咒 提交于 2021-01-27 12:52:49
问题 I am trying to create a independent process to handle my image acquire from camera. But multiprocessing seems to have difficulty pickling videocapture module from opencv. Can anyone suggest a work around ? I am using python 3.7.1 from multiprocessing import Process import multiprocessing as mp import time import logging import logging.handlers import sys import logging from enum import Enum import cv2 class Logger(): @property def logger(self): component = "{}.{}".format(type(self).__module__

OpenCV C++ Tracking API

独自空忆成欢 提交于 2021-01-27 12:49:56
问题 I've built OpenCV from source along with the contrib modules. But when I include the tracking module with: #include <opencv2/tracking.hpp> or #include <opencv2/tracking/tracking.hpp> or #include <opencv2/video/tracking.hpp> and then try to use a tracker like this: cv::Ptr<cv::Tracker> tracker; I get an error saying that "Tracker is not a member of 'cv'". What is the proper way to include the tracking API and how can I troubleshoot possible installation errors? 来源: https://stackoverflow.com

image gradient angle computation

孤街浪徒 提交于 2021-01-27 12:40:16
问题 I am actually following the instructions of a paper: The input is supposed to be a binary "edge" image. The output should be a new image, modified by the instructions in the paper. My understanding of the instructions is, that one takes the gradient image of the edge image and modifies it and creates a new image with the modified gradient. Therefore is there a possibility in MATLAB/OpenCV of creating the same image with a new gradient? Reference to the paper: Li, Hongyu, and Lei Chen.

How to get the bounding box of text that are overlapped with background lines?

狂风中的少年 提交于 2021-01-27 12:30:53
问题 For example, in the following app screenshot, I want to get the bounding box tightly rounded over CA-85S (the text on the horizontal blue line), and Almaden Expy (text that overlapped with the blue line). I am extracting those bounding boxes for OCR. I've tried several approaches in openCV that none of those approaches work for me. 回答1: Using the observation that the desired text to extract is in black and has a contrast different from the blue river background lines, a potential approach is

Finding similar images with different intensities/brightness

回眸只為那壹抹淺笑 提交于 2021-01-27 12:27:03
问题 Suppose I have images as follows: What would be my options to compare the similarity between the two images? Obviously they are the same image just with different brightness. I couldn't find any plausible way for this and currently my best bet would be to train a cnn or autoencoder and compare the feature vectors of the outputs, but that just seems a bit overkill for this. Any tips would be appreciated. 回答1: Pretty robust working solution (I tested) is to check correlation of brightness sign

OpenCV: using Canny and Shi-Tomasi to detect round corners of a playing card

最后都变了- 提交于 2021-01-27 11:47:59
问题 I want to do some planar rectification, to convert from left to right: I have the code to do the correction, but I need the 4 corner coords. I'm using the following code to find them: import cv2 image = cv2.imread('input.png') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) canny = cv2.Canny(gray, 120, 255, 1) corners = cv2.goodFeaturesToTrack(canny,4,0.5,50) for corner in corners: x,y = corner.ravel() cv2.circle(image,(x,y),5,(36,255,12),-1) cv2.imshow("result", image) cv2.waitKey() It reads

OpenCV: using Canny and Shi-Tomasi to detect round corners of a playing card

喜夏-厌秋 提交于 2021-01-27 11:38:06
问题 I want to do some planar rectification, to convert from left to right: I have the code to do the correction, but I need the 4 corner coords. I'm using the following code to find them: import cv2 image = cv2.imread('input.png') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) canny = cv2.Canny(gray, 120, 255, 1) corners = cv2.goodFeaturesToTrack(canny,4,0.5,50) for corner in corners: x,y = corner.ravel() cv2.circle(image,(x,y),5,(36,255,12),-1) cv2.imshow("result", image) cv2.waitKey() It reads

How to deal with “DNN module was not built with CUDA backend; switching to CPU” warning in C++?

帅比萌擦擦* 提交于 2021-01-27 08:30:50
问题 I am trying to run YOLOv3 on Visual Studio 2019 using CUDA 10.2 with cuDNN v7.6.5 on Windows 10 using NVidia GeForce 930M. Here is part of the code I used. #include <fstream> #include <sstream> #include <iostream> #include <opencv2/dnn.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> using namespace cv; using namespace dnn; using namespace std; int main() { // Load names of classes string classesFile = "coco.names"; ifstream ifs(classesFile.c_str()); string line; while

Webcam doesn't read through OpenCV but does with guvcview

杀马特。学长 韩版系。学妹 提交于 2021-01-27 07:40:57
问题 I have a webcam of sorts that is quite old. I've been attempting to get it to work. I started out with guvcview which works, however it only gives me the first frame captured then stops. That's fine for now. I'm trying to recreate this behaviour using OpenCV. I'm on linux and using python. It is my understanding that my best bet here is to have OpenCV use v4l2 which is what guvcview is using. My long term idea is to get the first frame only, but do this in a loop to sort of get "video" but at

Webcam doesn't read through OpenCV but does with guvcview

淺唱寂寞╮ 提交于 2021-01-27 07:38:10
问题 I have a webcam of sorts that is quite old. I've been attempting to get it to work. I started out with guvcview which works, however it only gives me the first frame captured then stops. That's fine for now. I'm trying to recreate this behaviour using OpenCV. I'm on linux and using python. It is my understanding that my best bet here is to have OpenCV use v4l2 which is what guvcview is using. My long term idea is to get the first frame only, but do this in a loop to sort of get "video" but at