- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Blurring an image using the OpenCV function blur()
In this program, we will blur an image using the opencv function blur().
Algorithm
Step 1: Import OpenCV. Step 2: Import the image. Step 3: Set the kernel size. Step 4: Call the blur() function and pass the image and kernel size as parameters. Step 5: Display the results.
Original Image
Example Code
import cv2 image = cv2.imread("testimage.jpg") kernel_size = (7,7) image = cv2.blur(image, kernel_size) cv2.imshow("blur", image)
Output
Blurred Image
Explanation
The kernel size is used to blur only a small part of an image. The kernel moves across the entire image and blurs the pixels it covers.
- Related Articles
- Blurring an image using the OpenCV function Gaussian Blur()
- Blurring an image using the OpenCV function medianBlur()
- How to blur an image using Node Jimp blur() function?
- How to blur faces in an image using OpenCV Python?
- OpenCV Python Program to blur an image?
- Eroding an image using the OpenCV function erode()
- Applying Gaussian Blur to an image using the Pillow library
- Applying Box Blur to an image using the Pillow library
- Upsampling an image using OpenCV
- Downsampling an image using OpenCV
- How to implement blur (averaging) in OpenCV using Java?
- How to implement Gaussian blur in OpenCV using Java?
- How to implement Bilateral blur in OpenCV using Java?
- How to implement Median blur in OpenCV using Java?
- Draw an ellipse on an image using OpenCV

Advertisements