Closed monajalal closed 3 weeks ago
I don't know what the discrepancy between the two versions was but the following resolved it for me:
roi_image_fullscreen = cv2.resize(roi_image, (second_display_width, second_display_height))
cv2.imshow('RealSense', roi_image_fullscreen)
I didn't have this piece of code before and it was automatically doing it for me.
Expected behaviour
After selecting an ROI, and pressing Enter key, I wanted to expand it full screen (same size as my namedWindow)
Actual behaviour
I needed to install cv2 super resolution and apparently I needed to uninstall and then install --upgrade the opencv-contrib-python package. After doing so, now when I select the ROI, it doesn't zoom it out to the size of namedWindow (in this case my sized window is full screen) and it just shows the exact amount that is selected.
Dimension of the second display where I am showing my image
The old version (don't know what the version was)
The new version of opencv-contrib-python, after roi select, it doesn't set the size of image to be displayed to be size of the named window (here
RealSense
)Write here what went wrong. My assumption is the new version of opencv-contrib-python has caused it. Problem is, I didn't keep track of the working version.
Steps to reproduce
sr.readModel(path)
sr.setModel("edsr",4)
config.enable_stream(rs.stream.color, 1920, 1080, rs.format.bgr8, 30) cv2.namedWindow("RealSense", cv2.WND_PROP_FULLSCREEN) cv2.moveWindow("RealSense", second_display_x-1, second_display_y-1) #working resized window cv2.resizeWindow("RealSense", second_display_width, second_display_height) # Resize to screen dimensions cv2.setWindowProperty("RealSense", cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)#working resized window
$ /usr/bin/pip3 show opencv-python Name: opencv-python Version: 4.9.0.80 Summary: Wrapper package for OpenCV python bindings. Home-page: https://github.com/opencv/opencv-python Author: Author-email: License: Apache 2.0 Location: /home/mona/.local/lib/python3.10/site-packages Requires: numpy Required-by: FaceAnalyzer, MegEngine, mmcv, mmengine, nvdu, raytracing, ultralytics
$ /usr/bin/pip3 show opencv-contrib-python Name: opencv-contrib-python Version: 4.10.0.84 Summary: Wrapper package for OpenCV python bindings. Home-page: https://github.com/opencv/opencv-python Author: Author-email: License: Apache 2.0 Location: /home/mona/.local/lib/python3.10/site-packages Requires: numpy Required-by: mediapipe