opencv

cannot write images using cv2.write

cannot write images using cv2.write Question: I am trying to convert images from .jpg to .png format using opencv. I have written the following code. if __name__ == ‘__main__’: logging.info(r’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’) logging.info(‘Starting to make a .lst file’) # png_to_png = glob.globoos.path.join(args.jpg2png, ‘*.png’) images_list = glob.glob(os.path.join(args.image, "*.jpg")) logging.info(f’images_list example: {images_list[3]}’) # mask_list = glob.glob(os.path.join(args.masks, "*.png")) # Changing …

Total answers: 1

remove stripes / vertical streaks in remote sensing images

remove stripes / vertical streaks in remote sensing images Question: I have a remote sensing photo that has bright non continuous vertical streaks or stripes as in the pic below, my question is there a way to remove them using python and opencv or any other ip library? , Asked By: gin || Source Answers: …

Total answers: 6

algorithm to save frames from a video file

algorithm to save frames from a video file Question: Is it possible to save a desired amount of images (DESIRED_FRAMES_TO_SAVE) from a video file spread-out evenly throughout the entire video file footage? Hopefully this makes sense I have a video file that is 8 seconds in length and I would like to save 60 Frames …

Total answers: 2

Which language is the OpenCV documentation referred to? not Python imo

Which language is the OpenCV documentation referred to? not Python imo Question: I am looking at the OpenCV documentation, an example here and I am wondering if that is not Python, because void is not related to Python. enter image description here I can’t find details elsewhere, sorry for this. I was looking for a …

Total answers: 2

Python OpenCV documentation

Python OpenCV documentation Question: Original question for posterity below I understood that functions are technically only in C++ and only the wrapper is available in Python with function calls examples in the documentation. It’s quite possible that, for those who are just starting out with OpenCV, the concept may not be as simple and intuitive …

Total answers: 2

AttributeError: 'cv2.VideoCapture' object has no attribute 'isOpend'

AttributeError: 'cv2.VideoCapture' object has no attribute 'isOpend' Question: I have a problem using OpenCV with VS Code I checked version of OpenCV and Python, but I don’t know what’s wrong. opencv version is 4.7.0 vscode interpreter is python 3.9.13(‘base’) /opt/anaconda3/bin/python here is condalist opencv-contrib-python 4.7.0.72 pypi_0 pypi opencv-python 4.7.0.72 pypi_0 pypi this is my code …

Total answers: 1

Count fruit from tree image

Count fruit from tree image Question: Here I am writing python code to count fruit from tree image. For that I have installed pip install opencv-python pip install numpy pip install opencv-contrib-python I am using python 3.11.2 These three packages import cv2 import numpy as np image = cv2.imread(‘tree.jpg’) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # look …

Total answers: 1

Migrate python2 to 3 IndexError: only integers, slices (`:`), ellipsis (`…`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

Migrate python2 to 3 IndexError: only integers, slices (`:`), ellipsis (`…`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices Question: So I try to migrate legacy python2 script to python3 but i got error on the some code print (‘resizing images’) for x in range(0, len(img)): imgResized.append(cv2.resize(img[x], (301 * len(img), 301))) print (‘resizing …

Total answers: 1

How do I reliably classify colours as red, yellow, or "other" colours in OpenCV?

How do I reliably classify colours as red, yellow, or "other" colours in OpenCV? Question: I have an input image from which I extracted the circles for a robotics project, and then got the average colour within those circles. The circles can either have a red or yellow colour as that is how I painted …

Total answers: 1

How to calculate the angle rotated of the cut out image?

How to calculate the angle rotated of the cut out image? Question: I have a 200*200 square image, now I draw a circle of 100 diameter with the center of this image as the center, cut this image into two parts along the circle, rotate this circle image by a certain angle and save it …

Total answers: 2