Category "opencv"

How to fill a polygon in OpenCV?

The Python code given below draws a triangle, how can I fill it with a color inside? Or another easier way to draw a triangle in OpenCV? pts = np.array([[100,3

OpenCV Python with CUDA on Windows: DLL Load Failed

I am trying to get OpenCV python bindings to work with CUDA, but when I run import cv2 I get the following error: OpenCV loader: os.name="nt" platform.syst

How to convert PNG to JPG in Python?

I'm trying to compare two images, one a .png and the other a .jpg. So I need to convert the .png file to a .jpg to get closer values for SSIM. Below is the code

Keep bins between 5% and 95% of a histogram in OpenCV/Python

I am intending to skip some histograms of an image in the extreme points of the distribution of any gray image. The extreme points to the left are represented b

How to get the location of all text present in an image using OpenCV?

I have this image that contains text (numbers and alphabets) in it. I want to get the location of all the text and numbers present in this image. Also I want to

How to automatically determine the background color of an RGBA image with highest contrast?

Background I have a bunch of RGBA images. Imagine icons, logos or similar images that I would like to display. These images can be of any color. Please also not

Opencv rotate camera mode

I want to rotate the camera view by 90 degree clockwise with an interrupt button. But the button's state goes back to it's default state when I click once and u

cv2.cvtColor(img,cv2.COLOR_BGR2RGB) not working

I am trying to create a screen recorder using mss and Opencv in python, the video I am capturing has a very different colours than original computer screen. I t

VideoCapture Release - Failed to Allocate Buffers (V4l2src) Jetson NX

I'm using a v4l2sink in gstreamer to tee a video stream that I can access in OpenCV. This works when I open the videocapture device and get frames, however at s

Why python can't find libavcodec.so.54 after Ubuntu update from 14.10 to 16.04?

I've update from Ubuntu 14.10 to 16.04 yesterday and right now I've tried to run my old python + opencv files but every file with opencv gives the same error:

Opencv/numpy issue: "module compiled against API version X but this version of numpy is Y"

I'm new to the world of opencv and few days ago I tried to install it. I installed everything and moved the cv2 file from opencv to python 2.7. I tired oving bo

MediaRecorder Crash?

I am going to record video but it's not working public void startRecord() { if (preVideo()) { mRecorder.start(); } isRecording = true; } p

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