Questions tagged [opencv]
OpenCV (Open Source Computer Vision) is a cross-platform library of programming functions for real time computer vision.
131
questions
1
vote
1
answer
96
views
Corner detect takes long time to run
I am using OpenCV’s findchessboardcornersSB function to find the corners in the image. I am using below code/ header file:
...
7
votes
1
answer
659
views
Remove hot-spots from picture without touching edges
In the picture below there are some regions which are very bright (i.e. more white). Some bright regions are wide and some are narrow or thin. The red box covers one such wide bright spot, and blue ...
6
votes
1
answer
281
views
Image stitching using SIFT keypoint descriptor and homography matrix
I have written a code to stitch 2 images using SIFT keypoint descriptor and homography matrix for perspective transform. Are there any areas where code an be improved or optimized?
...
0
votes
0
answers
539
views
Converting ffmpeg AVFrame Yuv420P to OpenCV RGB cv::Mat
Thanks to Rotem and his help with this issue, I can offer an implementation that allows to use cvtColor to convert an AVFrame YUV420P into a BGR ...
2
votes
0
answers
85
views
Control your laptop using hand gestures
This program uses webcam to track hand movements / gestures and sends corresponding mouse / keyboard events to the computer. I use it to switch spaces, move active window between desktops, scroll ...
1
vote
2
answers
363
views
Bilinear interpolation optimized using intrinsics
I have found that a bottleneck of the OpenCV application I use is the bilinear interpolation, so I have tried to optimize it. The bilinear interpolation is in 8D space, so each "color" is an ...
2
votes
1
answer
790
views
Display Multiple Video in Window Python
I am beginner for the openCV.
I am using below codes to get four video in a file system and show to user. Like this:
V1 | V2
V3 | V4
Video length does not match, ...
1
vote
1
answer
62
views
Polarimetric imaging script in python
I made this script that takes 3 images taken with a polarising filter 45° apart as inputs and outputs an RGB preview and an image which encodes the polarization parameters as HSV.
However it's way too ...
2
votes
1
answer
139
views
polarimetric imager in python
My code takes 3 images taken with a polarising filter rotated 45° between them and transform them into a single image encoding the polarization parameters as HSV. what can be improved?
...
1
vote
1
answer
108
views
How to using custom colormap with pixel calculation, gray scale value by opencv and make it workable on camera [closed]
I tried to implement the mcolor colormap in the paper
at page 8 to 10.
I developed the code to process a image file and it works ok.
Now, I want to adopt this image processing method to the camera ...
5
votes
1
answer
1k
views
Remove background from a directory of JPEG images
I wrote a code to remove the background of 8000 images but that whole code is taking approximately 8 hours to give the result.
How to improve its time complexity? As I have to work on a larger dataset ...
0
votes
0
answers
88
views
Auto Fishing in Terraria via open cv colour detection
The code works perfectly.
It looks for a certain parts of the screen where the terraria fishing particles would be appear, after which it if the threshold is met it fishes. I was wondering if it was ...
13
votes
3
answers
1k
views
Looking for the particles that are emitted when a fish is detected in Terraria
The code run perfectly fine, with no errors. However, the entirety of the code is in 1 function and is kind of hard to read. As well as that I'm not sure if and how the code could be more optimised/...
0
votes
0
answers
97
views
Python 3 OpenCV script that scans a giant picture to make a video
This is a Python script that I wrote completely by myself. Basically it scans a giant picture to make a video.
They say one picture is worth more than a thousand words. Since a video contains ...
2
votes
0
answers
110
views
ORB Image detection and OpenCV
Working code for my image detection script. This is functional code.
I'm loading a number of images into an array, and using two classes to generate the two main components I need for my detection; <...
6
votes
1
answer
2k
views
Python 3 script to make photo collages
I have written a Python script that takes a list of filenames of pictures and generates a photo collage of them. This is my most complex project yet, and I have written it completely by myself (like I ...
2
votes
0
answers
49
views
Variable speed video playback using OpenCV according to frequency of mouse clicking
Here's my code - I've a lot to learn so any advice, tips etc would be welcome!
A few notes:
I'm using OpenCV and numpy for other features in this code, not just for this snippet.
The main readon for ...
3
votes
1
answer
1k
views
C++ program that replaces given color in an image using OpenCV
I have created a C++ program that changes the color of a pixel to another color. But the main feature is that it not only changes 100% accurate colors; instead it matches two colors by using a method ...
2
votes
0
answers
50
views
Can I better architect this image detection bot?
I'm trying to learn python by building an image detection bot for a 2d game.
The bot checks to see if it can find any one of a number of images within a cropped section of the game window. If it finds ...
8
votes
2
answers
1k
views
Face tracking with recognition and age/gender detection
This program loads a video, detects and tracks faces in the video and detects the estimated age and gender of each person. The objective is to collect data on the number of unique people in a video ...
3
votes
0
answers
72
views
Segment characters from license plate image according to regions with same height
I have (for example) the following license plate image:
And I want to segment the characters. The code I have so far consists of me using cv2.MSER to detect ...
2
votes
3
answers
441
views
Batch extracting differences between two images with enhancement using opencv
I am attempting to extract the absolute differences image between two input images and then enhance the intensity (brightness) channel in HSV color space with the given times. The workflow is like ...
1
vote
1
answer
74
views
Update image pixels based on different criteria
Problem statement: Assume a high resolution (> 3000 x 3000) image is given as input. The image pixels can be classified into one of the three categories namely text, background and drawing. There ...
5
votes
1
answer
80
views
Rainbow Trails Video Effect
This is an effect to augment juggling videos:
The goal of this effect is to add a rainbow trail to a video using a tracked set of points.
Link to source video
Link to source data
Link to complete ...
3
votes
1
answer
186
views
Reinventing BGR to Grayscale OpenCV convert function in Python
For academic purposes I want to reinvent Blue Green Red to Grayscale function in Python. I am new to Python so I believe my code below can still be optimized.
...
3
votes
1
answer
161
views
Image (Const) Iterator using C++17
I am trying to learn how to correctly implement an iterator (and its corresponding const variant) using a single template, so I would appreciate any criticism to the following code. It's an forward ...
2
votes
1
answer
281
views
Multi-core OpenCV denoising
I have ~40,000 JPEG images from the Kaggle melanoma classification competition. I created the following functions to denoise the images:
...
1
vote
1
answer
197
views
Watermarking an image
I have a small bit of code and I wonder if I can make it more readable. I would appreciate it if some people could take a look at it and give me some feedback. I especially wonder if there is a beter ...
3
votes
0
answers
695
views
Python - Get Unique frames of video containing object
I am analyzing videos from the popular social media platform, TikTok, and extracting the songs into a Spotify playlist. Here is a gif of one of these videos: https://i.imgur.com/I0dVoac.mp4. Full ...
3
votes
0
answers
2k
views
OpenCv webcam streaming class for WPF
My goal is to make a class that wraps the complexity of OpenCvSharp implementation to show a webcam streaming into a WPF Image. ...
1
vote
1
answer
114
views
Parallel image segmentation [closed]
Follow up question Image processing using Python OOP library
I want to use multiprocessing to analyze several images in parallel:
...
5
votes
0
answers
728
views
Selecting child contours in OpenCV
I'm really new to OpenCV. :) I have been working on this for almost an entire day. After hours of sleepless work I would like to know if I can further improve my code.
I have written some code to ...
5
votes
2
answers
679
views
Analyzing the darkest pixels of an image in Python
This script takes an image copied from the clipboard and analyzes the n darkest pixels of the image. It will loop through each found value, prints out the value information and the quantity, then ...
2
votes
1
answer
937
views
Made a sudoku solver with basic GUI in C++
I've made a sudoku solver which solves a sudoku, given user input, and can also extract digits from a picture of a sudoku to solve it. I've used OpenCV and GTK+ 2.0 to achieve the above. I am very ...
0
votes
1
answer
471
views
Image color-moment extractor [closed]
I was just wondering if there is a way to speed up the performances of this for loops in Python.
I'm trying to process an image to get the color-moments without using libraries.
It takes about 12sec ...
3
votes
1
answer
319
views
Conway game of life implemented with C++/OpenCV
Here is an implementation of Conway's Game of Life. It is kind of a brute force but it works fine. I have a special question about the method cv::Mat render() const,...
1
vote
1
answer
44
views
Tensorflow Python ML to Detect Emotion [closed]
I've created an application to predict emotions. But I think the application is being over fitted. And I cannot figure out how to solve the overfitting. I'm using a small data set of 107 images spread ...
3
votes
0
answers
463
views
PPE object detection with tensorflow and opencv with rtsp streams
I am working on an object detection API implemented in Tensorflow 1.14 and OpenCV 4.1, where my task is to recognize personal protection equipment (PPE) worn by workers at various construction site ...
3
votes
0
answers
400
views
Print numbers from video frames to console using pytesseract
This is my first ever Python program. It checks every frame of a video file with Tesseract then uses OCR to recognise numbers in that frame and prints it to the console.
...
3
votes
0
answers
111
views
Find product defects in a photograph
I have been trying to find defects (brown/copper parts) on this sample using PyQt, OpenCV and Python:
And I can find defects, too. My problem is, I have nobody to ask, get feedback etc. I need some ...
6
votes
1
answer
269
views
Dealing with lot of images and multiplications
With some basic knowledge of Python and referring a lot of sources, I have written the code below. But it takes half an hour for execution. How can I reduce the time? I read about vectorization but ...
1
vote
0
answers
33
views
PyOpencv code that displays color, b/w and canny images input from single live webcam camera
I have e single live webcam camera. I have displayed one color image, black and white image and canny edge image. Do you think I should put a scrollbar for the canny edge detection amount to make it a ...
5
votes
1
answer
173
views
Display image from live webcam as taken, with four different color filters and in B/W
I have a live webcam windows which means there are six subdivided windows in a single window live. And show pictures in colored and black and white. Is there anyway I can make the code ...
6
votes
2
answers
1k
views
Image edge detection
I have a Canny Edge Detection Code written in C++. I would like to know how can I make it more robust in terms of detecting all the edges correctly and save it? Is this the best possible edge ...
3
votes
2
answers
2k
views
Merging rectangles in C++ [closed]
I have the following code for separating out overlapping rectangles vs.
non-overlapping rectangles in C++ 11:
...
2
votes
3
answers
2k
views
OpenCV calculate center of mass for a single contour
I was recently going through some OpenCV code that finds the center of mass in a contour and realized there is potential room for optimisation.
What I noticed looking back through my code is when I ...
4
votes
0
answers
67
views
Merging two, three or four images
This code is about merging two or more images. Minimum images are two while maximum images loaded are four. So I will check how many images the user wants to merge. If the user chooses 2 and selects ...
3
votes
1
answer
332
views
Create a structuringselement in the form of a line with a certain degree and length
Within Matlab there exist a function to create a structuringselement in the form of a line.
SE = strel('line',len,deg) creates a linear structuring element that is ...
5
votes
1
answer
164
views
Image tracking code using opencv in python
I wrote this code to track small moving objects falling down a chute. The code works buts runs too slowly: using 60 FPS 1920 by 1080 footage the code only runs at about 10 FPS. The problem there is ...
1
vote
1
answer
297
views
Add watermark to images
Recently, I started reading image processing via opencv library in python.
I create a minio object storage and upload some photos into it. After that, I wrote a program which reads every image in ...