Here’s a receipt image that I’ve got and I’ve plotted it using matplotlib and If you see the image the text in it is not straight. How can I de-skew and fix it? I think if we want to de-skew first we have to find the edges, so I tried to find the edges using canny algorithm and then get
Tag: opencv
Harris corner detector at different rotations
I am using the opencv implementation of Harris Corner detection in python. My question is regarding the behaviour shown in the gif below – as the image is rotated the corners stop being detected (at various rotations). The full code: based on this. The image used can be found here. It is perhaps not so clear from the gif (more
Sampling from video frames and save them as an image – python openCV
I have a video file, I know how to save all of the frames,but my question is how to save only one frame of every 20 frames as an image? Thanks. Answer This is based on this tutorial: https://theailearner.com/2018/10/15/extracting-and-saving-video-frames-using-opencv-python/
How Delete line In image with openCV
I have these images and I want to eliminate the lines that appear, so that the date remains without any other noise. How can I do it in python with openCV? 1.jpg 2.jpg 3.jpg Answer output:
Flipping an image vertically in Python without using flip() method
I’m trying to flip an image vertically without using any default flip() or similar functions.I tried to iterate along the pixels and by using loops tried to reverse it so i can flip the image vertically. But the flipped image is looking like this: https://ibb.co/KKVkd2d What am i doing wrong? Answer To flip vertically you have to reverse rows in
How to play video on google colab with opencv?
I am working on a project related to object detection using Mask RCNN on google colab. I have a video uploaded to my colab. I want to display it as a video while processing it at the runtime using openCV. I want to do what cv2.VideoCapture(‘FILE_NAME’) does on the local machine. Is there any way to do it? Answer Found
Find all coordinates of black / grey pixels in image using python
I’m trying to find a way to read any any .png, .jpg or .tiff, and return the coordinates of all black or grey pixels in that image. I’m thinking of having a certain threshold grey color, and writing out the coordinates of every pixel that is darker than that. I’m not sure how to manage the aspect of reading the
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 something similar to this Answer Since OpenCV uses Numpy to display images, you can simply create a convolution kernel using Numpy. Here’s the kernel. Note the type is <class
OpenCV Python: How to overlay an image into the centre of another image
How can I paste a smaller image into the center of another image? Both images have the same height, but the smaller one has a width that is always smaller. The resulting image should be the smaller image with black bars around it so it is square. resizedImg blankImg Answer Here is one way. You compute the offsets in x
To invert colours from black to white in opencv python
I have a condition where I want to detect white line incase of black background and black line incase of white background. I used bitwise_not operation something like this: It is working perfectly until and unless i give a condition like this: I get an error ValueError: The truth value of an array with more than one element is ambiguous.