Bokeh of image background

Source: Internet
Author: User

Background

In a photographic work, the background blur can be a good foil to the subject, but for some photographers, the large aperture is too expensive, telephoto lens use too much, the camera is too low in the hand ... Although the conditions are not enough, but also want to shoot the main body prominent, the background of the image of the blur, what should be done? Next, this article briefly introduces the steps of background blur.

Steps
    • Cutout to get the foreground area of the image
    • Use Gaussian blur on the background to get the layer
    • Overlay the original foreground area to the corresponding area of the layer from the second step
      Note: In the first step, you can use a lot of cutout algorithms that you can look for here.
      In the second step, it's best to use some edge-preserving blur filters, where I use domain Transform filter
      # #代码
%InputPhotographI= Imread (' Pencils.png ');I= Im2double (I); IR =I(:,:,1); IG =I(:,:,2); IB =I(:,:,3);% Joint ImageJ = Imread (' Pencils_joint_depth.png '); j = im2double (j); BW = IM2BW (J,0.5);%Depth-of-field examplessigma_s =Ten; sigma_r =0.2;% Edges superimposed. F_NC = NC (I, sigma_s, Sigma_r,3, J);%composition out= F_nc;outr = out(:,:,1); OUTG = out(:,:,2); OutB = out(:,:,3); OUTR (BW) = IR (BW), OUTG (BW) = IG (BW); OutB (BW) = IB (BW); out= Cat (3, OUTR,OUTG,OUTB);%ShowResults.figure, Imshow (I); Title' Input photograph '); figure, Imshow ( out); Title' Filtered photograph ');
Results

Read more

Http://www.g-photography.net/old/teach/news_693.html?g4
http://www.alphamatting.com/
http://www.inf.ufrgs.br/~eslgastal/DomainTransform/

Bokeh of image background

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.