Answer the question
In order to leave comments, you need to log in
Why is OpenCV ROI not working?
I'm trying to select a region of interest in an image, but an empty array is returned. What am I doing wrong, and what values should be specified to determine the region?
Here is the code:
import numpy as np
import cv2
img = cv2.imread("circ.jpg")
img = cv2.resize(img, (500, 500))
roi = img[100:100, 200:200]
print(roi)
Answer the question
In order to leave comments, you need to log in
Because the image was cut from 100 to 100 pixels in y and from 200 to 200 in ximg[y:y+h, x:x+w]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question