SelectROI strange behaviour

  • Hello,


    I have a very basic design ending with a Select_ROI just before the DMA output.
    This is for a camera of max size 2336x1728, so the links max dimensions are set to 2336x1728
    Usually, everything works well. On the software size, I always allocate buffers of size 2336x1728 for the acquisition image FIFO (even when using ROIs, see below)

    If I set a ROI on the CAMERA, let's say 1184x1728, and also modify the FG_WIDTH of the applet to 1184, it still works. Even if the Select_ROI is still configured at 2336x1728.
    But If I go down from 1184 to 1152 (sill inthe camera and FG_WIDTH), strange behaviour occurs and the image seems corrupted. To fix it, I have to also set the Select_ROI width to 1152.


    I notice that 1152 is just below the half width of 2336, so something happens there.

    Any clue ?


    Here are screenshots of correct image at 1184x1728 and corrupted at 1152x1728
    MC4086-1.png


    MC4086-1.pngMC4086-1-2.png

  • Hi Pierre


    I've been reading your post several times now but still don't have the one answer. Let me explain the behavior of Select_ROI

    - if the input image width is larger than the defined offset + width the operator will cut the ROI

    - if the input image width is smaller the operator will not extend the width and will pass the data to the output

    - if you select an offset or width which cannot be divided by the used parallelism the operator has to add dummy pixel to the end of each line.


    You wrote: "... and also modify the FG_WIDTH ..."

    In a VisualApplets applet you don't have FG_WIDTH. You can define

    - all operators changing the width like ImageBuffer and Select_ROI

    - describe the DMA output image size which is used for PC buffer allocation and display window size.

    So please let me know what you mean by FG_WIDTH.


    On a DMA transfer the line length information is not included. So the PC cannot know if the lines have a width of 1184 or 1152. It simply needs to match with the settings.

    If you have a mismatch it looks like in your attached image. From the image we can see that the display size does not correspond to the transfer size. There are some pixel which are shifted to the next lines as there are to many pixel or are shifted to the previous line as some pixel are missing.


    Can you see the problem in the VisualApplets simulation.


    Could you add your VA design so I can have a look at it. Or an extract?


    Johannes


    Johannes Trein
    Teamleader Applications and Development
    SiliconSoftware GmbH
    https://silicon.software/wp-content/uploads/siso-logo-animation.gif



  • Hi, sorry for the delay.

    A few more details :
    -for my tests, I always used a zero offset of the ROI, so there is at least no start alignment problem

    -"please let me know what you mean by FG_WIDTH" : actually you are right, my applets do not have a FG_WIDTH parameter. But my software has a generic behaviour which queries FG_WIDTH and FG_HEIGHT presence and modify them when possible, so that it works with standard applets as well. But you are right, this is not releveant for the current problem.
    -"If you have a mismatch it looks like in your attached image" : we agree that it looks like an alignment problem, I am just puzzled that it occurs at a width of 1152 and not 1184, because if there was a misalignment, it should occur in both cases.
    -I can't see the problem in VA simulation.

    See screenshot below. The Select_ROI is set to 2336x1728, while the image is 1140x1728 (I cannot use 1152 because of x20 parallelism)strange-roi.PNG

  • Hi Pierre


    if you use the VisualApplets simulation the program will display the correct image width. So please check the simulation output image width and verify that you are using the same setting for the display size.


    Now that you have shown a screenshot of the VA design I can see that you are using a parallelism of 20.


    From your information I can guess the following parameters:


    - Camera ROI width 1184

    --> Applet camera operator will extend this to 1200

    - Defined ROI in both ImageBuffer operators: 1200 (as 1184 is not possible)

    SelectROI XLength: 1184

    -> Select ROI will cut 1184 pixel. As the output parallelism is 20 the lines are extended by dummy pixel to 1200

    -> DMA buffer image width = 1200


    For 1152 you need to set the ImageBuffer to 1160 what also will be tha DMA buffer image width.


    Maybe you use different settings in ImageBuffer?


    Why are you using SelectROI anyway? It is only reasonable to use it if you put a PARALLELdn operator in front of it.


    Both of the screenshots do not show a multiple of 20.


    I can only further assist if you attach the VA design and the images as well as a full documentation of all settings.


    Johannes


    Johannes Trein
    Teamleader Applications and Development
    SiliconSoftware GmbH
    https://silicon.software/wp-content/uploads/siso-logo-animation.gif