fspecial -Disk filter -Algorithm
이전 댓글 표시
I'm trying to understand how matlab creates its disk filter function. In a continuous domain, a disk is just 1 inside some radius and 0 outside that radius.
The tricky part about making the disk function with an image is that the edge pixels may be partially inside the disk and partially outside the disk. It appears that the matlab function assigns the edge pixels a value equal to the area of the pixel contained in the disk.
I've been trying to derive the algorithm for how one would do that, but it seems that this isn't straight forward. Is there a paper or textbook detailing how to create the disk function seen in the fspecial function? Is this problem much easier than I think it is?
답변 (1개)
Image Analyst
2014년 9월 19일
1 개 추천
Because it's a digital computer, the circle has to be digitized/quantized. See the FAQ for an algorithm: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F
댓글 수: 7
Nicholas
2014년 9월 19일
Image Analyst
2014년 9월 19일
As far as I know bwarea() is the only image processing function that takes into account possible non-digitized nature of the underlying image.
Perhaps you can attach an image to illustrate what you mean. Mock something up in Photoshop of you have to.
Nicholas
2014년 9월 22일
Nicholas
2014년 9월 22일
Image Analyst
2014년 9월 22일
You can see the algorithm by bringing fspecial up in the editor:
>> edit fspecial
Nicholas
2014년 9월 23일
Image Analyst
2014년 9월 23일
It probably is a typical anti-aliasing routine where you "feather" the edges according to how much of the square tile circle would be taken up by a perfect circle. So if the circle would cover 30% of the square, it will have 30% of the solid, interior value.
카테고리
도움말 센터 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
