From 26107278355e5bad5fa0944bed5599ded1f69ca0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 19:49:24 +0000 Subject: [PATCH] feat: implement BGR/RGB comparison in Matplotlib for TODO 4 - Updated ipc_s01e01.py to show BGR and RGB versions in subplots. - Added titles to plots for clarity. - Kept OpenCV imshow for comparison. Co-authored-by: Michal-Fularz <3768498+Michal-Fularz@users.noreply.github.com> --- image_processing_course/ipc_s01e01.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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()