Flip the image horizontally without using RAM

  • Hi Jesse,

    I'm not sure, if I understood your problem correct, but for the design you put here I would offer you this optimized Version:

    1. From my understanding there is one buffer redundant and can be simply left out.

    2. For the SelectROI you can as well use the H-Box I put there. In this H-Box all lines except for the one you spezified with Y_Offset are removed. Usually that is a more efficient way if you only need an ROI in Y direction since the Operator needs to take the X-direction in account as well and therefor needs more ressources.

    In the modified File I put there you will have a second process with my modifications.

    Does that help you or do you need something else?

    Best regards,


  • Hi Roeger

    At #2

    Yes. I want this design,but it can not work.

    And I check level 1 with mE5_MA_VCX-QP_Get_Last_Row_BSR.va.

    There is a error,please reference attachment (Error.PNG).

    My visual applets version is 3.1.0.

    At #3

    When I use a "M" or "P" type applet with synchronization .

    How can I calculate the buffer or FIFO size?

    In this case, why LineBuffer need to add after module28?

    Why the source image need add a RAM?

    Before I post this thread.

    I used guess to add RAM0.


    The applications I need are in the attachment.(mE5_VCX-QP_Single_Project_X.va)

    When I flip a image with the synchronization ,it will use 1 or 2 RAM.

    The board just has four RAM and I use five RAM in the process.

    So I want to reduce the RAM ,when I flip a image with the synchronization.



  • Hi Jesse,

    first thing, the Error. Simply remove the "RefYOffset" operator. This operator is not essential, it just makes the handling easier.

    This operator is part of the VisualApplets Parametertranslations library, This Library allows you to build an interface for you. So the customer can get a defined interface and do not have to care that much about how thigs are done in the H-Box.

    This library requires a licence that you don't have at the moment.

    You will get the same result by writing the value you wrote to Y_Offset to get_last_line/YOffsetCmp.Number.

    As for your second question:


    When I use a "M" or "P" type applet with synchronization .

    How can I calculate the buffer or FIFO size?

    In this case, why LineBuffer need to add after module28?

    Why the source image need add a RAM?

    Let me first say something on the Why do I need a Buffer.

    Buffer are always used to store data I want to use at a moment in time later. So for the source image that means you need to store all lines ahead of the line that you want to process in the second path. If you do not do that these lines are lost when you need them.

    So thumb rule: You need a buffer when ever there can be a situation that one path need to wait for results from another path/operator.

    (That's why you always need at least one buffer or Fifo. The DMA-Operator is unpredictable in the timing how long transfers need, since it depends on the system or work load.)

    As for the LineBuffer: It is needed because the image data from the Camera operator is an "infinite source". this means you can not stop it. Sometimes processing needs more time than just one clock cycle. In this case the processing path ahead of this module is paused for a while. This can not be done if the source is an "infinite source", since it can not be stoped.

    This is where the Fifo helps. It buffers incoming pixel in case there is a pause signal from one of the processing units after this.

    How to calculate the size? That's a tricky question. You need to consider your image pipeline.

    "What is the worst case that can happen?"

    I set the buffer to 1 Line, because there will be maximum 1 line that is stored. So even if the PC is not taking the Data in time and the calculation later in the pipe might be too slow there wont be any data loss.

    This is actually more than needed. Typically you wont pause that long. I think some pixel also would do.

    I hope that makes it a bit clearer.

    Best regards,


  • Hi again,

    I looked at your design. I have some hints for you:

    1. Try to avoid a parallel down ahead of your buffer. You may start with parallelism of 8 at your SingleCamera operator and remove the To8P operator. If you use parallel down at a faster input without buffering you will lose data.

    2. You may use the same construct as I provided in my second example. For that, remove the Buffer(RAM) from Capture. Than add a Fifo with 1 Line in EdgexFilters after Projection_V. This fifo and RAM1 need to be set to infiniteSource enabled than.

    3. I'm not sure if you need SYNC3 in EdgexFilters. It is only needed if the images on the different links have different sizes.

    I hope this will help you with the design.

    Best regards,


  • Hi Roeger

    Thank you for your explanation.

    Now I already know why this design needs to add buffer.

    In the second project.

    I will change the CXPSingleCamera to CXPDualCamera.The CXPDualCamera minimal parallelism is 12.So set the parallelism to 16 for test .And reduce the parallelism to 8 because lookuptable is not enough.This project has not been completed yet.

    Now the amount of RAM is enough.:)

    Remove the SYNC3 will appear warning.

    And thank you for your suggestion.