Questions tagged [opencv]

20341 questions
1

votes
0

answer
118

Views

zbar not working on netcat video stream from raspberry pi read using OpenCV

I am streaming video feed from raspberry pi using netcam to my PC and using zbar to read qr codes i the feed. I am reading the named pipe using ffmpeg: FFMPEG_BIN = 'ffmpeg' command = [ FFMPEG_BIN, '-i', 'fifo264', # fifo is the named pipe '-pix_fmt', 'gray', # opencv requires bgr24...
Snehil Vijay
1

votes
1

answer
1.5k

Views

How to update Opencv3.3?

I already have installed OpenCV 3.3 with python3 on my Macbook in a virtual environment. I want to update to OpenCV 3.4. I had installed OpenCV 3.3 by following https://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/ tutorial. How to do this?
A Q
1

votes
0

answer
336

Views

Find mapping between spherical panorama and new image in opencv

I have an established spherical 360 view and a new undistorted image I want to find a mapping between each image pixel and the 360 view, which effectively means finding the θ and ϕ in spherical coordinates for every x and y in cartesian I have been playing around a bit and I do have a set of match...
rikkertkoppes
1

votes
1

answer
39

Views

The first-time-FlannBasedMatcher influence the result of the later FlannBasedMatcher

I use FlannBasedMatcher twice in my project, but it seems like the first FlannBasedMatcher is affecting the results of the second FlannBasedMatcher. cvtColor(c_image1,hsi1,CV_BGR2HSV); cvtColor(c_image2,hsi2,CV_BGR2HSV); split(hsi1,channel_hsi1); split(hsi2,channel_hsi2); image1s=channel_hsi1[1]; im...
user9148841
1

votes
2

answer
2.5k

Views

TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'

I got an error TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str' My code is the following import os import cv2 import random from pathlib import Path path = Path(__file__).parent path = '../img_folder' for f in path.iterdir(): print(f) f = str(f) img=cv2.imread(f) line = random.ran...
user8817674
1

votes
0

answer
50

Views

Execution failed for task '_app_transformResourcesWithMergeJavaResForDebug' in Android Studio 3.0.1

Everytime I try to run my android app, the following error emerges... Execution failed for task '_app_transformResourcesWithMergeJavaResForDebug' More than one file was found with OS independent path 'org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib' My app's build.gradle file looks like this......
Genesis
1

votes
1

answer
128

Views

How to pair screenshots with videos?

I have folder with short videos and folder with images. Most of the images are sceenshots from one of the videos, but they may not be exactly the same (different size, noise, loss of details because of compression, etc). My goal is to match every image with video it was taken from. So far, I use Ope...
velblúd
1

votes
1

answer
157

Views

Edge based binarization

I am trying to implement the edge based binarization algorithm that was written in the research paper 'Automatic License Plate Recognition Using Deep Learning Technique' but i as i implemented it i get the final image all black and can not find the problem. import cv2 import numpy as np def edge_bas...
Ibrahim Sherif Yahia
1

votes
0

answer
125

Views

Method to separate dotted numbers from an image

I'm going to do a specialized OCR system which recognizes the above dotted numbers. (The sample picture may not contain all special cases - see below. ) We decided to separate the number string and recognize each digit before we put them altogether to form a final result. The question is: How to cle...
Aurus Huang
1

votes
0

answer
564

Views

Logitech c270 access camera driver from OpenCV in C++

is there a way to access the camera driver from OpenCV to disable an image optimization? When I started playing around with the camera I wrote a simple application to measure the FPS rate, but I was receiving only 15 frames instead of 30 FPS with 640x480 resolution as indicated in camera’s specifi...
anmi
1

votes
1

answer
717

Views

face recognition using tracking.js

On the client side(HTML) using webcam i need to detect the face and process the face image in the middleware(python) once the processing is done the relavant name of the face has to be tagged to the face detected in the webcam. Using tracking.js i am able to detect the face but unable to do the face...
GoodBad Between
1

votes
0

answer
68

Views

How to get Positions and sizes of matched key points in brute force algorithm

I want to detect feature points of two consecutive video frames(current and previous frames).For that I used SIFT and brute force algorithm to extract matched key points.Now I want to get only the matched key points into current frame and their positions and sizes. How can I do that ? Is there any s...
SSR
1

votes
0

answer
1.2k

Views

How to compile OpenCV 3.4 with Visual Studio 15 2017 ARM for UWP?

I have been struggling to compile OpenCV 3.4 for a couple of days now. Final target of the compile is ARM, since I am currently writing an UWP for Windows 10 IoT Core running on Raspberry Pi 3. I started my journey from here: https://developer.microsoft.com/en-us/windows/iot/samples/opencv where Mic...
Guido Magrin
1

votes
0

answer
75

Views

What's the best idea to remove defferent backgrounds from images?

I want to convert this photo: to this one: And this photo: to this: And son on. I thought I can use color threshold but what if there are some pictures or content inside the photo? because I don't like to damage them and only want to remove the background. So, as I am new in OpenCV and Image process...
Hasani
1

votes
0

answer
5

Views

How to use OpenCV GeneralizedHoughTransform class with Python?

I'm trying to code a basic example of use of GeneralizedHoughBallard class using OpenCV 3.4.1 and Python 3.7.1 When I try to create a new instance of GeneralizedHoughBallard class: import cv2 alg = cv2.createGeneralizedHoughBallard() I get the error: 'AttributeError: module 'cv2.cv2' has no attribut...
MrLebovsky
1

votes
0

answer
500

Views

OpenCV Python: Restarting a video

I am new to both OpenCV and Python, and I am trying to create a simple program that will read in a video file named 'SixtyFPS.mov' and replay the video when it has reached its end. Ideally I would like to have the video loop continuously. I have not been able to find a solution for this online, howe...
dbonnett
1

votes
1

answer
213

Views

Tips for reducing size of .dylib and .so

I'm trying to compile the SDK manually, but the generated .dylibs and .so are over 70mb in size: ➜ lib ✗ pwd /Users/gond/opencv/build/lib ➜ lib ✗ du -h . 71M This is the command I'm using: cmake -D CMAKE_BUILD_WITH_INSTALL_RPATH=ON \ -D CMAKE_INSTALL_PREFIX=/usr/local .. Is there any way t...
John M.
1

votes
0

answer
1.1k

Views

OpenCV: Finding correct frame rate of video file

I am attempting to calculate the frame rate and the total number of frames in a .mov video file using OpenCV3 and Python 3. I am using OpenCV's cv2.CAP_PROP_FRAME_COUNT to get my total number of frames and I am using OpenCV's cv2.CAP_PROP_FPS to get the frame rate. The issue is that I am getting ina...
dbonnett
1

votes
0

answer
293

Views

error: [Errno 10054] An existing connection was forcibly closed by the remote host Python

I'm using flask to run a simple web server to display my video output from the webcam as an mjpeg, i need to use the link to stream it on Mission planner, my code is: from flask import Flask, render_template, Response from camera import VideoCamera import time app = Flask(__name__) @app.route('/vide...
Saadat Shafeeq Lone
1

votes
0

answer
703

Views

OpenCV template matching or feature detection to correctly categorize types of faxes?

Sorry, this is my first time posting a question. I need a process to identify images within other images to be able to categorize images (ex. sorting faxes based on a company symbol). I have tried openCV template matching but I doesn't seem to be that accurate and if I try to use it by looping thro...
EmFord
1

votes
0

answer
128

Views

opencv 3D Points to Real Distance measure?

I used a stereo camera, Distortion correction was completed and Disparity was calculated. Thereafter, xyz coordinates were obtained using 'reprojectImageTo3D' function. . I want to get the actual distance of the object. inch or mm, cm etc ... . What should I do? Mat xyz; reprojectImageTo3D(disp, xyz...
j.ah
1

votes
1

answer
155

Views

import cv2 terminal error - python

I'm trying to simply install and use cv2, numpy and matplotlib. All installed successfully but when I type into the terminal 'import ...' it gives me the following error? I'm confused because what the terminal is suggesting, I've already installed it that way? I'm not sure about why it's pointin...
BBKING
1

votes
0

answer
179

Views

OpenCV_Contrib builds in java with empty modules

I have cross-compiled the opencv_contrib modules with opencv (contrib github, opencv github) from c++ to java using cmake and the mingw cross compiler, but some of the built modules (line_descriptors and DPM) built as empty classes or classes with no usable methods. I could not find anyone else with...
Frank
1

votes
0

answer
289

Views

Memory Leak from Java OpenCv

I process a frame... @Override public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) { Mat frame = inputFrame.rgba(); mCameraCalculator.processFrame(frame); return frame; } which sets the frame to a new cropped Mat. public void processFrame(Mat frame) { //fill frame outside o...
poppy
1

votes
0

answer
141

Views

How to trace a path generated by openCV findContours() using ReportLab PDFgen?

Im working with openCV for a project that traces patterns and allows me to manipulate that pattern as a path in Adobe Illustrator with the image of the pattern in the background. Below is the solution that I and a friend have come up with. The output of drawContours() doesn't match the vector path...
Jonathan Corrin
1

votes
1

answer
190

Views

image processing : Segregating panel vs house like structure

I am working on a problem that involves segregating solar panel vs house. Both the house as well as panel are of same color. NOTE: There are two houses in the image. I am referring to the one which is bluish. PFB the image as well as my approach. Any insights how to deal with such situations are wel...
vijju
1

votes
0

answer
339

Views

Epipolar Geometry, Not Visually sane output in OpenCV

I've tried using the code given https://docs.opencv.org/3.2.0/da/de9/tutorial_py_epipolar_geometry.html to find the epipolar lines, but instead of getting the output given in the link, I am getting the following output. but when changing the line F, mask = cv2.findFundamentalMat(pts1,pts2,cv2.FM_LME...
K.H
1

votes
1

answer
1.3k

Views

Drawing a histogram in opencv python

I want to detect lane departures of vehicles by processing front camera video.For that I want to select one pixel line of each frame horizontally and analyze how those pixels colors change. For that I want to draw histograms for R,G,B channels which has pixel number from left to right in x axis and...
SSR
1

votes
0

answer
178

Views

C++ Can I use OpenGL framebuffer without seeing the window?

I have an OpenGL application, that displays a camera frame with some 3d elements rendered on top of it. What i am trying to do is use openGL to combine the frame and elements, but then display the image with OpenCv, and not show the OpenGL window. Is this possible? The current code is: int main() {...
anti
1

votes
0

answer
58

Views

Multiprocessing code bug

I want to read/write data from Serial port and record video simultaneously. For this task I am using multiprocessing module in Python. I wrote the following code as a test which runs fine when I run it in a separate script i.e. it records a video and writes to a file. video_length = 10 time_stamp =...
Nischal
1

votes
0

answer
261

Views

GetPerspectiveTransform function error | opencv | java

I am trying to make an automatic perspective correction of quadrangle objects. I am getting error when I am using getPerspectiveTransform function: OpenCV Error: Assertion failed (src.checkVector(2, CV_32F) == 4 && dst.checkVector(2, CV_32F) == 4) in cv::getPerspectiveTransform Here is my code: Mat...
Fleczer
1

votes
1

answer
144

Views

OpenCV & Qt - SetGeometry-Error

I looked through the following links but could not find a solution to my problem: Qt setGeometry: Unable to set geometry Unable to set geometry in Qt https://forum.qt.io/topic/38304/setgeometry-unable-to-set-geometry The following code produces a the error. While debugging with Visual Studio the ima...
NewTech
1

votes
2

answer
312

Views

iOS - ARKit + Vuforia : Convert Vuforia Coordinates to ARKit Coordinates

I want to detect the marker using Vuforia and place a 3d object on it. From then I want to use the ARKit in my application. How do I know the ARKit world transform for the detected marker or 3d object? I am using same view controller to initialize ARKit SceneView and to start Vuforia Engine. I have...
Venkatesh
1

votes
1

answer
134

Views

Calculating average raster values using numpy (fast)

I have a JPEG image and I need to calculate the average value of each raster (red, blue and green) as fast as possible. When I try to use two for loops to access each pixel and add the values, the process takes quite long (about 30 seconds). Is there a way to calculate the average raster values fast...
Umar Dastgir
1

votes
0

answer
41

Views

Image processing : Extract background class from annotated images

Given an image of dimensions aXb (see an example below), and a few rectangular annotations for different classes, what is the most effective (or non-brute-force) method for finding non-overlapping rectangular annotations (at least m X n dimension) not covered by the the already provided annotations?...
GKS
1

votes
0

answer
47

Views

how can i edit my opencv flags on windows?

A line in the README says : manually specify the OpenCV flags in the Makefile as following: INCS = -I/usr/local/include/opencv LIBS = -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml I'm using Windows(OpenCV version 3.3.1). Can you guess what should I use instead to make it work on Windows? He...
Ariba Siddiqui
1

votes
0

answer
374

Views

How to implement Face Recognition with OpenCV and Xamarin

I have a face recognition program built with python OpenCV. It detects images from a camera input and recognizes the image of a particular user from a list of recognized users (over 1000). Is there any way that this can be integrated to a mobile app developed using Xamarin.Forms ? What can be done...
Kusal Dissanayake
1

votes
1

answer
455

Views

cv2.HoughCircles when it doesn't find cycles

I'm detecting cycles in an image and this is my code: import cv2 import cv2.cv as cv import numpy as np img = cv2.imread('a1.png',0) img = cv2.medianBlur(img,5) cimg = cv2.cvtColor(img,cv2.COLOR_GRAY2BGR) circles = cv2.HoughCircles(img,cv.CV_HOUGH_GRADIENT,1,80, param1=50,param2=20,minRadius=0,max...
tomas yan
1

votes
0

answer
666

Views

detect orientation of sub image

i have a scanned form. but, some times, the scanned forms are skewed. so, i want to automatically detect the orientation of the scanned pdf, rotate it so that it text in it will be exactly horizontal with minimal error. My idea is described as below: The Form has few printed logos. so, what i thoug...
InAFlash
1

votes
1

answer
58

Views

Opencv Grayscale images

public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) { inputFrame.gray(); } This returns a mat. If i convert this to a byte array the maximum is 127 and minimum is -128. I want to convert this to min 0 and max 255. Is this possible??? If so how? I tried to write a for loop and...
Chameera Subasinghe

View additional questions