Storing blob data from previous frame

  • Hi,

    I need to calculate speed of a moving object detected through 2D blob analisys. In order to do that I need to store information about center of gravity from previous and current frame. My idea was to insert blank data before first frame, so for subsequent frames I would get data from both current and previous fram. That allowed me to subtract previous position from current position. Thing is that causes synchronization issues which I'm unable to fix, using SYNC block with FIFO doesn't really help.

    I attached my example VA.

  • Hey Mich,


    will there only be one blob per Frame?


    In this case it might be an Option to use a Register-Operator and send the current value back with an TXImageLink. Just thinking...I am not from Siso so don't blame them if that isn't working ;-)


    Regards,

    Theo

  • Hey Mich,


    I did some changes to your design. It should work now. You created yourself a deadlock with "InsertImage". To fix that "CreateBlankImage" is used to create an independent input for the dummy values. The loop now calculates the X- and Y-Difference in parallel, as I moved it to a kernel.


    Do you use blob analysis more often in your Applications? I have a question online here, too - maybe you could help me with that? Link: BLOB-Features


    If you have further questions: don't hesitate asking :)


    Thanks and Greetings

    Simon

  • Thank you!

    In my opinion, you should do some preprocessing (Maybe a Closing) to make sure, you pass only one (and the right!) Blob to the subtraction loop. You could select the right blob based on some other parameters, like area or bounding box, too.


    Besides that, the design should work.


    Greetings

    Simon

  • Hi Michi


    I suggest to cast your CoG result into a 0D stream and use PixelNeighbor operator to compare the current and previous values. PixelNeighbor operator acts like a shift register chain. By this you can avoid the loop.


    Johannes

    Johannes Trein
    Teamleader Applications and Development
    SiliconSoftware GmbH
    siso-logo-animation2_2.gif