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 | Data Analytics Training in Indore | Python 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 :
Verbal Aptitude | Matplotlib Tutorials | Examples | Interview Questions | Pandas Tutorials | Projects | Interview Questions | OpenCV Tutorials | Projects | Interview Questions | ExpressJS Tutorials | Projects | Interview Questions | Dart | Python Data Structures and Algorithms | Rust Tutorials | Projects | Interview Questions | Aptitude Tests | HackerRank Python | Django | MongoDB Tutorials | Examples | Interview Questions | NumPy Practice Questions | Python Tutorials by CodersDaily | Golang Tutorials | Projects | Interview Questions | React.js Tutorials | Verbal Ability Tutorial | MS Sql Server Tutorials | Examples | Interview Questions | Power BI Tutorials | Projects | Interview Questions | Example Dashboards | Numpy Tutorials | Projects | Interview Questions | Django REST Framework Tutorial | HackerRank C++ Solutions | Tensor Flow | Pandas Practice Questions | Python Practice Questions | C++ Tutorials | Quantitative Ability Tutorial | Javascript | Node.js Tutorials | HackerRank SQL Solutions | HackerRank DSA Solutions | Verbal Aptitude 2 | HackerRank Java Solutions | HTML Tutorial | TCS NQT Mock Test Series | Reasoning Ability Tutorial | CodeChef Python Solutions | HackerRank C Program Solutions | Leetcode Python Solutions | SQL Practice Question | Matplotlib Practice Questions |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 |