Questions tagged [opencv-python]

THIS TAG IS PENDING REMOVAL. Instead, please use [opencv] and [python] tags. (More information: https://meta.stackoverflow.com/questions/385792) This tag is used when asking questions related to OpenCV, exclusively when Python is used as the programming language. The tag does not suit any question pertaining to OpenCV for any other languages

Where can I find the OpenCV package?

You can find the package at the Python Package Index under OpenCV-Python can help you with that.

What about the documentation?

The documentation at http://opencv.org can help you.

Apart from the documentation, there is an OpenCV forum as well.

827 questions
17
votes
4 answers

`Building wheel for opencv-python (PEP 517) ... -` runs forever

When I run !pip install imgaug==0.4.0 the following is the output Collecting imgaug==0.4.0 Using cached…
william007
  • 13,874
  • 18
  • 76
  • 146
14
votes
2 answers

Stream OpenCV frame to HTML in Python

I am trying to read a video from a URL in opencv(Python) and then process it frame by frame and then send it to an HTML page. But I am only getting the first frame, after that the program gives the following error This is my main file…
Obiii
  • 403
  • 1
  • 4
  • 14
12
votes
3 answers

Cannot import cv2 on PyCharm

I am trying to import cv2 module in PyCharm, but it shows error. I tried in terminal as well pip install opencv-python pip3 install cv2 pip install opencv-python pip3 install cv2 and whatnot. Trying to install opencv-python from terminal shows…
thesamiroli
  • 350
  • 2
  • 6
  • 19
10
votes
1 answer

OpenCV's `getTextSize` and `putText` return wrong size and chop letters with lower pixels

I have the following Python code: FONT = cv2.FONT_HERSHEY_SIMPLEX FONT_SCALE = 1.0 FONT_THICKNESS = 2 bg_color = (255, 255, 255) label_color = (0, 0, 0) label = 'Propaganda' label_width, label_height = cv2.getTextSize(label, FONT, FONT_SCALE,…
SomethingSomething
  • 9,410
  • 12
  • 56
  • 105
9
votes
3 answers

How to join nearby bounding boxes in OpenCV Python

I am doing a college class project on image processing. This is my original image: I want to join nearby/overlapping bounding boxes on individual text line images, but I don't know how. My code looks like this so far (thanks to @HansHirse for the…
9
votes
1 answer

How to use OpenCV ConnectedComponents to get the images

How to use Python OpenCV ConnectedComponents function to obtain the images? From searching some past question, I have only been able to find how to shade the connected objects in different colors (Which I tested and it worked, but I have no idea how…
Chopin
  • 263
  • 1
  • 3
  • 6
8
votes
4 answers

Simple Captcha Solving

I'm trying to solve some simple captcha using OpenCV and pytesseract. Some of captcha samples are: I tried to the remove the noisy dots with some filters: import cv2 import numpy as np import pytesseract img = cv2.imread(image_path) _, img =…
Mehran Torki
  • 877
  • 1
  • 7
  • 32
7
votes
3 answers

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 for my poor English
olokelo
  • 105
  • 1
  • 1
  • 7
7
votes
0 answers

Numpy + OpenCV-Python : Get coordinates of white pixels

I have a grayscale image and I want to get all the coordinates of pixels with intensity level 255. I tried using: pixels = np.where(img[img == 255]) But instead of getting a list of (X,Y) coordinates, I got a list of numbers, like if img was a one…
SomethingSomething
  • 9,410
  • 12
  • 56
  • 105
5
votes
3 answers

Extract lined table from scanned document opencv python

I want to extract the information from a scanned table and store it a csv. Right now my table extraction algorithm does the following steps. Apply skew correction Apply a gaussian filter for denoising. Do a binarization using Otsu thresholding Do a…
Sreekiran
  • 2,494
  • 2
  • 10
  • 34
5
votes
1 answer

Not able to change frame-rate for input video using cv2.VideoCapture(video_path).set(cv2.CAP_PROP_FPS, new_frame_rate)

I am reading a .mp4 video file using opencv-python (3.4.3.18) and python (3.6.6) vid = cv2.VideoCapture(video_path) The original video has around 59 FPS and I want to reduce it to 10 FPS. So, I set the cv2.CAP_PROP_FPS property using the…
5
votes
2 answers

How to specify a custom output size in cv2.pyrDown() or pyrUp() method

I want to explicitly specify the output size of the image when applying cv2.pyrDown() on images. def gaussian_pyramid(image, scale=1.5, minSize=(30, 30)): yield image while True: w = int(image.shape[1] / scale) h =…
GPrathap
  • 5,786
  • 6
  • 54
  • 75
4
votes
1 answer

How to divide image into two parts without crossing any object using openCV?

I am using an object detection machine learning model (only 1 object). It working well in case there are a few objects in image. But, if my image has more than 300 objects, it can't recognize anything. So, I want to divide it into two parts or four…
4
votes
0 answers

Identify numbers within polygon shapes with OpenCV

I would like to identify a house number within a block of houses given a map image. I was able to draw the contours but I am kind of stuck on how to proceed to identify a house numbers from within the contours. Any help is much appreciated. Here is…
ESLearner
  • 77
  • 11
4
votes
0 answers

Matching bounding boxes from multiple viewing angles

I have mounted two cameras on different shelves of a fridge (at the bottom and top), facing each other. An object detector is fed with two images from these two streams and returns bounding boxes from them, independently. The problem: Given bounding…
hesampakdaman
  • 69
  • 1
  • 2
1
2 3
55 56