Skip to content
Advertisement

Tag: opencv

Filter in opencv/python

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,i-1,a]+image[j,i+1,a]+image[j+1,i,a]+image[j-1,i,a]+image[j+1,i+1,a]+image[j+1,i-1,a]+image[j-1,i-1,a]+image[j-1,i+1,a])/9)”. And if ı comment these out and run code with the lines working with cv2.filter2d method it

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 python3, you need to download opencv with pip3 First uninstall opencv: Then install

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 this into a keystroke (W, A,

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 find good

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 doesn’t explain what iterations mean and how to choose the best one? and what’s the use for object detection, thank you. Answer It is quite an

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/Pincushion distortion But I’m struggling to implement this in Python OpenCV. I’ve read about maps to apply filter on an

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-containing-boxes-756c15d7ed26 , but don’t know how to crop the table part in

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 images I’m using are all identical (and will be in the

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 more packages via pip install -r requirements.txt and some

Advertisement