loading
 
Blob Segmentation and Filtering : Human Targets
Bob from United States  [6 posts]
6 years
Hi, I have been using the movement module to track a single target. It is now my goal to track more than 1 target, starting first with 2 targets and then more. I want to generate COG values for each target identified. My targets are humans. I was reading here about using the blob filter, and needing to use a segmentation module prior to the blob filter module.

The movement module can separate the human targets from their background. As I have experienced so far, a human target is a group of small blobs in the shape of a human, and these blobs need to be connected  and filled to make one larger blob in the shape of a human.  Then the multiple human shaped blobs can be identified, labeled and analyzed.

Is the movement module the best way to find the moving blobs?

What is the most ideal segmentation module to connect the small blobs of each human target to make one larger blob for each human target with-out turning two targets into one?

Once the larger blobs are created, and there is an array of larger human shaped blobs, how do I use COG to track each one?

What happens when two or more targets overlap?

Thanks for any help that can be provided.

Bob
Anonymous 6 years
Bob,

The movement module is probably the best module to use to extract out moving object ... but it does have its limitations. The limitations are what the background is in comparison to the moving object. If the same color/texture is used then the module will fail to segment the movement from the background. The best solution in this case is if you can modify the background.

Typically the dilate (or close) module is used to connect blobs together but that is indiscriminate towards the shape of the underlying object.

If you use the Geometric Stats module and set it to individual blobs then you will have a COG_X and COG_Y array of all the blobs in the image.

When two or more targets overlap you have a problem. There are ways to work through that using analysis of merging or separating through multiple frames but it gets difficult. It depends on the final quality of information that you need as to how much effort you want to put into this.

If you have a couple example images or video we can look through that and see what we can help with. There is a lot more that can be done to improve the movement module but we're unlikely to do that without having examples to work with.

STeven.
Bob from United States  [6 posts] 6 years
STeven,

Thanks for your reply.  I have set things up as you suggested and can easily isolate the 1 or more targets (humans) to the same number of blobs.  That really helped me much.

My problem now is that I can't seem to grasp how to get the cogx and cogy for each target one at a time.  I am using the CScript extension and it seems that getArrayVariable would be the way to go.  I tried:

int blobs[20];
getArrayVariable("Blobs", blobs, 20);

but did not seem to succeed.  One of my if statements was :

if (blobs[0])....

and I never got past this.  I just wanted to be sure there was a target before I continued.

Part of my objective is to focus on a each blob for 2-3 seconds.

I attached the .robo and script I am using.  Video file is quite large, but we usually use live video anyway.
Bob from United States  [6 posts] 6 years
STeven,

Thanks for your reply.  I have set things up as you suggested and can easily isolate the 1 or more targets (humans) to the same number of blobs.  That really helped me much.

My problem now is that I can't seem to grasp how to get the cogx and cogy for each target one at a time.  I am using the CScript extension and it seems that getArrayVariable would be the way to go.  I tried:

int blobs[20];
getArrayVariable("Blobs", blobs, 20);

but did not seem to succeed.  One of my if statements was :

if (blobs[0])....

and I never got past this.  I just wanted to be sure there was a target before I continued.

Part of my objective is to focus on a each blob for 2-3 seconds.

I attached the .robo and script I am using.  Video file is quite large, but we usually use live video anyway.
Bob from United States  [6 posts] 6 years
STeven,

Thanks for your reply.  I have set things up as you suggested and can easily isolate the 1 or more targets (humans) to the same number of blobs.  That really helped me much.

My problem now is that I can't seem to grasp how to get the cogx and cogy for each target one at a time.  I am using the CScript extension and it seems that getArrayVariable would be the way to go.  I tried:

int blobs[20];
getArrayVariable("Blobs", blobs, 20);

but did not seem to succeed.  One of my if statements was :

if (blobs[0])....

and I never got past this.  I just wanted to be sure there was a target before I continued.

Part of my objective is to focus on a each blob for 2-3 seconds.

I attached the .robo and script I am using.  Video file is quite large, but we usually use live video anyway.

operate2.zip
program.robo
Bob from United States  [6 posts] 6 years
STeven,

Wow, sorry about those repeated posts.  I was attempting to attach something that could not be attached.  I didn't realize it was doing that.

Anyway, I think I figured out my problem above.  I have attached a new script and .robo with these changes.

My problem now is with opening a media reader module for using a WMV for my input.  The software crashes, or locks up for some reason that I cannot determine.  I insert the media reader module between the read variables module and the crop module, with the timeout set to 100 ms, and loop playback selected.  The media is located on the PC running the roborealm software.

My procedure is to load the .robo without the media reader module.  Then I add the media reader.  Sometimes it crashes even before I add the media file name.

Thanks,
Bob
operate2.zip
program.robo
Bob from United States  [6 posts] 6 years
I disable all the modules, and enable them one at a time. It appears to be a conflict between display circle and media reader.
Bob from United States  [6 posts] 6 years
The Problem Details are as follows:


Problem signature:
  Problem Event Name:    APPCRASH
  Application Name:    RoboRealm.exe
  Application Version:    2.37.7.0
  Application Timestamp:    4d9cdfa3
  Fault Module Name:    RoboRealm.exe
  Fault Module Version:    2.37.7.0
  Fault Module Timestamp:    4d9cdfa3
  Exception Code:    c0000005
  Exception Offset:    000b0db9
  OS Version:    6.1.7601.2.1.0.768.3
  Locale ID:    1033
  Additional Information 1:    74da
  Additional Information 2:    74daf4d679f88dca7d6e6a680ddcf2ee
  Additional Information 3:    a58f
  Additional Information 4:    a58f2ea03c0735df0ecbff41754ae103
Anonymous 6 years
Bob,

Any way that we can get that video file that you are attempting to load?

Also be sure that you are using the most recent version just in case something was fixed in this area.

Your script is a little wrong. The "blobs" array is not being generated (normally by the blob_Filter module) but the geo stats do generate cog_x and cog_y arrays. See the included text for a version that appears to work for us.

-----//-----------

int i;
int closed = 1800;
int open = 1500;
int hold = 20;
int release = 10;
int target_time = hold + release;
int cogx[20];
int cogy[20];
int max = getArrayVariable("COG_X", cogx, 20);
getArrayVariable("COG_Y", cogy, 20);
    
if ((getVariable("Script_Count") < 2)||(i>=max))
{
    i = 0;
}
    
int mx = ((getVariable("Crop_X_End") - getVariable("Crop_X_Start"))/2);
int my = ((getVariable("Crop_Y_End") - getVariable("Crop_Y_Start"))/2);
setVariable("Image_Center_X", mx);
setVariable("Image_Center_Y", my);    

if (cogx[0])
{
    setVariable("Timer", getVariable("Timer") + 1);
    if (getVariable("Timer") < target_time)
    {
        setVariable("SERVO_VALUE_X",(getVariable("Servo_Center_X") - 1.3*((cogx[i] - mx))));
        setVariable("SERVO_VALUE_Y",(getVariable("Servo_Center_Y") + 1.3*((cogy[i] - my))));

        if (getVariable("Timer") < hold)
            setVariable("SERVO_VALUE_Z", closed);
        if (getVariable("Timer") > hold)
            setVariable("SERVO_VALUE_Z", open);

    }
    else
    {
        setVariable("Timer", 0);    
        i++;
    }
}
else
{
    setVariable("SERVO_VALUE_Z", open);
    setVariable("Timer", 0);
    i = 0;
}

-----//-----------

STeven.
Sheragin from Iran  [2 posts] 6 years
Hi guys,

I am also working on almost the same thing, however I need to count number of people who passes through a corridor lets say.

The problem that I am facing is tracking several people passing through the corridor or How can I assign a COG for each person ?

The modules that I'm using are: movment, dilate, and blob tracking.

Thanks in advance.
Anonymous 6 years
Sheragin,

Can you post a couple images from the corridor? Sounds like you are on the right direction and we'd need specific images in order to know what next steps to take. As a guess, you may be able to determine more than one individual based on the blob size or tracking when a blob breaks or merges.

Images would be helpful ...

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index