ind=isinsideEL(EL)
EL : | Edge list |
ind : | index of the inside edges |
find outer contour
ind=isinsideEL(EL);
EL(ind,:) % contains all internal edges
EL(~ind),:) % contains all external edges
This function, isinsideEL
, is designed to identify edges in a given edge list that exist in both directions, effectively determining internal edges.
The function uses the following steps to determine internal edges:
fliplr
function to the edge list EL
. This function flips the order of elements in each row, effectively reversing the direction of each edge.ismember
function with the 'rows' option to compare the original edge list EL
with its reversed version. This checks for each edge in EL
if its reverse also exists in the list.ind
, where each element is true
if the corresponding edge in EL
is internal (exists in both directions) and false
otherwise.To find the outer contour of a shape represented by the edge list EL
, you can use the function as follows:
ind = isinsideEL(EL); internalEdges = EL(ind, :); % Contains all internal edges externalEdges = EL(~ind, :); % Contains all external edges
This example demonstrates how to separate internal and external edges using the logical index array ind
.