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
4 votes
1 answer
1k views

Safe handling of variables in multi-threading application with shared resources

I've been developing this application as my first C++ project and am at a point where it is functional and would like to take a step back and critique/improve my code from a standpoint of ...
DrTarr's user avatar
  • 151
1 vote
0 answers
107 views

Sensor-Stream-Recorder Project

I'm a student working on a project to record sensor data from magnetic sensors. As part of the project, I created a 'Recorder-Tool' using opencv to acquire the recordings I need. The purpose of this ...
Hassan's user avatar
  • 11
4 votes
1 answer
3k views

OpenCV 3: Using k-Nearest Neighbors to analyse RGB image

I'm new to computer vision and numpy. I wrote a simple script to seperate red, green and blue colors from the original image by using the kNN algorithm. After reading through some numpy tutorials, I'...
dev-random's user avatar
6 votes
1 answer
3k views

Program for face recognition

I have been using the following script for face recognition as a security feature: main.py ...
Vin's user avatar
  • 185
24 votes
2 answers
56k views

Crop black border of image using NumPy

Objective: Crop the image so only the number stays in the image Problem: Slow Performance I have code that crops an image. The image pixels are 0 or 255. There are no values between. The ...
user avatar
3 votes
1 answer
357 views

Read current picture with OpenCV and always return a new picture

When opening a rtc-stream a thread should always grab the newest picture because otherwise there would be a huge buffer with "old" pictures. Also a call from getMatFromStream() should never return the ...
Gildraths's user avatar
  • 133
1 vote
1 answer
2k views

Different method to calculate blob area in OpenCv

I'm trying to use a different method to calculate a blob area from contourArea, using the countNonZero function. I want to see if there is significant approximation ...
rok's user avatar
  • 141
14 votes
1 answer
3k views

Dynamic Colour Binning: Grouping Similar Colours in Images

This is a piece of code that implements an image-processing algorithm I came up with. I call it Dynamic Colour Binning. It's a fairly academic exercise that was more about providing a learning ...
Marco Tompitak's user avatar
1 vote
0 answers
5k views

OpenCV-based wrapper for Windows screen capture

I have written a ScreenVideoCapture class that implements an interface for capturing frames from a specified monitor connected to the PC. It uses OpenCV structures (...
Wasabi Fan's user avatar
1 vote
1 answer
3k views

Multithreaded MJPG network stream server

I'm a bit of a neophyte when it comes to C++, and so I'd like some feedback regarding a recent project. The code sits on a Raspberry Pi and streams camera data over TCP on a specified port. The ...
BM-'s user avatar
  • 161
1 vote
0 answers
606 views

Asking for optimizing part of a hog-based object detection using C++

Since Matlab implementation of HOG+SVM object detection algorithm was too slow, I decided to make use of the speed of C++ and re-implemented the algorithm in it. However, I'm more or less unfamiliar ...
Federico's user avatar
  • 111
2 votes
1 answer
2k views

Set openCV basic structures to zero in a unique way

For test cases I need a unique way to set any structure to zero. For openCV I wrote this: ...
Kellerspeicher's user avatar
6 votes
1 answer
5k views

Python GUI for cropping and saving images quickly

I wrote a simple GUI applications to help me select 'positive' regions of a bunch of photos for the purpose of training an object detectir using OpenCV Haar Cascades. For training purposes, you need ...
sunny's user avatar
  • 1,825
3 votes
0 answers
4k views

Optimizing OpenCV's undistortPoints

I am working on improving the runtime of code that undistorts every pixel point in an image. Currently each point is undistorted via a call to cv::undistortPoints()...
major mishap's user avatar
4 votes
1 answer
2k views

Shortest path in image

This code takes an image and detects a global shortest path from the top to bottom row, with the requirement that top and bottom column index be the same. For this, it scans through each element on ...
ChrisF's user avatar
  • 51
6 votes
1 answer
10k views

Histogram of a RGB image using OpenCV

I wrote some C++ code using the OpenCV library. The program reads the image and plot histograms of Red, Green, and Blue components. I am very new to OpenCV so I need comments and advice. What do you ...
ffttyy's user avatar
  • 235
4 votes
0 answers
836 views

Matlab-like reshape in OpenCV

I am translating Matlab code to OpenCV. The code involves lots of reshaping of large matrices. As the Matlab reshape differs from OpenCV you can't just use OpenCV reshape. Here is why: Let's suppose ...
Saeid's user avatar
  • 141
2 votes
1 answer
2k views

Simple speed up of C++ OpenMP kernel

This function calculates the standard deviation of a patch, given a kernel size and greyscale OpenCV image. The middle pixel of the patch is kept if stdev of the patch is below the given threshold, ...
Pieter Bosma's user avatar
3 votes
1 answer
3k views

fftshift implementation for OpenCV

I'm trying to implement fftshift from matlab for OpenCV. Can you please review the correctness of my algorithm? Have I missed something? Also, is there a better and faster way to do it? ...
Gilad's user avatar
  • 5,311
0 votes
1 answer
7k views

Real time head segmentation using OpenCV

I am using OpenCV 2.410 to implement a project. My project allows to segment head from video sequence which get from camera. First, I detect the head region and then apply segmentation method for that ...
John's user avatar
  • 121
6 votes
1 answer
684 views

Tracking Eye Movements

The following class (that was my first class ever in python) was used in an eye tracking context. Imagine a context where you always will have a single gaze-point and some closed contours. How can I ...
cpicanco's user avatar
  • 479
3 votes
0 answers
698 views

Grayscale bilinear patch extraction - SSE optimization

My program makes an intensive use of small sub-images extracted using bilinear interpolation from larger grayscale images (some call this problem subpixel translation). I am using the following C++ ...
BConic's user avatar
  • 131
5 votes
2 answers
2k views

More optimized approach of Dijkstra's algorithm

I need a graph-search algorithm that is enough in our application of robot navigation and I chose Dijkstra's algorithm. We are given the gridmap which contains free, occupied and unknown cells where ...
Xegara's user avatar
  • 153
12 votes
1 answer
1k views

Custom iterator implementation returning OpenCV Mat

I have written an adapter class that allows iteration over the rows of a Mat object from OpenCV. For those interested, here is the Mat documentation, but the ...
Aurelius's user avatar
  • 1,328
3 votes
1 answer
579 views

Combining multiple files of uncommon filetype into one

I've created a utility program for combining multiple .vec files into one. The program's main application is in training haar cascade classifiers in openCV (details). This is my first open source ...
randomcastle's user avatar
5 votes
1 answer
3k views

Connected component analysis

I finished a program to do connected component analysis using union - find algorithm. Is it true that the complexity of the code is \$O(N logN)\$, where \$N\$ is the total number of pixels (512x512 by ...
Dzung Nguyen's user avatar
7 votes
1 answer
12k views

"Histogram of Oriented Gradients" (HOG) feature detector for computer vision

Here is a function that I've only slightly modified from its original context, found here. Before mentioning anything else, it should be noted that I'm desperately trying to optimize this code for ...
Louis Thibault's user avatar
1 vote
1 answer
2k views

Track a fix area with meanshift -OpenCV [closed]

I need your help in OpenCV. I'm a student and am working on a project in which involves a little autonomous car. I use Python for the main programming language. I have some problem with my meanshift. ...
lilouch's user avatar
  • 119
6 votes
1 answer
3k views

Replace subimage by its average value

I have the input image in, and the mask image lev (which label each pixel as a number from 1 to ...
Dzung Nguyen's user avatar
2 votes
2 answers
35k views

OpenCV 2.4.5 face detection

This code is supposed to grab live camera feed, display feed in a window, mark in rectangles all detected faces, get the biggest detected face (by total area), display it in separate window, convert ...
Nenad Bulatović's user avatar
12 votes
3 answers
8k views

Density-based clustering of image keypoints

I have implemented the DBSCAN algorithm for clustering image keypoints. I have been following the pseudocode on the wiki page pretty strictly, and it's working, but I get the feeling its a very naive ...
Jono Brogan's user avatar
10 votes
2 answers
1k views

OpenCV Mat processing time

I'd like to know whether having different variables for the src (source) and dst (destination) of an OpenCV function will have an effect on the processing time. I have two functions below that does ...
Og Namdik's user avatar
  • 201

1 2
3