Research Article
An Improved Mixture-of-Gaussians Background Model with Frame Difference and Blob Tracking in Video Stream
Algorithm 1
Pseudocode for sole blob extraction.
Initialization: the first white pixel , as the point of image data. | (1) leftmost = ; | while < width of image and | foreground or foreground) | add 1 | end while | rightmost = ; | (2) flag = 1; //searching line by line from leftmost to rightmost //until no white pixel exists | while < height and flag = 1 | flag = 0; | for from leftmost to rightmost | if width of image and | foreground or | foreground) | flag = 1; | end if | end for | m = leftmost; | while and foreground or | foreground) | Flag = 1; | minus 1; | end while | update leftmost position | m = rightmost; | while < width of image and | foreground or | foreground) | flag = 1; | add 1; | end while | update rightmost position | if new rightmost > rightmost + 2 | search upward line by line until no white | pixel exist; | if new leftmost < leftmost − 2 | search upward by line until no white pixel exist; | add 1 | end while |
|