I am implementing an iris recognition system in matlab and have performed the following steps according to an algorithm proposed in a paper

  1. Initial image

    enter image description here

  2. Median filtering

  3. For each row in the filtered image, assign a value of one to the pixels that have the minimum value in that row and the other pixels to zero

  4. Again median filtering to remove white spots here and there.

  5. States that: Get the row and column that has maximum number of ones. Then find the center (xo, yo) and the radii (rx, ry) as follows: xo = the index of this column, yo = the index of this row, rx = the number of ones in this row/2, ry = the number of ones in this column/2

My question is how do i do step 5 in MATLAB?

  • $\begingroup$ Which part are you having difficulty with implementing in MATLAB - just the part in bold (4), or the whole thing ? $\endgroup$
    – Paul R
    Jan 22 '12 at 17:06
  • $\begingroup$ Just the part 4 ! i have done the rest and this is only a part of the algorithm by the way $\endgroup$
    – vini
    Jan 22 '12 at 17:09
  • 1
    $\begingroup$ OK - you might want to edit the last sentence in your question to reflect this then. Also this seems to be more of a MATLAB programming question than a DSP question. $\endgroup$
    – Paul R
    Jan 22 '12 at 17:10

Given a matrix A that consists of zeros and ones only (which you should have after step 4 of your algorithm, you could implement step 5 via the following:

% find column with the maximum number of ones. sum down the rows of the
% matrix and find the column with the largest sum
[ry,xo] = max(sum(A));
% find the corresponding row; do the same thing except sum across the
% matrix's columns
[rx,yo] = max(sum(A,2));
% the values "rx" and "ry" above contain the sums of the row and column
% (respectively) that have the maximum number of ones. divide them by
% 2 according to your algorithm in step 5
rx = rx / 2;
ry = ry / 2;

After the above (which is untested), then xo, yo, rx, and ry should be populated with the values that your algorithm indicated.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.