0% found this document useful (0 votes)
9 views

Coding Using Matplot

python

Uploaded by

jedad33338
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Coding Using Matplot

python

Uploaded by

jedad33338
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

a.

Load Image and Give the title of image

#import required module cv2, matplotlib and numpy


import cv2
import matplotlib.pyplot as plt
import numpy as np
#Load the image file into memory
img = cv2.imread('octopus.prng)
#Display Image
plt.imshow(img)
plt.title('Octopus’)
plt.axis('off')
plt.show()
b. Change the colour of image and change the image
to grayscale

#import required module cv2, matplotlib and numpy


import cv2
import matplotlib.pyplot as plt
#Load the image file into memory
174%
imgev2.imread('octopus.png) #Chaning image colour
image colour
plt.imshow(cv2.cvtColor(img, cv2.COLOR
BGR2RGB))
plt.title(Octopus)
pltaxis('off')
plt.show()
c. Print the shape of the image

import cv2
imgcv2.imread('octopus.prng.(0))
print(img shape)

Result: (1920, 1357)

d. Display the maximum and minimum pixels of


image

import cv2
imgev2.imread('octopus.png'.0)
print(img.min())
print(img.max())

result: 0
255

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy