The bilateral filter is a tool used to clean up an image by removing small, unwanted details while keeping the important parts of the image, like edges. It works by looking at the pixels around a specific pixel and averaging their color values. But it doesn't treat all pixels the same way, it gives more importance to the pixels that are similar in color and closer to the center pixel. This tool helps to make the image look cleaner and more smooth, while also keeping important features like edges visible. In this tutorial, we’ll learn about OpenCV bilateral filters with some practical work.
Let's understand the concept with some practical work.
Example:
Input
Code:
import cv2
img = cv2.imread('demo.png')
image = cv2.bilateralFilter(img, 15,95,75)
cv2.imshow('Bilateral filtered Image', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
Here, first, we imported cv2 and used cv2.imread to read the image. Then, we used cv2.bilateralFilter to apply a bilateral filter on the input image. We passed some parameters to declare the diameter of the pixel area used during filtering (15), the standard deviation in the intensity of the pixels (95), and the standard deviation in the spatial domain (75). At last, we used cv2.imshow function to display the filtered image.
Result:
We can also use some blur techniques like - gaussian blur with a bilateral filter to enhance the quality of the result.
Trainings :
Data Science Training in Indore | Python Training in Indore | Data Analytics Training in Indore | Blockchain Training in Indore | React JS Training in Indore | Web Development Training in Indore | Full Stack Development Training in Indore |Free Courses and Resource :
Dart | OpenCV Tutorials | Projects | Interview Questions | Python Data Structures and Algorithms | Aptitude Tests | Verbal Aptitude | Matplotlib Tutorials | Examples | Interview Questions | HackerRank Python | Pandas Tutorials | Projects | Interview Questions | Rust Tutorials | Projects | Interview Questions | ExpressJS Tutorials | Projects | Interview Questions | Django | MongoDB Tutorials | Examples | Interview Questions | HackerRank C Program Solutions | Python Tutorials by CodersDaily | React.js Tutorials | Golang Tutorials | Projects | Interview Questions | MS Sql Server Tutorials | Examples | Interview Questions | Verbal Ability Tutorial | Numpy Tutorials | Projects | Interview Questions | Power BI Tutorials | Projects | Interview Questions | Example Dashboards | Tensor Flow | HackerRank C++ Solutions | Django REST Framework Tutorial | CodeChef Python Solutions | Leetcode Python Solutions | Reasoning Ability Tutorial | Quantitative Ability Tutorial | C++ Tutorials | HackerRank Java Solutions | TCS NQT Mock Test Series | Verbal Aptitude 2 | HackerRank DSA Solutions | HackerRank SQL Solutions | Javascript | Node.js Tutorials |Interview Questions :
Pandas Tutorials | Projects | Interview Questions | ExpressJS Tutorials | Projects | Interview Questions | Django | Python Tutorials by CodersDaily | Golang Tutorials | Projects | Interview Questions | Numpy Tutorials | Projects | Interview Questions | Django REST Framework Tutorial |Top Colleges in India :
Indian Institute of Technology Bombay | Jaypee University of Engineering and Technology - Guna |