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