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



  • Hello together

    By this you can avoid the loop.

    I see no reason why a loop needs to be avoided.
    In case of difficulties implementing a loop do not hesitate to contact me.
    A loop is not dangerous or difficult.


    Best regards,

    B "Looping Louie" Ru ;-)

    Björn Rudde
    Field Application Engineer
    - Basler AG / Silicon-Software GmbH
    chat

    please press :) if post above is usefull

  • Dear Michul,


    When I look at you image:


    pasted-from-clipboard.png

    Here's typical image used in my application.

    I see only one object. Please correct me if there can be multiple object of interest.

    In case of multiple objects a classification is possible.


    A single* Object can be handled as single data-struct within a small 2D image.
    I would recommend to avoid 0D-Stream due to simulation limitations.


    *) a limited amound can be handled, too.

    Best regards,

    Björn Rudde
    Field Application Engineer
    - Basler AG / Silicon-Software GmbH
    chat

    please press :) if post above is usefull

  • Dear MichKul,

    Technically only one object should be visible after threshold.

    Since there is only one object to focus on, its storage within a 2D image including the required object features is no problem using ImageFiFo (FPGA block ram) until the next image arrives in the VA processing chain.


    Best regards,

    Björn Rudde
    Field Application Engineer
    - Basler AG / Silicon-Software GmbH
    chat

    please press :) if post above is usefull

  • Dear MichKul,


    Based on the previous modifications of S.We I added a valid list handling in case of empty object list, and reduced the kept object to a single one for comparison.
    Area and COG X Y differences are send to the DMA now.


    Enjoy ;-)
    Blob_meIV-CL_modSWe_BRudde.va <- Register is not set to Frame-Mode (that is the mistake)

    Version in the post below is fixed ...

    Best regards,

    Björn Rudde
    Field Application Engineer
    - Basler AG / Silicon-Software GmbH
    chat

    please press :) if post above is usefull