Skip to content
Snippets Groups Projects
compute_area.m 250 B
Newer Older
  • Learn to ignore specific revisions
  • BehnazP's avatar
    BehnazP committed
    function area = compute_area(B)
    %COMPUTE_AREA   Area of the binarized object
    %   AREA = COMPUTE_AREA(B)
    
    Ax = B(2:end,:,:)~=B(1:end-1,:,:);
    Ay = B(:,2:end,:)~=B(:,1:end-1,:);
    Az = B(:,:,2:end)~=B(:,:,1:end-1);
    area = sum(Ax(:))+sum(Ay(:))+sum(Az(:));