How to set the particular pixel value for a sequence of images?

  • Dear All,


    I have an applet which generates images of dimension 28 x 1 with bit width 1. Now my objective is that if any of the pixels in an image has value 1 then I need to set the particular pixel index's value to 1 for the next 10 images. For instance, in an image if a pixel at index 3 has a value 1 then every 3rd pixel of the consecutive 10 frames should be set as 1. And If a particular pixel has a value 1 in subsequent images then counter of 10 has to be restarted for each image.


    Please refer the attached applet and suggest if any changes required on the design? or notify me if there is any operator that could achieve this!


    Sample_v1.0.va


    Thanks,

    Jayasuriya

  • Hi Jayasuriya

    the attached VA design should solve your task.

    It generates a random pattern representing your input images. Next all small images are appended to a single image of infinite height i.e. 1D image. Now we can check if one of the pixel in the same column of the last 10 rows was 1 and output 1.


    To simulate the design you need to set the simulation cycles to 100 which is the same value as in SetToSequence_To1D_LinesToSimulate.


    pasted-from-clipboard.png

    pasted-from-clipboard.png


    BR

    Johannes

    Files


    Johannes Trein
    Group Leader R&D
    frame grabber

    Basler AG



  • Hi Johannes,


    Yes the applet that you have provided is working well!. Lets consider a scenario like, " if i generate 200 images and it has a pixel with value 1 at the 100th row of it, then in simulation it will be separated as two images each of height 100 where in the first image only a pixel 1 occurs". Here I want to set that particular pixel value to 1 for the next 10 images i.e from 101 to 110 lines of the 2nd image in the simulation , but in the output I get pixel value 1 at the 100 th row only. Could you please give me a solution where this SetToSequence works even between set of images?


    Thanks,

    Jayasuriya

  • Hi Jayasuriya


    Yes the applet that you have provided is working well!. Lets consider a scenario like, " if i generate 200 images and it has a pixel with value 1 at the 100th row of it, then in simulation it will be separated as two images each of height 100 where in the first image only a pixel 1 occurs". Here I want to set that particular pixel value to 1 for the next 10 images i.e from 101 to 110 lines of the 2nd image in the simulation , but in the output I get pixel value 1 at the 100 th row only. Could you please give me a solution where this SetToSequence works even between set of images?

    It will work correct in hardware. In the simulation the 1D protocoll is considered as 2D images. Therefore, if you want to simulate a sequence of 200 frames you need to set SetToSequence_To1D_LinesToSimulate = 200 to get a single 1D image.


    I like to mention one more thing: If the number of past images is much more than 10 or dynamic you should consider a loop operation. Check the rolling average examples in the VA documentation for this.


    Johannes


    Johannes Trein
    Group Leader R&D
    frame grabber

    Basler AG