I am trying to learn filters in opencv and running this code. But the problem is that when ı run the code it gives me an almost dark image and warns me with “c:/Users/fazil/Desktop/Yeni Metin Belgesi (3).py:19: RuntimeWarning: overflow encountered in ubyte_scalars result[j,i,a]=int((image[j,i,a]+image[j…
Tag: opencv
module ‘cv2.cv2’ has no attribute ‘dnn_superres’
I am trying to upscale image (performing super resolution) using OpenCV, but I am getting this error that module ‘cv2.cv2’ has no attribute ‘dnn_superres’. Any help would be greatly appreciated. I am using 4.4.0.44 OpenCV version. Here is the code section. Answer In case you are using …
How do you make the code check which section a tracked object is in?
sorry if the title is unclear. I’m making a code in OpenCV-Python that tracks the location of my pet goldfish and outputs a keystroke depending on which quadrant of the frame she is in. I’ve already gotten the program to track my fish and output her location in coordinates, but how do I convert th…
Draw contours around images of the same color with openCV python
I have this image with 3 channels RGB (a result of a VARI Index computation) and I would like to draw bounding boxes (rectangles) around the plants, represented in green here. What is the best and easiest way to do it with OpenCV / python? I guess it’s an easy problem for OpenCV experts, but I could not…
morphological transformation opencv noob questiong
hope you all have good day today. so I’m here learning python,opencv on a raspberry pi and Im hoping that someone can explain what the code below do, I’ve read from https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html and it…
Pinch/bulge distortion using Python OpenCV
I want to apply a pinch/bulge filter on an image using Python OpenCV. The result should be some kind of this example: https://pixijs.io/pixi-filters/tools/screenshots/dist/bulge-pinch.gif I’ve read the following stackoverflow post that should be the correct formula for the filter: Formulas for Barrel/Pi…
detect a table part from entire image in python
I have an image of size 3500×5000, now I want to detect only the table part from the entire image and crop and rotate it if it is not straight for OCR processing. After all search, I get an idea for cropping each cell in an image using https://medium.com/coinmonks/a-box-detection-algorithm-for-any-image-…
Improving image deskew using Python and OpenCV
The code I’ve produce to detect and correct skew is giving me inconsistent results. I’m currently working on a project which utilizes OCR text extraction on images (via Python and OpenCV), so removing skew is key if accurate results are desired. My code uses cv2.minAreaRect to detect skew. The ima…
error: (-215:Assertion failed) scn + 1 == m.cols in function ‘cv::perspectiveTransform’
Below is a python script that calculates the homography between two images and then map a desired point from one image to another However, when i display the image that contains the mapped point it returns the following error: According to my knowledge this error means that parameter assigned to the function …
How to tell pip that a package(opencv) has been compiled from source
Because of some specific requirements I needed to compile a package (opencv with cuda support) from source. After successfull compilation my python-environment is able to import opencv without a problem: But if I try pip list opencv-python is not part of it: The problem is that afterwards I need to install mo…