Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# Reoding the imoge using imread() function image = cv2.imread('road.png') # Extracting the height and width of an image h, w = imageshape[:2] - Now
\# Reoding the imoge using imread() function image = cv2.imread('road.png') \# Extracting the height and width of an image h, w = imageshape[:2] - Now we will focus on extracting the RGB \# Displaying the height and width values of an individual porel. print("Height ={, Width ={3",format(h, w)\} - Note - OpenCV arranges the channels in BGR \# Extracting RGB volues. order. \# Here we have randomly chosen a pivel - So the Oth value will correspond to Blue pixel \#o by possing in 100 , 100 for height and width. and not Red. (B,G,R)= image (100,100] - Create a python file with the following line of codes. - Save the file under "LAB9-road-02.py" \# Displaying the pixel values Result B= image [100,100,0] R=107,6=75,B=67 print("B = [\}" format(B)\} B=67
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started