[go: up one dir, main page]

0% found this document useful (0 votes)
7 views2 pages

Lab No.4 Iprr

This document outlines a lab experiment focused on essential image processing functions using OpenCV in Python. The objective is to implement techniques such as grayscale conversion, blurring, edge detection, dilation, erosion, resizing, and cropping. The conclusion emphasizes the successful application of these techniques, which are foundational for advanced computer vision tasks.

Uploaded by

Lok Regmi
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)
7 views2 pages

Lab No.4 Iprr

This document outlines a lab experiment focused on essential image processing functions using OpenCV in Python. The objective is to implement techniques such as grayscale conversion, blurring, edge detection, dilation, erosion, resizing, and cropping. The conclusion emphasizes the successful application of these techniques, which are foundational for advanced computer vision tasks.

Uploaded by

Lok Regmi
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
You are on page 1/ 2

LAB NO .

TITLE :- Essential Functions in Image Processing (Scaling).

OBJECTIVE:-

➢ To understand and implement basic image processing techniques such as grayscale


conversion, blurring, edge detection, dilation, erosion, resizing, and cropping using
OpenCV in Python.

THEORY:-

Image processing involves performing operations on images to enhance them or extract


useful information. In this experiment, basic image processing techniques were applied using
OpenCV, such as converting an image to grayscale to simplify data, applying Gaussian blur
to reduce noise, detecting edges using the Canny method, and using dilation and erosion to
modify edge structures. Additionally, the image was resized to change its dimensions and
cropped to focus on a specific region. These fundamental operations are commonly used in
computer vision tasks like object detection and image analysis.

SOURCE CODE:-
import cv2 as cv

img = cv.imread('Photos/Antu_special.jpg')
cv.imshow('Loku and Sam',img)
#converting to GrayScale
gray =cv.cvtColor(img,cv.COLOR_BGR2GRAY)
cv.imshow("Gray",gray)

# Blur
blur= cv.GaussianBlur(img,(7,7),cv.BORDER_DEFAULT)
cv.imshow("Blur",blur)

# Edge Cascade
canny=cv.Canny(img,125,175)
cv.imshow('Edge Cascade',canny)

#Dilating the image


dilated=cv.dilate(canny,(3,3),iterations=1)
cv.imshow("Dilating the image",dilated)

#Eroding
eroded=cv.erode(dilated,(3,3),iterations=1)
cv.imshow("Eroding",eroded)

# Resize
resized =cv.resize(img,(500,500))
cv.imshow("Resized",resized)

# Cropped
cropped = img[50:200, 200:400]
cv.imshow("Cropped",cropped)

cv.waitKey(0)

OUTPUT:-

CONCLUSION:-

In this experiment, we successfully implemented several fundamental image processing


techniques using OpenCV, including grayscale conversion, blurring, edge detection, dilation,
erosion, resizing, and cropping. Each operation demonstrated a specific aspect of how images
can be preprocessed and enhanced for further analysis. These basic techniques form the
foundation for more advanced computer vision applications and are essential for understanding
how image data can be manipulated and interpreted.

You might also like