Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Browsing all 2088 articles
Browse latest View live

Why is setting frame height and width prevents saving the webcam stream to disk?

Hello everyone. Excuse me for the vague title. I have faced a weird situation in which, setting the frame height and width fails the stream recording on disk. That is, I have written a simple app that...

View Article


don't know how to predict classes with RCNN ResNet50 and the dnn method

I don't know how to predict classes with the RCNN ResNet50 model. I can successfully predict the bounding boxes but I don't know how to predict the right class. I've downloaded the pretrained model...

View Article


opencv install not occuring

when I try to install Opencv within the ubuntu 20.04 (has python3) using the following command: "sudo apt install python3-opencv" I am getting the following error message: " E: Unable to locate...

View Article

NMSBoxes output with top_k parameter

Hi all, the `top_K` parameter in the `cv2.dnn.NMSBoxes` correspond to the maximum number of bounding-boxes to return right ? Like if we know how many object we expect in the image. If that's the case,...

View Article

How to save video using thread

I am making a program that takes a video for 10 seconds when an object is detected. If 'out' is created before 'while', the video is saved only once when use this code .avi file is just created and...

View Article


Find first non-black pixel

I have a very simple input image: it's fully black and has a tiny bright red dot somewehere in it. The colors are "pure", meaning the blacks are (0,0,0), the red dot is at full 255 red intensity. Now...

View Article

TypeError: Expected Ptr for argument 'src'

This is my code : import os from PIL import Image import numpy as np import cv2 import pickle Base_Dir = os.path.dirname(os.path.abspath("__file__")) image_dir = os.path.join(Base_Dir, "Images")...

View Article

how to read a YML vector in python

OPENCV 4.2 I record a vector in C++ vector myVector; //... filling vector somewhere ... name = "myVector"; // storing vector myFileStorage << name << myVector; This gives an YML file...

View Article


Unable to create PAGE_LOCKED or SHARED host memory using the Python binding...

- NVIDIA Jetson Xavier NX - OpenCV 4.4 built with CUDA support - Python 3.6.9 I'm having trouble with the Python binding to the HostMem class and can't create PAGE_LOCKED or SHARED host memory. I'm not...

View Article


TypeError: only size -1 arrays can be converted to python scalar

i am facing this error and am new to python. not sure how am not supposed to enter a matrix as the input ( image) this is the code : import cv2 import matplotlib.pyplot as plt image =...

View Article

Rectified Images Show unwanted results, OpenCV with Stereo Vision

I am having trouble when trying to create depth map using OpenCV on Python. The problem is that the rectified images appears to be wrapped, or distorted. Here is the code....

View Article

python cv2 calls from c++

Hi, I have embedded python in my c++ code. All other modules work fine, except for the `cv2` module. Any call to `cv2` functions hangs. For instance `cv2.imread` I'm using python 2.7.12 Here is the...

View Article

Why does OpenCV VideoCapture using a URL not work on Heroku?

I'm trying to open a videoURL using cv2.VideoCapture on Heroku, and it consistently fails to open. I've called the same code on my local machine (Windows 10) and it ran with no problems. Does anyone...

View Article


error: (-2:Unspecified error) could not find a writer for the specified...

'''prediciton using distance''' for embedding in embeds: diff = np.subtract(saved_embeds, embedding) dist = np.sum(np.square(diff), 1) idx = np.argmin(dist) if dist[idx] < threshold:...

View Article

why do i get this error

masked = cv2.bitwise_and(img,img,mask=mask[:,:,2]) cv2_imshow(masked) cv2.waitKey(0) # Cleanup after any key is pressed cv2.destroyAllWindows() This is my code 👆🏽 error Traceback (most recent call...

View Article


pip install opencv-python failing on raspberry pi zero w

I am attempting to install opencv-python on a fresh Raspbian OS image on a raspberry pi zero w. I am following an identical process that worked on a Raspberry Pi 4, and as far as I know it should work...

View Article

How to merge nearby rectangles

I am working on character segmentation and looking to merge nearby characters into a box. I have successfully found the contours but I am not sure how to find a straight line between the top and bottom...

View Article


how extraction image of other image

Hello I would like to know how I can segment images with openCV, that is, first stage extract my area of ​​interest while maintaining its colors, for example I put a tree that I want to extract its...

View Article

Triangulate points from 2 images to estimate the pose on a third

I want to estimate the pose of a current image relative to a matched one in a database. The images are coming from a moving robot with reasonably accurate odometry so I can take two consecutive images...

View Article

How can I modify ROI and then add it to the original image using Python?

I am new to Python and OpenCV. My task is to perform some operations on the ROI of an image and then adding back that image to the original image. How could I achieve this? For example, I want to...

View Article
Browsing all 2088 articles
Browse latest View live