Questions tagged [opencv]
OpenCV (Open Source Computer Vision) is a cross-platform library of programming functions for real time computer vision.
110
questions
1
vote
1answer
67 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
0answers
38 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 ...
0
votes
0answers
49 views
Resize video frame to fit tkinter window size when the window is resized
I've written a piece of code to play a video using OpenCV on tkinter. Its part of a game I've made and compiled into an application. But I've noticed that when I play the game in a different computers,...
3
votes
0answers
339 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
1answer
69 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
0answers
105 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
2answers
58 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
1answer
249 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
1answer
67 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
1answer
88 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
1answer
35 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
0answers
161 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
0answers
156 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
0answers
70 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
1answer
254 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
0answers
24 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
1answer
116 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
2answers
407 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 ...
0
votes
0answers
56 views
3
votes
2answers
1k 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
2answers
478 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
0answers
63 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
1answer
151 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
1answer
76 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
1answer
136 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 ...
2
votes
1answer
199 views
Image Processing - Comparing 2 images and Ranking Similarity
My code compares 2 images of any shape/dimension and ranks them in order of similarity. It starts with reading from a CSV file with columns image1, image2 which contain absolute paths and then ...
5
votes
0answers
46 views
Interfaces and OOP Design for Image Editor software
I'm new to C++ programming, and I'm building an Image Editor software like Lightroom/CameraRaw from scratch.
Apart from procedural code (actually seems that all the functions works correctly) my goal ...
2
votes
0answers
29 views
Create mosaic task #2
This post is a continuation of post here: Create mosaic task.
I improved code readability, hopefully it'll be reviewable now. Once again, I'm asking for tips to write better code.
Task: The point ...
2
votes
1answer
55 views
Whiten black contours around a skewed image
I have this image:
I want to whiten the black contours (borders) around it without affecting the image content.
Here is the code I used:
...
2
votes
0answers
159 views
Plant pest detection using CNN
I am doing a project in plant pest detection using CNN. There are four classes each having about 1400 images. While training the model using Convolution Neural Network, there is a smooth curve for ...
4
votes
2answers
621 views
Captcha Letter Extraction
We are developing an automatic text Captcha solver in python 3. The solver has a module that is responsible for extracting letters out of captcha images that contain 4 letters each. We would like to ...
10
votes
1answer
6k views
Trimming blank space from images
I am working on scanned documents (ID card, Driver licenses, ...). The problem I faced while I apply some preprocessing on them is that the documents occupy just a small area of the image, all the ...
3
votes
1answer
950 views
Image pre-processing and segmentation
I'm new learning python and image processing with python. For this reason, I took a project called "Classification of breast cancer images with deep learning".
I applied the following techniques: 1)...
1
vote
0answers
86 views
Image capture client - multi-threading + sharing data between services
I'm working on a small side project at the moment - like a homemade CCTV system.
This part is my Python Capture Client - it uses OpenCV to capture frames from a connected webcam and sends the frames ...
2
votes
1answer
164 views
Optimizing gradient function in C++
I'm computing the gradient of an image manually (without using built in functions) and I want to make it faster but keeping the same performance.
I'm very open to any suggestions.. currently learning ...
6
votes
1answer
2k views
Rotating an Image using own algorithm in python
For an uni assignment I have been giving the task of making my own rotating algorithm in python. This is my code so far.
...
5
votes
2answers
1k views
Passing bitmap from C# to C++ via a struct
First, I've read the a few questions regarding this issue, the most helpful being:
https://stackoverflow.com/questions/27463876/passing-bitmap-from-c-sharp-to-c
I was unable to get the provided ...
4
votes
1answer
202 views
Loops through each row in a binary image and gets the width of each group of black or white pixels
Example image:
Code:
...
3
votes
2answers
216 views
Testing Video Frames for Uniqueness
I'm working on a program that will (hopefully) eventually allow me to perform frame rate analysis like Digital Foundry does. The code below works (as far as I know), but before I iterate on it, I'd ...
2
votes
0answers
1k views
Real time object Detection and tracking
I am using OpenCV 3.3 to implement a project. My project allows to detect pedestrian and car using background subtraction from video sequence which get from camera. First, I detect the object region ...
2
votes
1answer
716 views
Image processing using Python OOP library
I am trying to learn OOP by refactoring my existing code (functions only). This example works but I am not sure whether it is pythonic and good practice.
I have a shared library which consist of ...
3
votes
0answers
86 views
Data set generation with Python and Matplotlib
I want to use Python and Matplotlib to create a data set of images. I want to do this by transforming the plot to a numpy matrix. At the moment it takes about 0.1 second to generate 100 images of size ...
4
votes
1answer
708 views
Parallelized Sobel algorithm using OpenMP
I implemented the Sobel algorithm sequentially, and got decent performance (1.49 s) but wanted to improve it. I parallelized it with OpenMP and got a ~3x speedup (0.523 s). I'd like to do better, but ...
17
votes
1answer
395 views
Efficiently selecting spatially distributed weighted points
Background:
Motivation behind writing the following code is originated in the area of computer vision. More specifically – image rectification. In order to obtain rectified images, one has to find a ...
1
vote
1answer
639 views
Multithread resource producer and consumer algorithm
I have made a little example of a code that stores frames of a camera in a buffer that runs in a separate thread and another thread can consume it. Is this model efficient?
...
10
votes
1answer
16k views
Looping over pixels in an image
I have the following code which iterates over all pixels of an image and does some manipulations on two images of the same size. I would like to speed it up and to avoid iterating over the positions ...
10
votes
1answer
1k views
Converting MP3 albums into MP4 videos for YouTube
This is a quick script that helps me to convert MP3 files from my CDs into videos I can upload on YouTube. It is intended for personal use, so no input error checks. I am creating a silent video using ...
1
vote
0answers
693 views
OpenCV multi-colored object tracking
These two classes are part of a larger program that I am developing. The user is supposed to interact with the program using handheld red, blue, green or yellow discs and moving them in front of a ...
3
votes
2answers
863 views
Image processing parallelization
I'm working in a big project so I decided to take just part of it which you can copy/paste and compile in your machine. You might get weird image at the end but that's fine, that's what I want.
I'm ...
1
vote
1answer
62 views
Set of matrix operations for summing around a matrix element
I have a results of simulations, which are discrete complex numbers representing wave function on a NxN grid. I calculate phase of the wavefunction. For every point on that grid I have to perform this ...