Skip to content
Snippets Groups Projects
Select Git revision
  • dd63bc795301d50b052cc3c40025a1ce51596ef8
  • master default protected
  • bepi
3 results

compute_area.m

Blame
  • user avatar
    BehnazP authored
    dd63bc79
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    compute_area.m 250 B
    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(:));