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,453
questions
0
votes
0
answers
11
views
Change color background of chat screenshot with multicoloured background
I have a screenshot taken from a chat platform and want to change the background of the chat to white, including profile pictures of participants. The code from this Question works fine if the name of ...
0
votes
0
answers
17
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
31
views
How to identify the similarity(in %) between 2 "Black & White" only images / similarity between shapes ignoring colors?
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
28
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, ...
-2
votes
0
answers
25
views
I get this error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'contourArea'
when I run the ros2 run self_driving_car_pkg computer_vision_node
this I get this error from termiinal =
area = cv2.contourArea(cnt)
cv2.error: OpenCV(4.10.0) /io/opencv/modules/imgproc/src/...
-1
votes
0
answers
25
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
48
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
39
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
43
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
72
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
166
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
37
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
69
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
0
answers
40
views
How can I build my Flutter app to use Python for OpenCV and Numpy? [closed]
I'm developing a Flutter app for iOS that requires image processing using Python, specifically with OpenCV and NumPy. I'm facing several challenges and would appreciate guidance on the best approach:
...
0
votes
1
answer
31
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
0
answers
37
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
43
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
63
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
63
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
41
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 ...
-2
votes
0
answers
29
views
OpenCV program cannot detect more than one frame [closed]
I wanted to try using opencv for some simple face recognition (not specific faces, just if it sees a human face or not). I was using this model, installed both opencv and opencv-contrib, and it does ...
1
vote
0
answers
21
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
31
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
28
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
21
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
60
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
59
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
40
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 ...
0
votes
0
answers
39
views
Low-latency RTSP stream using OpenCV and ffmpeg seems to ignore flags
I'm writing a Qt6 application in C++ which should display and optionally store mutltiple RTSP streams. Currently, I'm using OpenCV to capture the stream:
m_capture = new cv::VideoCapture("rtsp://...
-2
votes
1
answer
45
views
How to resize an image and keep backround empty using OpenCV
I have the following 256x256 image:
I want to resize it to 100x100 pixels using OpenCV:
img = cv2.imread('image.png')
p = 100/256
new_width = int( img.shape[1] * p )
new_height = int( img.shape[0] *...
0
votes
0
answers
33
views
Sobel filter angle value overlaps
I am trying to get the orientation of the edges detected using the Sobel filter. However, the angle of the pixels kept overlapping. For example, in this image: , the descending slopes have 2 colors, ...
-5
votes
0
answers
60
views
Unable to open video with OpenCV python [closed]
I am unable to open a .avi video file with OpenCV python. In my head it is a very simple task, but for some reason, I am unable to open the file.
When I run os.path.exists(<video_file_path>), it ...
-3
votes
0
answers
60
views
why cv::waitKey(x) is not closing frame after x seconds? [closed]
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <string>
int main()
{
std::string path = "wallpaperflare.jpg";
cv::Mat img = cv::imread(...
0
votes
0
answers
43
views
How do you compile OpenCV with Python with CUDA Support on Rocky Linux 9?
I am trying to build opencv-python per the official instructions with support for CUDA so I can run SIFT. When I try to build with pip wheel . --verbose I get:
-- Configuring incomplete, errors ...
0
votes
0
answers
45
views
Receiving an RTSP stream with a custom codec in Python (on Windows)
I am building a pyside application on windows and I am trying to receive an rtsp stream carrying data encoded in a custom codec. I've tried a few things that didn't work, so I need some help.
I first ...
0
votes
0
answers
27
views
Title: Extracting Tabular Data from Images Using Python and Tesseract OCR
I'm currently working on a project where I need to extract data in tabular format from images. The images contain data in a tabular format, and I need to save this data in a structured way for further ...
0
votes
1
answer
46
views
To select the first closed round of an image while reading it from left to right
Here, I used the character image like this. When I tried to select only the first closed round portion of the input image, while scanning it from left to right using open_cv -, I got the whole outer ...
-3
votes
0
answers
34
views
Processing frames from a video using OpenCvSharp make the cpu usage reaching 100%. is there a way to avoid the cpu from reaching that high usage? [closed]
this is the class code:
i used the profiler to see where and when the cpu usage reach 100%.
it happens on this lines:
when reading:
if (_videoCapture.Read(frame))
and when converting:
return ...
0
votes
0
answers
28
views
Ceres-Solver-does the initial reference 3D point matter? Experiencing significantly high reprojection error
So I have a set of 2d-3d correspondence points where the 2d coordinate points are detected by a corner detection algorithm (not written by me, and verified to be correct) and 3d coordinate points ...
0
votes
0
answers
26
views
inverted rows,cols in cv.resize
I don't understand why the np.shape passed to cv.resize needs me to swap the tuple elements:
# Our operations on the frame come here
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
# Display the ...
0
votes
0
answers
33
views
can opencv.js really find page corners
Has anyone had any success with opencv.js in finding page corners? There is a lot of noise on various discussion sites about it's ability - but I cannot find it to work when looking for a document ...
-4
votes
0
answers
57
views
cv2 not acting as in all docs i can find [closed]
Here the code:
import cv2
import numpy
img = cv2.VideoCapture(0)
run = True
while run:
frame = img.read()
cv2.imshow("baka", "hi")
This the error it gave me. I can’t ...
1
vote
0
answers
17
views
JavaCV frame reading not working on Raspberry Pi
i am currently developing an application to scan QR codes with Java and JavaCV.
On my mac, it works just fine. Opens the camera, reads the frames and detects + decodes the QR code.
When i run the code ...
0
votes
0
answers
42
views
OpenCV issue with including lib in CMake (Clion)
I have this CMake file in my project:
cmake_minimum_required(VERSION 3.28)
project(AICS)
include_directories(include)
include_directories(src)
set(CMAKE_CXX_STANDARD 17)
set(OpenCV_DIR "C:/...
-2
votes
1
answer
66
views
Trouble detecting/removing two watermarks that vary location across image dataset
I have a problem with removing watermarks from a collection of images. The watermarks appear near each other but are different (see below). One watermark is a red square and has white text inside of ...
0
votes
0
answers
49
views
Using fisheye calibration to solve allsky images using OpenCV (fails)
I am using fisheye calibration to solve chessboard images using OpenCV. It fails for the calibration flag cv2.fisheye.CALIB_RECOMPUTE_EXTRINSIC, so I work around it. But once I get the parameters, the ...
-6
votes
0
answers
62
views
How to detect and measure small dents on a car body using OpenCV and C++? [closed]
I'm developing a hail damage scanner that detects and measures even the smallest dents on a car body using high-resolution 3D models. I'm using C++ and OpenCV for this purpose. My goal is to ...
0
votes
0
answers
36
views
How can I fix this loop to correcttly track and classify objects?
I have this loop where what I want to do is:
detect the objects nad their bb
track them to assign a unique id to each box
check if an object stops
if an object stops, do the classification on this bb ...