As of May 31, 2023, we have updated our Code of Conduct.

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
5 votes
0 answers
78 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 ...
Alessandro Cerro's user avatar
2 votes
0 answers
40 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 ...
Plajerity's user avatar
2 votes
1 answer
71 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: ...
singrium's user avatar
  • 307
2 votes
0 answers
257 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 ...
Milan's user avatar
  • 121
4 votes
2 answers
1k 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 ...
Topcodersux's user avatar
10 votes
1 answer
12k 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 ...
singrium's user avatar
  • 307
3 votes
1 answer
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)...
dogac's user avatar
  • 33
1 vote
0 answers
167 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 ...
TomSelleck's user avatar
2 votes
1 answer
368 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 ...
Ja_cpp's user avatar
  • 351
6 votes
1 answer
4k 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. ...
ACommonDane01's user avatar
5 votes
2 answers
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 ...
WBuck's user avatar
  • 153
4 votes
1 answer
351 views

Loops through each row in a binary image and gets the width of each group of black or white pixels

Example image: Code: ...
Trevor's user avatar
  • 41
3 votes
2 answers
237 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 ...
Trevor's user avatar
  • 33
2 votes
0 answers
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 ...
Pawan Khatri's user avatar
2 votes
1 answer
1k 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 ...
snowflake's user avatar
  • 275
3 votes
0 answers
93 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 ...
Gilfoyle's user avatar
  • 1,115
4 votes
1 answer
949 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 ...
Laurentiu's user avatar
17 votes
1 answer
478 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 ...
Georgy's user avatar
  • 1,938
1 vote
1 answer
793 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? ...
Ollegn's user avatar
  • 113
10 votes
1 answer
18k 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 ...
snowflake's user avatar
  • 275
10 votes
1 answer
2k 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 ...
Yulia V's user avatar
  • 593
1 vote
0 answers
717 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 ...
ArmenHeat's user avatar
3 votes
2 answers
1k 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 ...
Ja_cpp's user avatar
  • 351
1 vote
1 answer
69 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 ...
Glock's user avatar
  • 13
20 votes
4 answers
16k views

Processing an image to extract green-screen mask

I am using OpenCV to process an image, and in my code, I have to check / edit each pixel separately: ...
Bart Friederichs's user avatar
4 votes
0 answers
89 views

Improving SVM fitting accuracy

I have this attempt on classifying CIFAR10 images. I'm curently training my SVM only on 1 of 5 sets, and decided on using polynomial kernel(degree=3,C=0.1 [changes have no effect],gamma=2 [changes ...
CIsForCookies's user avatar
1 vote
0 answers
2k views

Opencv forEach with lambda expression for parallel processing

I'm using forEach function to access pixels in parallel like so: ...
Ja_cpp's user avatar
  • 351
1 vote
0 answers
207 views

Performing FFTW double[2] on images of type cv::Mat

I've two different types of variables: cv::Mat and array of type double[2] so I do quite lot of copying between the two types. I ...
Ja_cpp's user avatar
  • 351
2 votes
0 answers
783 views

Optimize GPU usage for real-time object detection from camera with TensorFlow GPU and OpenCV

Trying to recognize objects real time using TensorFlow Object Detection API OpenCV using ssd_mobilenet_v1_coco_11_06_2017 model in GPU. ...
Rashik's user avatar
  • 21
5 votes
1 answer
8k views

OpenCV motion detection and tracking

I've been tinkering with Python and OpenCV for a while now, and thought I'd start an actual project. This is my first time making something that I'd actually consider using, and my first time posting ...
user avatar
6 votes
1 answer
2k views

Solver for some simple tangrams

I decided to write a program to solve Tangram puzzles. This went a bit out of hand and I ended up with 600+ lines of code. I don't think it should have taken so much code. Here is an image of a ...
Jan Kuiken's user avatar
  • 1,471
3 votes
1 answer
5k views

Saving images using Opencv in python

Is there a better way to rewrite this part in python. It doesnot have to be shorter as long as its much better. thanks in advance ...
SSSSS's user avatar
  • 31
4 votes
1 answer
867 views

Python API for simple OpenCV image proc, called with JSON inputs

Background I've got OpenCV & Python installed on a Docker container which is on a http server to process images and serve them. The user interface is through the web; user inputs an image and some ...
alkasm's user avatar
  • 196
6 votes
1 answer
145 views

Simple application in Python using OpenCV for face

I have been working on a simple Python application for face recognition with OpenCV. My code does its work and gets the job done, but I'm wondering if there's a 'better' way to do this. I hope I can ...
Pro's user avatar
  • 63
4 votes
3 answers
8k views

Create a two-dimensional Gaussian kernel

In my code I have a function that generate a 2D gaussian function given sigma like so: ...
Ja_cpp's user avatar
  • 351
3 votes
1 answer
4k views

Finding the 20th percentile pixel of an image using a histogram instead of std::sort

I have a 2-dimensional matrix (an image) in which I need to find the 20th percentile value. My first attempt was to sort the values and then index using ...
Ja_cpp's user avatar
  • 351
5 votes
0 answers
39k views

Python video streaming server and client

Worked with same IP cameras for some time, and noticed that camera use much processing power because of multiple connections. Writing streaming server looked as nice solution so I decided to write my ...
Aleksandar's user avatar
1 vote
1 answer
2k views

Color scale in range

I need to select a color given a position within a range. Using the "bwr" colormap shown below, I want to return a blue color for a value at the beginning of the range, a red color for a value at the ...
neiiic's user avatar
  • 113
5 votes
1 answer
422 views

C++ multiple object recognition

I am working on a multi-object recognition program. I have succeeded recognising two objects. However, the speed of my program is really slow and laggy. Can somebody please tell a way to speed the ...
ianc1339's user avatar
  • 222
3 votes
0 answers
1k views

Send Opencv::Mat image from Qt application to HTML client, using websocket

I wrote an application in C++ using Qt 5.7, basically is a websocket server, using qwebsocket for this, capable to send an image elaborated with OpenCV to an HTML client. In order to do this I encode ...
rok's user avatar
  • 141
6 votes
0 answers
432 views

Simple AR Tag classifier

I have been working on creating a simple AR Tag classifier, for detecting a simple AR Tag glyph. Spitting out an image that looks like this: With the red circle indicating the corner closest to the ...
Mark Omo's user avatar
  • 449
4 votes
0 answers
3k views

Capture, display, and save webcam video with openCV using C++

The basics were taken from one of the more basic OpenCV examples. Any comments are welcome regarding style and conventions, etc., as well as tips on using the OpenCV library, which I'm new to. Also, ...
user avatar
8 votes
1 answer
208 views

Vision AI using OpenCV

I know this may sound dumb, but last time, I posted C++ code, similar to this one: This is just something to get me closer to actually doing a neural network. This code is supposed to learn colors ...
Dat's user avatar
  • 451
7 votes
1 answer
797 views

Motion detection program for snapping of images

I'm doing a motion detection program where it snaps an image when it detects movement and snaps an image of the person's face if in view while this is all recorded and sends it all to Dropbox. It's ...
Marciano Ng's user avatar
16 votes
1 answer
7k views

Streaming H264 video from PiCamera to a JavaFX ImageView

I'm currently working on a robotics application where a video feed is being displayed from a Raspberry Pi 3. I've been working on a way to stream the video directly into JavaFX (the rest of the UI is ...
flakes's user avatar
  • 1,915
9 votes
2 answers
2k views

Color guessing code

This code is supposed to learn colors from many many data images, and then recognize color using an algorithm that I made. Eventually, I want the program to make its own algorithm. Data input and ...
Dat's user avatar
  • 451
4 votes
0 answers
444 views

Plant/Residue Detection project, How to structure it?

Introduction I have wanted to develop this project for more than two years. I just started writing it a couple days ago. I use it to detect plant or residue pixels in crop row images but it provides ...
Sarin Suriyakoon's user avatar
1 vote
1 answer
6k views

Cropping faces from images in a directory

I am using the below code for cropping faces from images in a directory ...
Pankaj Jain's user avatar
3 votes
1 answer
134 views

Color thresholding function

I wrote an adaptive color thresholding function in Python (because OpenCV's cv2.adaptiveThreshold didn't fit my needs) and it is way too slow. I've made it as efficient as I can, but it still takes ...
Alex's user avatar
  • 151
1 vote
0 answers
2k views

Utilizing Moviepy's fl_image function efficiently to modify an incoming video

This is a followup question from this question of mine. I used the suggested function provided by an answer in my current code. 'model' is a dictionary loaded from the pickle file. 'loadpickle' and ...
GKS's user avatar
  • 159