Questions tagged [opencv]

OpenCV (Open Source Computer Vision) is a cross-platform library of programming functions for real time computer vision.

Filter by
Sorted by
Tagged with
3
votes
0answers
45 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
3answers
82 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
1answer
54 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
1answer
30 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
1answer
154 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
1answer
97 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
1answer
60 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
1answer
71 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
161 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
281 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
936 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
87 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
308 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
152 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
462 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
73 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
174 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
37 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
270 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
253 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
72 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
255 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
26 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
121 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
697 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
57 views

Merging rectangles

I am looking at some code that merges boxes: ...
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
867 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
64 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
220 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
101 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
167 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
325 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
52 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
31 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
60 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
197 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
791 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
8k 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
1k 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
89 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
279 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
3k 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
2k 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
275 views
3
votes
2answers
225 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
925 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
88 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
839 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 ...