Created
October 20, 2022 16:50
-
-
Save victormurcia/e91c968ca2d140d3c7ed0d8ce665f939 to your computer and use it in GitHub Desktop.
making an roi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Select ROI from image | |
| imagedraw = cv2.selectROI('select',rgb_img) | |
| cv2.waitKey(0) | |
| cv2.destroyWindow('select') | |
| #cropping the area of the image within the bounding box using imCrop() function | |
| roi_image = rgb_img[int(imagedraw[1]):int(imagedraw[1]+imagedraw[3]), | |
| int(imagedraw[0]):int(imagedraw[0]+imagedraw[2])] | |
| fig,axs = plt.subplots(1,1, figsize=(5,5)) | |
| axs.imshow(roi_image) | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment