set the outside pixel values into zero.

3 ビュー (過去 30 日間)
khaleed james
khaleed james 2016 年 3 月 1 日
回答済み: Image Analyst 2016 年 3 月 1 日
hi, im doing a iris recognition. After iris circle (iris region) detection, i need an automatic cropping or masking method to mask the regions other than iris. and i found one of the method is to set the outside pixel. how to set the outside pixel values into zero or any others method how to extract the iris region?

回答 (2 件)

Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 3 月 1 日

Image Analyst
Image Analyst 2016 年 3 月 1 日
It looks like you already have coordinates for a circle. So just pass those in to poly2mask to create a mask. Then use it as logical indexes to zero out that part.
% Create mask from circle coordinates.
[rows, columns, numColorChannels] = size(grayImage);
irisMask = poly2mask(x, y, rows, columns);
% Mask outside the circle to black, 0.
grayImage(~irisMask) = 0;
After that you want to "extract the region". Exactly what does that mean? Do you want the mean inside the iris? Do you want to create a new smaller image by cropping the iris portion? By the way, it's not necessary to blacken the image outside the iris to do either of those.

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by