diff --git a/image_processing_course/ipc_s01e01.py b/image_processing_course/ipc_s01e01.py index a408e4f..8a86164 100644 --- a/image_processing_course/ipc_s01e01.py +++ b/image_processing_course/ipc_s01e01.py @@ -66,7 +66,19 @@ def ex_2(): # TODO 4 cv2.imshow('img_color', img_color) cv2.waitKey(1) + + # Convert image to RGB for correct Matplotlib display + img_rgb = cv2.cvtColor(img_color, cv2.COLOR_BGR2RGB) + + plt.figure() + plt.subplot(1, 2, 1) plt.imshow(img_color) + plt.title('BGR (Incorrect)') + + plt.subplot(1, 2, 2) + plt.imshow(img_rgb) + plt.title('RGB (Correct)') + plt.show() cv2.destroyAllWindows()