Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To write/save an image into the file directory, you can use, imwritefl # Importing the OpenCV Mbrary import cv2 Exercise: import matplotlib.pyplot as plt im

image text in transcribedimage text in transcribed

To write/save an image into the file directory, you can use, imwritefl \# Importing the OpenCV Mbrary import cv2 Exercise: import matplotlib.pyplot as plt im color = cv2.imread['road.png', cv2.IMREAD_COLOR) - Read the road.png file. im..grax = cv2.imread('road.PNG', cv2.IMREAD_GRAYSCALE) - Read the gray scale using the cv2.imwrite('road_color.png', im_color) cv2. IMREAD GRAYSCALE function and save the cv2.imwrite['road_gray.png', im,gray] - Read the image with all original colors using the cV2.IMREAD COLOR function and save the image under a newname. plt.figure() - Write the gray and color image under plt.imshowlim_color) "road gray.png" and "road_color.png" using plt.title('im_color') cv2-imwrite] plt.showl) - Plot the gray and color images using the plt.figure() matplotib. - Save the python file under "LAB9-road-04.py" plt.imshowlim_gray) plt.titlef'im.gray') plt.showi)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions