how can i blur the background?
4 ビュー (過去 30 日間)
古いコメントを表示
Hello, I want to blur the background not the man. please help as soon as possible.
1 件のコメント
Walter Roberson
2024 年 5 月 3 日
Note that in the general case, it is impossible for a program to automatically select which part of the image is "background" and which part is "foreground".
Consider the images produced by SOHO, the solar observatory. The images are primarily intended for observing the Sun, in which case you ignore everything outside of the solar disk. But if you take the same images and mask out the solar disk then you can observe objects moving close to the solar disk -- comets!
So in one case you ignore everything outside of the solar disk, and in the other case you ignore the solar disk, and so using the same image you can get two different purposes. The foreground for one purpose is the background for the other purpose.
Therefore it is impossible to automatically select foreground versus background: the "noise" for one purpose might easily be the "signal" for a different purpose.
回答 (2 件)
DGM
2024 年 5 月 3 日
There are several answers already. Here's the latest one. See the links therein.
0 件のコメント
Image Analyst
2024 年 5 月 3 日
You can try the foreground detector in the Computer Vision Toolbox.
help foregrounddetector
I have no idea how will its algorithm will work for your particular image(s).
Otherwise you can manually trace the foreground with drawfreehand to make a mask. Then blur the entire image and assign the blurred pixels inside the mask to the original unblurred image. Like for once you have the mask:
h = ones(15);
filteredRGB = imfilter(originalRGB, h);
[r,g,b] = imsplit(rgbImage);
[rf, gf, bf] = imsplit(filteredRGB);
r(mask) = rf(mask);
g(mask) = gf(mask);
b(mask) = bf(mask);
outputImage = cat(3, r, g, b);
See attached drawing demos for creating and masking images.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!