From: Remyamol R on
Want to detect the moving objects from a vdeo sequence.Here i am using an algorithm to detect the object. In this algorithm ,do connected component labeling to remove the connected components that are too small. Last step of this algorithm is to get the smallest rectangles containing the moving objects. I want to draw the rectangle over the moving objects in video frames. How can we locate the moving objects in video frames? Please help me?

cc=bwconncomp(b,conn);
[labeled,numObjects] = bwlabel(bw,4); %to get total no.of objects
max(labeled(:));
s=regionprops(cc,'basic');
bw2=ismember(L,find([s.Area]>=p)); % to remove small objects
s.Area;
for i=1:numObjects
rectangle('Position',[15,152,50,60],'EdgeColor','white');
end
From: gReen on
"Remyamol R" <remyaremesan(a)yahoo.com> wrote in message <hn4sft$dgf$1(a)fred.mathworks.com>...
> Want to detect the moving objects from a vdeo sequence.Here i am using an algorithm to detect the object. In this algorithm ,do connected component labeling to remove the connected components that are too small. Last step of this algorithm is to get the smallest rectangles containing the moving objects. I want to draw the rectangle over the moving objects in video frames. How can we locate the moving objects in video frames? Please help me?
>
> cc=bwconncomp(b,conn);
> [labeled,numObjects] = bwlabel(bw,4); %to get total no.of objects
> max(labeled(:));
> s=regionprops(cc,'basic');
> bw2=ismember(L,find([s.Area]>=p)); % to remove small objects
> s.Area;
> for i=1:numObjects
> rectangle('Position',[15,152,50,60],'EdgeColor','white');
> end

figure,imshow(bw2);
hold on;
plot(rectangle('Position',[15,152,50,60],'EdgeColor','g','LineWidth', 2));
hold off;
From: ImageAnalyst on
Remyamol R:
To do "remove the connected components that are too small." you can
use bwareaopen().

To do "Last step of this algorithm is to get the smallest rectangles
containing the moving objects." just use the BoundingBox measurement
made by regionprops().

To do "draw the rectangle over the moving objects in video frames."
use the plot() function.

When you say "How can we locate the moving objects in video frames?"
I'm totally confused. I thought you said that you were already doing
connected components labeling, which requires that you have already
located the objects. The objects are the foreground in your (badly
named) "b" and "bw" images (I'm not sure why you have two and what the
difference between them is). So why are you asking how to do this
when you've already done it???