Skip to main content
. 2017 Nov 29;17(12):2757. doi: 10.3390/s17122757
Algorithm 1 Standing-pigs detection algorithm
Input: Depth Image
Output: Detected Image
Step 1:
  • While moving noise remaining
  • Apply spatiotemporal interpolation;
  • Subtract Ibackground with Iinterpolate;
Step 2:
  • If widths of undefined values 2:
  • Determine as an outline;
  • Else:
  • Determine as a noise and remove it on the area;
Step 3:
  • If threshold1 subtracted pixel value threshold2:
  • Determine as candidates for standing-pigs;
  • Else:
  • Determine as a noise and remove it on the area;
  • Detect edges of candidates;
Step 4:
  • Overlap Iedge into Ioutline;
  • If outline and edge on the same area:
  •  Determine as an outline;
  • Else:
  •  Determine as a noise and remove it on the area;
Step 5:
  • Merge Ioverlap with Icandidate;
  • If candidate pigs touch outlines:
  • Detect standing-pigs;
  • Else:
  • Determine as a noise and remove it on the area;