% p-code
def marked connected component as markedCC
def connected_component as CC
function markedCCs = markCCs(image,thresholds)
for every CC in image
markedCCs = markedCCs + shape_filter(every CC,thresholds)
end
function return = shape_filter(every CC,thresholds)
if shape/area... of CC satisfy thresholds(with combination)
return = every CC or [] % depend on if want to keep or eliminate
end
end
end
shape/area... of CC satisfy thresholds(combination) is the only part need to define