0% found this document useful (0 votes)
5 views4 pages

Write A Program To Read An Image Using Open CV

The document contains four programs that demonstrate how to read and display images using OpenCV and Matplotlib in Python. Each program includes different functionalities such as displaying in grayscale, adding titles, and converting from BGR to RGB format. The provided code snippets serve as practical examples for image processing tasks.

Uploaded by

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

Write A Program To Read An Image Using Open CV

The document contains four programs that demonstrate how to read and display images using OpenCV and Matplotlib in Python. Each program includes different functionalities such as displaying in grayscale, adding titles, and converting from BGR to RGB format. The provided code snippets serve as practical examples for image processing tasks.

Uploaded by

yashias231
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Program 1

Question:

Write a program to read an image using Open CV.

INPUT:

import cv2

import [Link] as plt

import numpy as np

img=[Link]('[Link]')

[Link](img)

[Link]()

OUTPUT:
Program 2

Question:

Write a program to read an image using Open CV in grayscale mode.

INPUT:

import cv2

import [Link] as plt

import numpy as np

img=[Link]("[Link]",0)

[Link](img,cmap= "gray")

[Link]("Abstract Art")

[Link]("on")

[Link]()

OUTPUT:
Program 3

Question:

Write a program to read an image using Open CV and insert title for the image.

INPUT:

import cv2

import [Link] as plt

import numpy as np

img=[Link]('[Link]')

[Link](img)

[Link]('Abstract Art')

[Link]('on')

[Link]()

OUTPUT:
Program 4

Question:

Write a program to read an image using Open CV and convert it from BGR to RGB Image.

INPUT:

import cv2

import [Link] as plt

import numpy as np

img=[Link]('[Link]')

[Link]([Link](img,cv2.COLOR_BGR2RGB))

[Link]('Absract Art')

[Link]('on')

[Link]()

OUTPUT:

You might also like