Smoothing outer circular portion of image
2 views (last 30 days)
Show older comments
Hello guys,
I am working on iris detection in which I am interested in obtaining only the of the central circular portion of the image and blur the image from boundary to certain point circularly. Could you please help me in getting the rest of the code correct. I guess there's something wrong in x from the beginning.
x = 10; filter = ones(x,x); filter = sin(????); image=fft2(image.*filter)
0 Comments
Answers (1)
Image Analyst
on 13 Jan 2014
Lots wrong with this. First off, don't use image as the name of a variable since it's a built-in function.
Secondly you need to create a circular mask - see the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F. You may want to create two and subtract them to create a ring if you just want to blue the boundary between the iris and the white.
Next, you don't need to do anything with Fourier. Simply do it in the spatial domain:
windowWidth = 15;
kernel = windowWidth(windowWidth , windowWidth) / windowWidth ^ 2;
blurredImage = imfilter(grayImage, kernel);
% Then assign blurred pixels to your binary mask.
outputImage = grayImage; % Initialize
outputImage(binaryImage) = blurredImage(binaryImage);
5 Comments
Image Analyst
on 14 Jan 2014
This sounds like a totally different question. One I can't answer because I don't know what those functions are: load_image(), rescale(), window(), flattopwin().
It's not hard to do what you asked first. Just define a binary image somehow - either find the iris somehow, such as imfindcircle() or color segmentation or draw it manually with imellipse - then create a mask to define the parts you want blurred or not, then use the code I gave you.
Why don't you upload an image where you've indicated, with colored lines, what part of the image you want blurred?
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!