how to select save line data

  • I want to realize the following functions. Please help me.

    Image data input: 8K black and white line scan camera.

    1: Detect the average gray value of each input line of image. If the average gray value is less than 20, go to step 2. If the average gray value is greater than 20, go to step 3

    2: Receive three consecutive lines of image data (including this line of image data), and then go to step 1 (re detect the line gray value).

    3: Delete this line of image, and then go to step 1 (re detect the gray value)

    For example:

    If the average gray value of the first line of image is detected to be 40 (greater than 20), the image data of this line will be deleted.

    If it is detected that the average gray value of the image in the second row is 10 (less than 20), three rows of image data will be received continuously (receiving the second row, the third row, and the fourth row).

    Detect the gray value of the fifth row of image data

  • Dear pangfengjiang,

    The data will come into your design based on a stream, so there is no need to "jump" to a specific row, it will come through the link line by line. If you want to remove a specific line you should use the operator RemoveLine. Since both inputs of RemoveLine need to be synchronous to each other you should sum the the average gray value by using RowSum. Since only the last line-pixel of RowSum -output will represent the not normalized average value - sum of all line pixels - a RemovePixel needs to be used to get the focus to the result. With an additional SYNC you can controll the RemoveLine. Both inputs of RemoveLine/Pixel need to be in sync. Independent of the text, the design below will show all details and OPs:


    VA Design :

    Since the line length is known the sum does not need to get divided, it can be used "un-normalized".

    Best regards,

  • Dear pangfengjiang,

    please find attached a design idea.

    In this design the line average is calculated. Using operator ReSync to Line the average result of the last pixel of the line is attached to the same line. This value is compared to a threshold value. If the condition is fulfilled the line is kept otherwise it is deleted using operator RemoveLine.

    You may add additional conditions in the example to remove the line, for example: Do not remove the current line, even if the value is below the threshold , if the value in the previous line fullfills the condition....

  • Thank you for your answer

    But this is not what I want. What I want is to receive three consecutive rows of data after detecting that the average value of a row is less than 20 (these rows are received directly without detecting the average value of the row). The average value of the fourth line in the detection line. If the detected row does not meet the average value less than 20, delete the current row, and then detect the average value of the next row.

  • HI pangfengjiang,

    Thank you for reaching out. I will discuss this internally, and will come back asap.

    Please be aware, that this forum is not for giving full solutions to specific problems. It is for giving pointers and helping to understand tricky situations. Similiar to Stack Overflow.

    We offer trainings and full implementation as a service, but as mentioned above I will discuss this internally.

    Best Regards,