You are on page 1of 11

ITM SLS Baroda University

School of Computer Science Engineering & Technology


BTech Semester 6 AI
Batch 2020-24
Computer Vision

Practical 1
Introduction to CV

1. Mounting drive to google colab.


Code:

2. Reading image from MyDrive.


Code:

3. Uploading image on google colab.


Code:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 1


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

4. Showing or printing the image.


Code:

Output:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 2


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

5. Read the image by grayscale.


Code:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 3


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

Output:

6. Write the image.


Code:

7. Using cvtColor convert BGR to Gray.


Code:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 4


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

Output:

8. Print the shape of the image.


Code:

9.
Code:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 5


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

Output:

10. Changing the image color to red.


Code:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 6


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

Output:

11. Changing the image color to blue.


Code:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 7


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

Output:

12. Changing the image color to green.


Code:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 8


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

Output:

13. Resize the image and interpolation = cv2.INTER_AREA.


Code:

Output:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.: 9


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

14. Resize the image and interpolation = cv2.INTER_LINEAR


Code:

Output:

15. Resize the image and interpolation = cv2.INTER_CUBIC.


Code:

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.:10


ITM SLS Baroda University
School of Computer Science Engineering & Technology
BTech Semester 6 AI
Batch 2020-24
Computer Vision

Output:

*****

Enrollment no.:20C22029 Name: Siddhi Parsekar B-Tech(AI) Page no.:11

You might also like