Questions tagged [opencv]
OpenCV (Open Source Computer Vision) is a library for real time computer vision. When using this tag, please add a language specific tag (python, c++, ...), if relevant.
opencv
73,467
questions
0
votes
1
answer
11
views
Error "For non-planar calibration rigs the initial intrinsic matrix must be specified in function 'cvCalibrateCamera2Internal'"
The full trace of the error I'm encountering:
in stereo_calibrate
ret, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, R, T, E, F, perViewErrors, _, _= cv2.stereoCalibrateExtended(
cv2.error: ...
0
votes
0
answers
15
views
How do I track a contour from my previous image?
So I have a video of bacterial cells moving around which I converted to frames. Now I want to find the instantaneous velocity of each bacterial cells. For this I am interested in finding by how much a ...
0
votes
0
answers
18
views
Use OpenCV to stitch 2d histograms - Merge cv2.detail.MatchesInfo
I am attempting to stitch multiple 2d histograms (2d data arrays) together for which the horizontal and vertical axes of the histograms are spatial coordinates, but the origin for the different ...
0
votes
0
answers
25
views
Clustered bubbles or bubbles close together?
I am using OpenCV edge and contour to attempt to analyse the results of a shadowgraph of bubbles. It is working nicely but struggles when two bubbles are very close together, where it views it as one ...
0
votes
0
answers
26
views
Does cv2.stereoCalibrate provide a way to incorporate initial estimates
Here is my code:
def stereo_calibrate(img, correspondences_left, correspondences_right, camera_matrix_L, camera_matrix_R, dist_coeffs=None):
if dist_coeffs is None:
dist_coeffs = np.zeros((...
-1
votes
0
answers
33
views
OpenCV build keeps failing with errors related to ffmpeg [closed]
I am trying to install OpenCV on a Raspberry PI 4 with Raspbian Version 12. The default method via pip didnt work it kept failing to build the wheel. So I tried to install it manully.
I followed this ...
-3
votes
0
answers
42
views
How to measure the width and angle of two intersecting ropes using OpenCV? [closed]
The first picture below is the original image, showing a net. The ropes in the net are of two types: thick and thin. It is necessary to distinguish which are thick ropes and which are thin ropes ...
0
votes
0
answers
29
views
Fabric JS with OpenCV
I am using highlightWallAroundPoint function to find detecs walls around where user clicks.
const highlightWallAroundPoint = (_, x, y) => {
const lowerCanvas = fabricCanvas.lowerCanvasEl;
...
-2
votes
0
answers
35
views
Advice for my computer vision Flutter app with Python? [closed]
I'm currently building a Flutter app that heavily relies on Python scripts written by a coworker. It utilizes OpenCV and Numpy, and I'm having trouble figuring out the best way to integrate this into ...
1
vote
0
answers
32
views
How to Stream RTSP Video from IP Camera to HTML Video Element?
I have an IP camera that streams video using the RTSP protocol. My system needs to connect to this IP camera and stream the video to a web browser. Since most browsers don't natively support RTSP, I ...
-3
votes
0
answers
81
views
How do I convert a 300-degree equirectangular panoramic image to cube faces?
A 300-degree equirectangular panoramic image I want to convert into cube faces using OpenCV in Python. I found code for 360-degree images. How do I modify it to handle a 300-degree image?
import cv2
...
-3
votes
0
answers
25
views
Drawing angled rectangles in OpenCV and generate height and width of each rectangles [closed]
I am using OpenCV and Python to work on a project that involves tracking defects on a surface, and I am using binary images to find defects and draw a rectangle around it. The application uses ...
-3
votes
0
answers
32
views
How can I read duration of a particular color in an indicator(similar to traffic lights) from live ccvt feed? [closed]
I have a live CCTV feed of 3 cameras which shows 1 indicator each(similar to traffic light- Red Yellow Green). I need to record duration of each color with timestamp and list recorded data in some ...
-3
votes
0
answers
25
views
How to Improve Distance Estimation with Depth Information [closed]
I've been working on a distance estimation project, but I'm encountering an issue with the approach taken by libraries like OpenCV. These libraries estimate distance based on pixel measurements, which ...
-1
votes
0
answers
57
views
How do I control circle radius using OpenCV trackbar? [closed]
I'm trying to add an OpenCV trackbar to adjust the circle radius value that I'm using for a binary mask image.
The problem is bitwise_and or bitwise_or two parameters result are same.
Masking image ...
0
votes
0
answers
27
views
Improvement of CV2 shape detection for spot detection on TLC
In my work, I use TLC which give me object like the one on this picture. It is a piece of paper with spot on it at a precise height.
I need to detect the plate itself and it measurments.
Then I need ...
0
votes
0
answers
78
views
Filtering and ellipse fitting noisy images
I have images as shown below (Figure 1) and I would like to fit two ellipses to the inner and outer shapes.
Raw data:
Edit
New code with fmw42's suggestions
if img is None:
print("Failed to ...
-3
votes
0
answers
23
views
Error with OpenCV cv2.minEnclosingTriangle [closed]
my program generates 2D contours using scipy.spatial ConvexHull. I get the same error for any hull
Example
ph=array([[0.16416803, 0.20534728],
[0.54442649, 0.18041865],
[0.94021202, ...
0
votes
0
answers
49
views
Calculate the inner contour of a computed tomography
I'm working on a project to calculate the level of a chest deformity.
For that, I need to find the inner contour of the chest from the tomography; however, I don't know how to select the inner contour....
2
votes
2
answers
118
views
Calculate distances in a shape with Python
I want to calculate the min vertical distance and max horizontal distance of this image.
Like the lines.
I was trying:
_, binary_image = cv2.threshold(image, 0, 255, cv2.THRESH_BINARY)
...
0
votes
0
answers
38
views
OpenCV findContours() only draws round area around object, doesn't detect actual contour
I am trying to create an automatic instance segmentation dataset generator using Unity and OpenCV for Unity. Basically, the app takes pictures of objects at different angles and lighting situations ...
0
votes
0
answers
24
views
Invert undistortion done in OpenCV (recover the original image)
I have an application where I use a 3D model developed through photogrammetry to map between a 2D -> 3D space and back (3D -> 2D). The photogrammetry software (reality capture) "undistorts&...
-2
votes
0
answers
78
views
Floodfill non neighbouring pixels
I have a screenshot taken from a chat platform and want to fill all the image of the chat in white, including profile pictures of participants while keeping the chat boxes. The code from this Question ...
2
votes
1
answer
57
views
How to get centers of circles arranged in a grid in specific order in opencv
I have some approximate circles in an approximate grid shape, but there is distortion.
How can I get the centers in the order of left to right, top to bottom?
I tried findCirclesGrid, but I don't ...
0
votes
0
answers
53
views
How to identify the similarity(in %) between 2 "Black & White" only images / similarity between shapes ignoring colors? [closed]
I've searched all possible related keywords that I can think of, but the results are not really what I'm looking for, as most algorithm I found puts high concern on COLOR.
The idea of my application ...
0
votes
0
answers
35
views
Why is OpenCV's matrix addition function not clipping when I add a uint8 variable with a value of 200 to a uint8 variable with a value of 100? [duplicate]
I am working my way through PyImageUniversity and am familiarizing myself with matrix addition and subtraction in Python using NumPy and the OpenCV library.
I have Python 3.11.4, OpenCV 4.10.0-dev, ...
-3
votes
0
answers
45
views
I get this error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'contourArea' [closed]
when i run the ros2 run self_driving_car_pkg computer_vision_node
this i'm getting this error from terminal =
area = cv2.contourArea(cnt)
cv2.error: OpenCV(4.10.0) /io/opencv/modules/imgproc/src/...
-1
votes
0
answers
28
views
Find the best convergence point of multiple particules trajectories? [closed]
In my project, I would like to find the best convergence point of trajectories of tracked points (done with cv2.calcOpticalFlowPyrLK...).
I know all the points of each trajectory.
My goal is to find ...
-3
votes
0
answers
60
views
How to add horizontal lines to the table in image opencv
I want to add horizontal lines to the below image
resultant output should be like:
Any methods on how to work it out, even if there are diff images which don't have horizontal lines.
I've tried ...
-1
votes
1
answer
41
views
Python - errors when calling cv2.ml.TrainData_create(): - responses data type = 19 is not supported - Expected Ptr<cv::UMat> for argument 'responses'
I am following the following tutorial:
https://www.opencvhelp.org/tutorials/deep-learning/training-models/
Following the instructions using the Caltech-101 dataset, I preprocessed the images (...
1
vote
0
answers
47
views
How to extract a rectangle in an image from identified lines
I have thousands of images that look like this:
I need to run an OCR algorithm on the "1930 E.D." column. I find that when I crop the image down to just that column, I get much better ...
-5
votes
1
answer
88
views
Conway's GOL rules not implemented correctly [closed]
I am using OpenCV and a kernel to count neighbors of each pixel, the pixel's value then becomes the number of neighbors that it has, and then I apply Conway's rules, but the output is not as expected, ...
4
votes
3
answers
205
views
Compromise between quality and file size, how to save a very detailed image into a file with reasonable size (<1MB)?
I am facing a small (big) problem: I want to generate a high resolution speckle pattern and save it as a file that I can import into a laser engraver. Can be PNG, JPEG, PDF, SVG, or TIFF.
My script ...
0
votes
0
answers
38
views
Create a window in Qt not blocked by modal windows [closed]
I am creating an application in Qt (for Windows), which has a main window and many dialogs, which are opened in modal mode. But I also need to create windows that are not affected (blocked) by the ...
0
votes
3
answers
78
views
Extract Shapes from an image with black background
I have a task to bulk extract shapes from an image. The image is with black background and the shapes are with white border.
The main goal is to extract the fruits from the image.
How do you that ...
0
votes
1
answer
32
views
OpenCV GStreamer VideoWriter write hangs in a Python multiprocessing Process
I'm working on real-time image processing using a Raspberry Pi camera. To optimize processing times, I'm trying to separate some image transformations and video encoding in a separate Process:
import ...
-1
votes
1
answer
49
views
Improve signature quality extracted using OpenCV from scanned sheet paper
I extracted a signature from a scanned sheet of paper. Users know there should be only the signature on a white sheet of paper.
I implemented the signature cropping from the uploaded image using the ...
0
votes
0
answers
46
views
OpenCV contours sorting x-axis and y-axis
I am working on a python program to solve a wordsearch. I am using pytesseract and opencv to process an image of the wordsearch and the solution will be displayed as a text. The script processes the ...
-1
votes
0
answers
65
views
Why is the color of the line black if the BGR Code I have is red?
When running this code the desired outcome is for the line drawn to be red but it is drawing a black line. I am confused since I wrote the BGR code for white but it seems that is it is just working in ...
0
votes
1
answer
70
views
PS Camera taking too much light on OpenCV
I installed a third-party driver and firmware to use my PS 4 Camera on PC and I need it to do a object detection project. Everything works fine on camera on Windows (the screen resolution looks buggy ...
-2
votes
1
answer
44
views
I'm getting an "src is not a numerical tuple" for an opencv program I'm developing that works in their official documentation but not for me [closed]
I'm creating a python program and trying to get feed from a camera and then perform a fourier transform on it to see its spectrum. I've been trying to initialize the camera with cv2.imread() but for ...
1
vote
0
answers
24
views
Opencv module dnn inference with batch greater than 1
I want to perform inference using the dnn module of opencv. This is my code:
static cv::Mat inputBlob2;
static std::vector<cv::Mat> outputs2;
cv::dnn::blobFromImages(images, inputBlob2, 1.0 / ...
-2
votes
0
answers
32
views
how to open windows when ı run the computer_vision.py [closed]
ı didn't open the windows like frame,white_region,extended_midlane.. etc. I think ı wrote the codes correctly. but it can be mistake. I don't know.I'll share my codes with you.
this computer_vision.py
...
0
votes
0
answers
31
views
crop document within an image
enter image description here
enter image description here
Hello to everyone. I am working on a project as a student. I have many such documents and my task in the project is to write a function that ...
0
votes
0
answers
23
views
OpenCV with a FLIR Lepton
I Have a FLIR Lepton hooked up to a raspberry pi 5. I have been able to confirm the Lepton works, and run it by following the instructions from the GroupGets Github repo.
import cv2
cv2.namedWindow(&...
-2
votes
0
answers
61
views
CUDA Kernel Taking: Large Amount of Process Memory
I have total 811 images with each RGB image dimension of 1440x1080. Therefore total 3.52 GB. I'm using CUDA v12.2, NVIDIA RTX 3090 GPU, and Visual Studio 2019. I'm facing two issues
After readImage() ...
3
votes
1
answer
61
views
How can I optimize the process to find the best 4-sided shape that contains my mask?
I am currently working on a project where I need to detect pool table and pool balls from a video frame.
I then need to recreate the state of the game in a 2D mini-map, and in order to do so I need ...
-4
votes
0
answers
41
views
Capture image from android camera [closed]
I am working on an application that works with cameras in android using java and android studio.
in python or cpp we can access camera with something codes like this:
import cv2 # opencv
vc = cv2....
-1
votes
0
answers
32
views
I'm struggling to compile anything with OpenCV using g++ [duplicate]
For some reason none of the commands I try are working.
Command: g++ file.cpp -o file -I C:\Users\Username\vcpkg\installed\x64-windows\include -L C:\Users\Username\vcpkg\installed\x64-windows\lib -...
0
votes
0
answers
26
views
Generate graph edges based on region boundaries on image
I want to analyze experiment data of particle packing, and specifically calculate things like coordination number. I've managed to autodetect the centroids of each particle using OpenCV thresholding ...