Skip to content

Commit

Permalink
image demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Armstrong committed Nov 5, 2023
1 parent 712421a commit 4694371
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test_scripts/image_demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import cv2

def process_and_show_image(image_path):
image = cv2.imread(image_path)

if image is None:
print("Error: Unable to read the image.")
return

grayscale_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

cv2.imshow("Original Image", image)
cv2.imshow("Grayscale Image", grayscale_image)

cv2.waitKey(0)
cv2.destroyAllWindows()

0 comments on commit 4694371

Please sign in to comment.