Ask Your Question

Revision history [back]

cv2.selectROIs in PyQt

I'm new in python using opencv and I'm trying to build a program that selecting region of interest (ROI) of an images. I have sample codes but my goal is to have one window form only. Is it possible to display opencv selectROIs in PyQt label or any widgets to have one window form only? Because on my observation it always appear in separate window and once I plot the ROI in an image, it cannot be editable. Please suggest any process or module that will accomplish my target output. Here's my sample code.

def browsefunc():
    filename = filedialog.askopenfilenames(filetypes=(("File", "*.jpg"), ("All Files", "*.*")))
    filelist = list(filename)

    for image in filelist:
    img = cv2.imread(image)
    fromCenter = False

    //My Goal is to have one window only. it is possible to mix the below code to PyQt module to achieve it?
    r = cv2.selectROIs('Select ROIs', img, fromCenter)