Applying Bilateral Filter

void bilateralFilter(InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT )

Parameters:
  • src – Source 8-bit or floating-point, 1-channel or 3-channel image.
  • dst – Destination image of the same size and type as src .
  • d – Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace .
  • sigmaColor – Filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood (see sigmaSpace ) will be mixed together, resulting in larger areas of semi-equal color.
  • sigmaSpace – Filter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough (see sigmaColor ). When d>0 , it specifies the neighborhood size regardless of sigmaSpace . Otherwise, d is proportional to sigmaSpace .
You can find a nice example in OpenCV Documentation.

A bilateral filter is non-linear, edge-preserving and noise-reducing smoothing filter. The intensity value at each pixel in an image is replaced by a weighted average of intensity values from nearby pixels. This weight can be based on a Gaussian distribution. Crucially, the weights depend not only on Euclidean distance of pixels, but also on the radiometric differences. For example, the range difference such as color intensity, depth distance, etc. This preserves sharp edges by systematically looping through each pixel and adjusting weights to the adjacent pixels accordingly.

Example:

 ------------
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"

using namespace std;
using namespace cv;

int main( int argc, char** argv )
 {
  
     Mat src = imread( "Fig1039.tif", 1 );
     Mat dst;

     //Apply bilateral filter
     bilateralFilter ( src, dst, 15, 80, 80 );
     imshow("source", src);
     imshow("result", dst);  

     waitKey(0);
     return 0;
 }

------------

Result:


Source:
http://en.wikipedia.org/wiki/Bilateral_filter

18 comments:

  1. How do you actually determine d,sigmaColour and sigmaSpace for any application ? Should it be done by looking at the image histogram ? Or should be done on a trial and error basis ?

    ReplyDelete
    Replies
    1. http://docs.opencv.org/3.0-beta/modules/imgproc/doc/filtering.html

      this is by opencv for learning about filters and it explains what the values are.

      Delete
  2. شركة تركيب ستائر بالرياض
    شركة تركيب باركية بالرياض
    شركة تركيب غرف نوم بالرياض
    شركة تركيب عفش بالرياض
    كما توفر شركة عامل تركيب أثاث بالرياض مجموعة كبيرة من السيارات الخاصة بنقل الأثاث وتتميز السيارة بأنها واسعة ونظيفة وكذلك عنصر الأمان فهي آمنة تماما علي الأثاث
    فني تركيب ستائر بالرياض
    الستائر من أكثر الأشياء التي لا يمكن الاستغناء عنها بأي شكل من الأشكال لذا تعمل الشركة على توفير مجموعة من الفنيين ويتميز فني تركيب ستائر بالرياض بالاحتراف الشديد في مجاله وبشكل خاص أن التعامل مع أقمشة الستائر يحتاج إلى حرص شديد حتى لا تفسد أقمشة الستائر أثناء التعامل معها، كما تهتم الشركة بتوفير كافة اللوازم التي تستخدم في تركيب جميع أنواع الستائر كما توفر أفضل الإكسسوارات المطلوبة لتزيين الستائر وتركيبها
    كل هذه الخدمات المقدمة للعملاء من خلال أسعار مميزة ومجموعة من العمال القادرين على التعامل باحتراف ومهارة كبيرة

    ReplyDelete
  3. Thank you so much for spending time to write this blog article, i must say you are a excellent and talented blogger, I Found This Article To Be Very Informative and Helpful, please keep sharing such amazing blogs I am a Accountant from United States of America, Washington Dc, and I Love to read and Write Blog.
    Some Of My Web Blogs Awesome Blog Post Please Feel Free to Check Out My Blog you will find the process of Norton software installation with step by step instructions and much more.

    Keep Sharing will come back to read more,

    Click to Process

    norton.com/setup download and install
    norton.com/setup enter product key
    www.norton.com/setup
    login.norton.com
    my.norton.com
    norton.com/setup
    norton.com/setup activate
    norton.com/setup install
    norton.com/setup help
    norton.com/setup renewals
    norton.com/enroll product key

    ReplyDelete
  4. Want to Protect your PC? Buy, install and activate Nortoncom Setup. It can easily protect your system from virus attack or hacking. We also provide Norton Product Activation Key Norton Security Deluxe 2020 Product Key or Norton Customer Support Phone Number. Call Us on +1-844-688-4484.

    ReplyDelete
  5. Air Canada Book A Flight Thanks for the nice blog. It was very useful for me. I’m happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.

    ReplyDelete
  6. Activate your amazon prime in simple step follow the amazon website offical www.amazon.com/mytv or primevideo.com/mytv to activate your amazon prime in your device.
    www.primevideo.com/mytv primevideo.com mytv primevideo mytv primevideo mytv code

    ReplyDelete
  7. Activate com amazon mytv activate by giving the activation link primevideo.com/mytv in your tv and enjoy amazon popular shows such as movies & web series.Visit given link primevideo mytv code ..

    ReplyDelete
  8. Prime Video is a real time feature. Fundamentally it is just for prime clients. The assistance offers a great many Prime Videos at no charge and Prime Members at no charge. In Amazon Prime Video, clients can undoubtedly lease and purchase films and TV shows. Primevideo.com/mytv - Amazon Prime is a help from Amazon that clients need to pay a month to month add up to utilize. Consequently, he can utilize the Amazon Prime help and exploit the entirety of Prime's highlights.
    Read more…

    ReplyDelete
  9. instagram
    instagram login
    http://eshbrooklyn.com
    instagram video download
    instagram download
    instagram reels download
    instagram story download
    instagram bio for girls
    instagram captions
    instagram app
    instagram account delete
    instagram apk
    instagram autofree.in
    instagram account
    instagram appeal form
    instagram account delete permanently
    instagram auto liker
    instagram bio
    instagram bio for boys
    instagram bio ideas
    instagram background
    instagram bio for girls attitude
    instagram blue tick copy
    instagram bio for boys in punjabi
    instagram captions for boys
    instagram captions for girls
    instagram customer care number india
    instagram create new account
    instagram copy link download
    instagram ceo
    instagram call centre number
    instagram dp
    instagram delete account
    instagram download video
    instagram download apk
    instagram download for pc
    instagram delete permanent
    instagram dp for girls
    instagram emoji
    instagram engagement rate
    instagram email
    instagram engagement rate calculator
    instagram engagement
    instagram extension
    instagram editing
    instagram email support
    instagram followers
    instagram followers increase
    instagram followers hack
    instagram followers free
    instagram fonts
    instagram followers increase app
    instagram forgot password
    instagram fake followers

    ReplyDelete
  10. التصوير الفوتوغرافي التجاري
    يساعد التصوير التجاري في خلق وعي أكبر بعلامتك التجارية وزيادة مساحة تواجدها أمام العملاء مما يعزز فرص انتشارها ووصولها إلى درجة أعلى في سوق المنافسة. تقوم تقنية التصوير التجاري على عمل جلسات تصوير احترافية للمنتج أو الخدمة داخل الاستديو أو في مواقع خارجية بغرض الاستخدام التجاري والدعاية وزيادة وتوسيع نشاط الأعمال والمبيعات. بعد انتهاء العمل على الصور وتعديلها، يمكنك استخدامها في اللوحات الإعلانية الداخلية والخارجية، والنشرات، أو وسائل الإعلام المختلفة.

    تقدم باجل خدمات التصوير التجاري التالية:

    جلسات تصوير الشركات والموظفين وصناعة الهوية المؤسسية.

    تصوير المنتجات والخدمات باستوديوهاتنا باستخدام الكروما والمؤثرات الخاصة.

    تصوير المنتجات والخدمات بأماكنها الفعلية وتعديلها.

    تصوير المشروعات المختلفة.
    التصوير الفوتوغرافي

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. login with the American Express account. Join to know how to earn reward points and download our app to create a new account and more.
    paypal login
    primevideo/mytv
    amazon co uk code
    amazon.com/code
    primevideo/mytv

    ReplyDelete
  13. Amazon.com/code Prime is Amazon's paid subscription. It gives you unlimited access to many services, including fast delivery, unlimited streaming and exclusive deals. Unlimited streaming of TV shows and movies is available to Prime subscribers. Amazon Instant Video offers most of its content free of charge.Amazon Prime Membership. amazon code
    amazon.com/code
    amazon.com/us/code
    amazon.com/us/code

    ReplyDelete
  14. We already stated that you don’t need any additional contraptions to be successful.target gift card balance
    amazon mytv
    amazon com mytv

    ReplyDelete
  15. Bolches y tibios yarboclos pa todos

    ReplyDelete