|
Algorithm 1 Motion objects contour processing |
|
Input:—binary mask of objects in motion, —height and width of the image |
|
Output:—list of final objects in motion |
|
| 1: |
functionfilterMotionMasks () |
| 2: |
▹ min. contour area |
| 3: |
▹ max. contour area |
| 4: |
▹ min. distance for contour merging |
| 5: |
findContours() ▹ motion mask contours and object labeling |
| 6: |
filterContoursByArea(,,) ▹ filtering objects of extreme sizes |
| 7: |
mergeCloseContours(, ) ▹ merging close objects using |
|
Euclidean distance |
| 8: |
|
| 9: |
for do
|
| 10: |
convexHull(c) ▹ convex hulls of objects |
| 11: |
.append(c)
|
| 12: |
end for
|
| 13: |
return ▹ filtered moving objects |
| 14: |
end function |