Smoothing outer circular portion of image

조회 수: 4 (최근 30일)
mona
mona 2014년 1월 13일
댓글: Image Analyst 2014년 1월 14일
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)

답변 (1개)

Image Analyst
Image Analyst 2014년 1월 13일
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
mona
mona 2014년 1월 14일
Pardon my ignorance but I'm basically trying to run this code and wanted information for the one below. How could I modify Fs and t so as to adapt to the image itself? Please help! This is the last part and I have kind of no knowledge related to it
M = load_image(name, []); M = rescale(crop(M,n));clf; imageplot(M);
Fs = 1500; t = (0:100-1)'/Fs;
sinwave = sin(2*pi*15*t); w = window(@flattopwin, 100); sinwin = sinwave .* w; plot(sinwin)
Image Analyst
Image Analyst 2014년 1월 14일
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?

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by