Category "opencv"

How to install gstreamer 1.0 badplugin for opencv?

On a Ubuntu 18.04 machine I am trying to use opencv 4.1.2 facedetect in a gstreamer 1.14.5 pipeline but unfortunately the plugin is not installed. I downloaded

normalize histogram in c++ - function normalize in openCV

I need to normalize the histogram of an image f which mean to applicated an transformation of histogram from image in order to extend the range of value of f to

How to create a Python convolution kernel?

I'm trying to create a convolution kernel, and the middle is going to be 1.5. Unfortunately I keep running in to ideas on how to do that. I'm trying to create s

OpenCV real time streaming video capture is slow. How to drop frames or get synced with real time?

Goal and problem I'd like to set up an opencv system to process either HLS streams or RMTP streams, however, I am running into a strange issue regarding a redu

Error: (-215:Assertion failed) npoints > 0 while working with contours using OpenCV

When I run this code: import cv2 image = cv2.imread('screenshoot10.jpg') cv2.imshow('input image', image) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) edg

Random cropping data augmentation convolutional neural networks

I am training a convolutional neural network, but have a relatively small dataset. So I am implementing techniques to augment it. Now this is the first time i a

Change the Background color of an image set using OpenCV

I have a fingernail dataset and in these images they have different background colors as below image. I need to covert all those image's background color to on

Improve performance of per-pixel image multiplication with mask and thresholding

I am looking for suggestions to make this algorithm run faster. Using C# and EmguCV (a managed wrapper over OpenCV), I am processing images in real-time, adjust

Pipe opencv images to ffmpeg using python

How can I pipe openCV images to ffmpeg (running ffmpeg as a subprocess)? (I am using spyder/anaconda) I am reading frames from a video file and do some process

How does OpenCV's DFT-based filter2D actually work?

I have issues comprehending how the filter2D method of the the OpenCV library actually works. The "standard" direct version for small kernel sizes is clear, but

Python OpenCV skew correction for OCR

Currently, I am working on an OCR project where I need to read the text off of a label (see example images below). I am running into issues with the image skew

Python add audio to video opencv

I use python cv2 module to join jpg frames into video, but I can't add audio to it. Is it possible to add audio to video in python without ffmpeg? P.S. Sorry fo

Detect and crop a box in .pdf or image as individual images

I have a multi-page .pdf (scanned images) containing handwriting I would like to crop and store as new separate images. For example, in the visual below I would

python OpenCV - add alpha channel to RGB image

What is the best way to convert RGB image to RGBA in python using opencv? Let's say I have one array with shape (185, 198, 3) - it is RGB and the other is a

How to find extreme outer points in an image with Python OpenCV

I have this image of a statue. I'm trying to find the top, bottom, left, and right most points on the statue. Is there a way to measure the edge of each side

cv2.findContours function is not working in both versions

I am new to computer vision and haven't really went through any tutorials on thresholding or blurring or other filters. I am using the below two piece of codes

How To set the size of image more than default value in OpenCV

What is the default frame size of opencv image streaming frame ? If I set Width and height of frame more than default frame size what happens? import cv2 cam

OpenCV Python - No module named cv2 (again)

I know that this question has already been asked here a few times, but since no answer helped me so far, I'm posting it here again. What I did: I cloned the r

OCR : Replace recognized text with its translation like google translate

I am working on an OCR project. I using Firebase ML Kit for Optical character recognition. I have to replace the text with its translation in different language

OpenCV version 4.1.0 drawContours error: (-215:Assertion failed) npoints > 0 in function 'drawContours'

I have the following code that worked well with OpenCV 3.4.1 and now is not working with OpenCV 4.1.0 and gives an error. I do not know how to adapt the code wi