I've got a fresh install of OpenCV 3.2 with contribs, ffmpeg, and numpy. However, when I try to use the function selectROI I get an attribute error and I cannot figure out why!!!
I've tried to reinstall opencv and opencv-contrib however it doesn't seem to change anything.
import numpy as np
import ffmpy
import cv2
import os
def main():
...
r=0
cap = cv2.VideoCapture(filename)
...
while cap.grab():
...
if (frame_count>=next_valid):
# Initialisation of supporting variables
flag, frame = cap.retrieve()
if (go_around==0):
# Select ROI
r = cv2.selectROI(frame)
# Cropping and Brightening
imCrop = im[int(r[1]):int(r[1]+r[3]), int(r[0]):int(r[0]+r[2])]
...
main()
I just wish I could make a selectable ROI and store the dimensions!