| Home Introduction User's Guide Download

| detect_mov_region: |  |

| NAME detect_mov_region - remove those still regions from the regionlink according to the result of the modified temporal differencing. SYNOPSIS newregionlink = detect_mov_region (regionlink, img1, img2, thre, proportion) PARAMETERS
regionlink The link for storing the information of the regions.
img1,img2M〜N〜3 matrix for ture color image
thre Threshold for temporal differencing(0-255 for windows, 0-1 for linux).
proportion Threshold for the proportion of the moving pixel to the area of the
region, named the moving coefficient.
newregionlink The link for storing the information of the moving regions.

DISCRIPTION
Function detect_mov_region removes those still regions from the regionlink according to the result of the modified temporal differencing (More details in Developer's Guide).

Then the newregionlink is supposed to contain those moving regions only.

EXAMPLE

//detecting the moving maritme objects demo
initial_dir = PWD;
chdir (VIPDIR + 'videos');
szFile = ｀ship.avi';
newFile = ｀ship_detect.avi';
pfi = OpenAviFile(szFile);
if pfi <> []
new_ppavi = CreateAviFile(newFile, 200, pfi(3), pfi(4),pfi(7),pfi(8));
if new_ppavi <> []
for i=100:299
im=AviReadFrame(pfi,i);
im2 = imresize(im,0.5);
grayimg = guassMask(im2,2);
edgeimg = edge(grayimg,'sobel',0.1);
dilimg = dilate(edgeimg);
regionlink = DetectRegion(dilimg,0.5,3,3,30);
oldframe = forframe(im,5);
regionlink=detect_mov_region (regionlink,oldframe,im,5,1/30);
color=[255,0,0];
im=draw_region(im,regionlink,color);
AviWriteFrame(new_ppavi, im);
new_ppavi(6)=new_ppavi(6)+1;
data=[];
end
AviWriteEnd(new_ppavi)
end
AviReadEnd(pfi);
end
chdir(initial_dir);

See also

OpenAviFile, AviReadFrame, AviReadEnd, CreateAviFile, AviWriteFrame, AviWriteEnd, imresize, guassMask, edge, dilate, DetectRegion, draw_region.

back

Entry
Home Introduction User's Guide
Function Reference
SIP Functions New Image Func Video Functions
Developer's Guide
Graphical Display Video Processing Modified Functions GUI
Demo
Image Processing Video Processing
Support
Future Work Known Bugs FAQ Acknowledgement About Us

|  |  | About Us | Contact Us | Our University Copyright © 2004-2005 Scilab group of Xiamen University, China |  |