A parallel color difference correction system, a serial color difference correction system, a method and a medium

By using a parallel FIFO buffer queue and a data selector, combined with a linear interpolation model, the resource consumption problem caused by the large number of FIFOs in existing technologies is solved, thereby improving system scalability while reducing BRAM resource consumption.

CN120821686BActive Publication Date: 2026-03-03HEFEI I TEK OPTOELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511342466.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2026-03-03
Estimated Expiration
2045-09-19

AI Technical Summary

Technical Problem

Existing image row data caching methods are inefficient in terms of resource utilization, resulting in a large number of FIFOs, consuming more BRAM resources, increasing cost and power consumption, and affecting the scalability of image processing algorithms.

Method used

Parallel FIFO buffer queues and data selectors are used, and missing color components are calculated through a linear interpolation model, reducing the number of FIFO buffers and lowering BRAM resource consumption.

Benefits of technology

With the same buffer FIFO resources, the system can meet the requirements of different objects' relative motion speed to the camera and the camera's line frequency ratio, reduce the number of buffer FIFOs, reduce power consumption and cost, and improve system scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120821686B_ABST
    Figure CN120821686B_ABST
Patent Text Reader

Abstract

The application discloses a parallel chromatic aberration correction system, a serial chromatic aberration correction system, a method and a medium, and the parallel chromatic aberration correction system obtains a data stream of parallel R, G and B pixel rows and comprises a data cache module, a data selector and a data correction module.The data cache module comprises a first FIFO cache queue for storing data of a first pixel row or a third pixel row and a second FIFO cache queue for storing data of a second pixel row; the data selector selects data of the first pixel row or the third pixel row to be input to the first FIFO cache queue; and the data correction module is used for acquiring a trigger pixel row, adopting a linear interpolation model and calculating two missing color components at the same position in the trigger pixel row.According to the ratio between the movement speed of an object relative to a camera and the line frequency of the camera, the number of required cache area FIFOs in each FIFO cache queue is determined, the number of cache area FIFOs is reduced, and the resources of BRAM are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology and relates to a parallel color difference correction system, a serial color difference correction system, a method, and a medium. Background Technology

[0002] With the rapid development of machine vision and image processing technologies, line-scan true-color cameras are increasingly widely used in industrial inspection, high-speed imaging, and real-time monitoring. These cameras typically output image data line by line, pixel by pixel. Figure 1 As shown, in high-speed detection applications, chromatic aberration occurs at image edges due to the mismatch between the object's motion speed and the camera's line frequency. To obtain true-color image information, multiple lines of image data need to be cached and aligned to complete subsequent color interpolation processing.

[0003] Existing technologies typically employ a first-in-first-out (FIFO) row cache architecture, such as... Figure 2 As shown, for a 3-line true-color camera with RGB pixel arrangement, when the number of pixels between RGB pixel rows (a=1) and the ratio between the object's relative speed to the camera's line frequency (N=0.5) are considered, if the position corresponding to the last pixel row is used as a reference to calculate the other two color components at that position, for a pixel row with a one-pixel gap, 8 rows of RGB data need to be delayed. Therefore, 8 rows of RGB data and the first two rows of image line data in the 9th RGB data need to be buffered, requiring 28 buffer FIFOs. During dispersion correction, image data from different rows are extracted from 26 buffer registers. In addition, to convert the serial data stream into parallel RGB data, the system also needs to add 2 serial-to-parallel conversion buffer FIFOs, thus requiring a total of 28 FIFO units.

[0004] Block RAM (BRAM) is a hardware storage resource inside an FPGA chip used to store data. First In First Out (FIFO) is commonly used for high-speed data caching, and within an FPGA, FIFOs are typically implemented based on BRAM. Using a large number of FIFO caches will consume significant BRAM resources, increasing cost and power consumption, and also affecting the scalability of image processing algorithms.

[0005] Therefore, existing image row data caching methods are significantly inefficient in terms of resource efficiency, and there is an urgent need for a new caching architecture that can reduce the number of FIFOs, reduce resource consumption, and improve system scalability. Summary of the Invention

[0006] The purpose of this invention is to overcome the above-mentioned problems existing in the prior art and to provide a parallel color difference correction system, a serial color difference correction system, a method, and a medium.

[0007] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution:

[0008] A parallel color difference correction system, applicable to any arrangement order of R, G, and B pixel rows, obtains parallel data streams of R, G, and B pixel rows, including:

[0009] The data caching module includes two parallel FIFO cache queues. The first FIFO cache queue stores the data of the first pixel row or the third pixel row, and the second FIFO cache queue stores the data of the second pixel row.

[0010] A data selector is used to select either the first pixel row or the third pixel row as input to the first FIFO buffer queue;

[0011] The data correction module is used to obtain the trigger pixel row and use a linear interpolation model to calculate the two missing color components at the same position in the trigger pixel row. The trigger pixel row is a pixel row data among the R, G, and B pixel rows that are not stored in the FIFO cache queue.

[0012] Specifically, based on the interval between the trigger pixel row and the pixel rows in the R, G, and B pixel rows, the delay amount of each pixel row is determined, so as to determine the number of FIFO buffers that need to be cascaded in each FIFO buffer queue.

[0013] Preferably, the FIFO buffer queue includes several cascaded FIFO buffers, which store image row data in a first-in-first-out (FIFO) order.

[0014] Preferably, the data selector selects data from the first pixel row or the third pixel row to be input into the first FIFO buffer queue according to the control signal;

[0015] The control signal is either the same as or opposite to the direction of the object's movement and the direction of the camera's scanning.

[0016] Preferably, the method for determining the number of cascaded buffer FIFOs in each FIFO buffer queue includes: calculating the delay amount for the two pixel rows excluding the trigger pixel row in the three pixel rows of R, G, and B, and filtering out the smallest integer not less than the delay amount as the required number of cascaded buffer FIFOs in each FIFO buffer queue.

[0017] A serial color difference correction system, applied to any of the systems described above, further includes a serial-to-parallel conversion module, wherein the data selector is located before the serial-to-parallel conversion module and is used to adjust the data of the first pixel row or the third pixel row to the first FIFO buffer queue according to the control signal.

[0018] The serial-to-parallel conversion module is used to process the data streams of the sequentially input R, G, and B pixel rows in parallel, so as to simultaneously output the data streams of the R, G, and B pixel rows to the data buffer module.

[0019] A parallel color difference correction method, applied to any of the systems described above, is applicable to any arrangement order of the R, G, and B pixel rows, obtaining parallel data streams of the R, G, and B pixel rows. The color difference correction method includes:

[0020] Obtain the data for the first pixel row, the second pixel row, and the third pixel row;

[0021] Select the data of the first or third pixel row to be stored in the FIFO buffer area connected in series in the first FIFO buffer queue, select the data of the second pixel row to be stored in the FIFO buffer area connected in series in the second FIFO buffer queue, calculate the missing color component at the same position in the trigger pixel row, wherein the trigger pixel row is a pixel row data of B, G, R pixel rows that are not stored in the FIFO buffer queue.

[0022] Specifically, based on the interval between the trigger pixel row and the pixel rows in the R, G, and B pixel rows, the delay amount of each pixel row is determined, so as to determine the number of FIFO buffers that need to be cascaded in each FIFO buffer queue.

[0023] Preferably, the number of buffer FIFOs required for pixel rows adjacent to the trigger pixel row is determined by the latency. Calculated; the number of buffer FIFOs required for a pixel row that is one pixel away from the trigger pixel row, using the latency. The calculations show that 'a' represents the number of pixels between rows of RGB pixels, and 'N' represents the ratio between the object's speed relative to the camera and the camera's line frequency.

[0024] Preferably, the calculation of the missing color components at the same position in the trigger pixel row includes: determining the integer delay of the pixel row adjacent to the trigger pixel row or the pixel row between them, extracting the pixel row corresponding to the integer delay and the pixel row preceding the pixel row corresponding to the integer delay, and calculating using a linear interpolation model to obtain the two missing color components at any position in any trigger pixel row.

[0025] Preferably, a fractional delay is used, which is adjacent to the trigger pixel row or the interval pixel row, to calculate the weight of the pixel row corresponding to the integer delay and the data at the same position in the previous pixel row of the pixel row corresponding to the integer delay.

[0026] A computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the color difference correction methods described above.

[0027] The beneficial effects of this invention are:

[0028] This invention provides a parallel chromatic aberration correction system that uses a first FIFO buffer queue and a second FIFO buffer queue connected in parallel. Each FIFO buffer queue has a preset number of serially connected buffer FIFOs based on the ratio between the object's motion speed relative to the camera and the camera's line frequency. This satisfies the requirements of different ratios between the object's motion speed relative to the camera and the camera's line frequency, reduces the number of buffer FIFOs, saves BRAM resources, and reduces power consumption and cost. It can achieve a wider range of corrections between the object's motion speed relative to the camera and the camera's line frequency with the same buffer FIFO occupancy.

[0029] This invention uses a data selector to satisfy the requirement that the direction of object movement is the same as or opposite to the direction of camera scanning under the same FIFO buffer resources, thereby further reducing the resource consumption of BRAM.

[0030] This invention provides a serial color difference correction system that uses a first-stage FIFO to achieve serial-to-parallel conversion and output parallel RGB data. The required number of buffer FIFOs for any value N within the range of N is no greater than the preset number of buffer FIFOs in the FIFO buffer queue. This allows for control of the enable pins of excess buffer FIFOs, dynamic adjustment of the actual number of buffer FIFOs used, and reduced power consumption. Attached Figure Description

[0031] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0032] Figure 1 This is the original image in this invention without dispersion correction;

[0033] Figure 2 This is a schematic diagram of the original hardware architecture for dispersion correction in this invention;

[0034] Figure 3 This is a system block diagram of the present invention;

[0035] Figure 4 This is a schematic diagram of the improved hardware architecture of the present invention;

[0036] Figure 5 This is the RGB pixel arrangement diagram in this invention;

[0037] Figure 6 This is a schematic diagram showing the actual spatial positions of the RGB pixel rows in this invention;

[0038] Figure 7 This is a schematic diagram of the RGB pixel row spatial positions according to an embodiment of the present invention;

[0039] Figure 8 This is a schematic diagram of the RGB pixel row spatial positions according to another embodiment of the present invention;

[0040] Figure 9 This is the image after dispersion correction in this invention;

[0041] Figure 10 This is a schematic diagram of another hardware architecture in this invention. Detailed Implementation

[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0043] like Figure 3 and 4 As shown, a parallel color difference correction system is applicable to any arrangement order of R, G, and B pixel rows, and simultaneously obtains parallel data streams of R, G, and B pixel rows, including:

[0044] The data caching module includes two FIFO cache queues. The first FIFO cache queue stores image row data for the first pixel row or the third pixel row, and the second FIFO cache queue stores image row data for the second pixel row.

[0045] Two FIFO buffer queues are used to store image row data from two different pixel rows. Each FIFO buffer queue contains several cascaded buffer FIFOs. The buffer FIFOs use a first-in-first-out (FIFO) order to store image row data collected from the same pixel row in sequence.

[0046] The data selector is used to select the data of the first pixel row or the third pixel row to be input into the first FIFO buffer queue, and the values ​​of pixel rows that are not stored in the first FIFO buffer queue and the second FIFO buffer queue are input into the data correction module.

[0047] The data correction module is used to obtain the trigger pixel row and use a linear interpolation model to calculate the two missing color components at the same position in the trigger pixel row. The trigger pixel row is a pixel row data among the R, G, and B pixel rows that are not stored in the FIFO cache queue.

[0048] Specifically, based on the number of pixel rows between the trigger pixel row and the R, G, and B pixel rows, the delay amount of each pixel row is determined to obtain the number of cascaded buffer FIFOs required in each FIFO buffer queue. Each buffer FIFO is used to cache monochrome image data of one pixel row, that is, it can be used to cache image data of R pixel rows, G pixel rows, or B pixel rows.

[0049] When the data selector selects the first pixel row of image data, it stores the data in the first FIFO buffer queue; the second pixel row of image data is stored in the second FIFO buffer queue; and the third pixel row is used as the trigger pixel row. Upon obtaining the trigger pixel row, the color components of other pixel rows at the corresponding position are calculated based on that position.

[0050] Similarly, the image row data of the third pixel row can be stored in the first FIFO buffer queue, with the first pixel row serving as the trigger pixel row.

[0051] For the pixel arrangement order of the three rows R, G, and B, as follows: Figure 5 As shown, B pixel row is taken as the reference pixel row, G pixel row is taken as the adjacent pixel row of reference pixel row B, and R pixel row is taken as the pixel row of reference pixel row with a gap of one pixel row. In this embodiment, B pixel row and G pixel row are taken as adjacent pixel rows, and G pixel row and R pixel row are taken as adjacent pixel rows. The adjacent pixel rows are not affected by the number of pixels between the RGB pixel rows of the line scan true color camera.

[0052] This embodiment uses a 3-line true color camera to simultaneously obtain parallel data streams of R, G, and B pixel rows. The first FIFO buffer queue includes several cascaded FIFO buffers for sequentially buffering monochrome image data of B pixel rows or R pixel rows. The second FIFO buffer queue includes several cascaded FIFO buffers for sequentially buffering monochrome image row data of G pixel rows. The FIFO buffers store the image row data in a first-in, first-out order.

[0053] Each buffer FIFO caches one line of monochrome image data. Each buffer FIFO has a buffer register connected to it, which is used to buffer input data or image line data read from the buffer FIFO. The buffer space of the buffer register is the pixel parallelism T, which is smaller than the buffer space of the buffer FIFO.

[0054] The input R, G, B data streams are typically input into the buffer FIFO and buffer register for several clock cycles per line, that is, T pixels are input per clock cycle (T=1, T=2, T=4, etc.).

[0055] If the bit width of the data written to and read from any buffer FIFO is the same as the bit width of the currently input row image data, then the input and output of any buffer FIFO in one clock cycle are each T pixels. Here, bit width = T × W, and W is the depth of each pixel.

[0056] Based on the above control signals, this embodiment determines the number of buffer FIFOs needed in each FIFO buffer queue. The method for determining the number of buffer FIFOs connected in series in each FIFO buffer queue includes: taking the trigger pixel row as the reference pixel row, calculating the delay of the two pixel rows excluding the trigger pixel row among the three pixel rows R, G, and B, and filtering out the smallest integer not less than the delay amount as the required number of buffer FIFOs connected in series in each FIFO buffer queue.

[0057] The trigger pixel row can be either the first pixel row or the third pixel row. When the object's movement direction is the same as the camera's scanning direction, the third pixel row is used as the trigger pixel row, and the color components of the first and second pixels at each position in the third pixel row are calculated. When the object's movement direction is opposite to the camera's scanning direction, the first pixel row is used as the trigger pixel row, and the color components of the second and third pixels at each position in the first pixel row are calculated.

[0058] In this embodiment, as Figure 6 As shown, the ratio N between the number of pixels 'a' between RGB pixel rows and the object's relative speed to the camera's line frequency, and the delay of the pixel row adjacent to the reference pixel row. The delay amount corresponding to the pixel row that is one pixel away from the reference pixel row. .

[0059] In this embodiment, the speed of the object relative to the camera can be the speed at which the object is stationary and the camera is moving; or the object is moving while the camera is relatively stationary; or both the object and the camera are moving.

[0060] When the smallest value of N is selected, the corresponding delay amount and The smallest integer not less than the delay is selected to determine the set number of buffer FIFOs in the first FIFO buffer queue. The smallest integer corresponding to the delay amount is The set number of buffer FIFOs in the second FIFO buffer queue () The smallest integer corresponding to the delay amount is ).

[0061] Since the number of pixels 'a' between the RGB pixel rows of a true-color line scan camera remains constant, the ratio N between the camera's motion speed relative to the object and the camera's scanning line frequency is adjustable. The value of N ranges from 0.5 to 4. The smallest N is selected. At this time, the reference pixel row is used. The delay value between the reference pixel row and the other two pixel rows is calculated to be the largest. The smallest integer not less than the delay value is selected and used as the preset number of FIFO buffers connected in series in that pixel row.

[0062] In this embodiment, within the range of N, any value is selected to calculate the delay of the pixel row adjacent to the reference pixel row relative to the reference pixel row. The delay of any value N within the range is not greater than the delay of the adjacent pixel row corresponding to the smallest value of N. Similarly, the delay of the pixel row that is one pixel away from the reference pixel row relative to the reference pixel row is not greater than the delay of the pixel row that is one pixel away from the reference pixel row corresponding to the smallest value of N.

[0063] The data selector selects the data from the first pixel row or the third pixel row to be input into the first FIFO buffer queue according to the control signal, wherein the control signal is that the direction of object movement is the same as or opposite to the direction of camera scanning.

[0064] Under the same control signal, the same FIFO buffer queue buffers image row data of the same color.

[0065] When the direction of object movement is the same as the direction of camera scanning, a=1 and N=0.5 are selected. The first FIFO buffer queue has 8 buffer FIFOs to buffer the image row data of R pixel rows, and the second FIFO buffer queue has 4 buffer FIFOs to buffer the image row data of G pixel rows.

[0066] Simultaneously, the first row of RGB pixel image data is input. When the first row of RGB pixel image data is input, the buffer FIFO1-1 writes the first row of R pixel image data and does not read it out. At this time, the other buffer FIFOs in the first FIFO buffer queue do not write or read out. The buffer FIFO2-1 writes the first row of G pixel image data and does not read it out. At this time, the other buffer FIFOs in the second FIFO buffer queue do not write or read out.

[0067] When the image data of the second row of RGB pixels is input, buffer FIFO1-1 writes the image data of the second row of R pixels and reads the image data of the first row of R pixels. Buffer FIFO1-2 writes the image data of the first row of R pixels but does not read it. Other buffer FIFOs in the first FIFO buffer queue do not write or read. Buffer FIFO2-1 writes the image data of the second row of G pixels and reads the image data of the first row of G pixels. Buffer FIFO2-2 writes the image data of the first row of G pixels but does not read it. Other buffer FIFOs in the second FIFO buffer queue do not write or read.

[0068] Similarly, when the image row data of the RGB pixel row in the i-th (i>8) row is input, the image row data of the RGB pixel row in the buffer FIFO1-1 is written into the i-th row of R pixel row and read out the image row data of the (i-1)-th row of R pixel row. The image row data of the (i-k+1)-th row of R pixel row in the buffer FIFO1-k is written into the buffer FIFO1-k and read out the image row data of the ik-th row of R pixel row. Here, k≤8, and k represents the number of buffer FIFOs in the first FIFO buffer queue.

[0069] Buffer FIFO2-1 writes the image row data of the i-th row of G pixels and reads the image row data of the (i-1)-th row of G pixels. Buffer FIFO2-f writes the image row data of the i-f+1-th row of G pixels and reads the image row data of the if-th row of G pixels. Here, f≤4, and f represents the number of buffer FIFOs in the second FIFO buffer queue.

[0070] When the input is the i-th row of RGB pixels, if i < k ≤ 8, the image row data of the i-th row of R pixels is written to the buffer FIFO1-1, and the image row data of the i-th row of R pixels is read out. The image row data of the 1st row of R pixels is written to the buffer FIFO1-i, and not read out. The buffers FIFO1-(i+1) to FIFO1-k are neither written to nor read out.

[0071] If i < 4 ≤ f, write the image row data of the i-th row of G pixels to buffer FIFO2-1, and read the image row data of the i-1-th row of G pixels. Write the image row data of the 1st row of G pixels to buffer FIFO2-i, and do not read it. Do not write or read from buffer FIFO2-(i+1) to buffer FIFO2-k.

[0072] If f≤i<4, write the image row data of the i-th row of G pixels into the buffer FIFO2-1, and read the image row data of the i-1-th row of G pixels. Write the image row data of the i-f+1-th row of G pixels into the buffer FIFO2-f, and read the image row data of the if-th row of G pixels.

[0073] When i≥4 and f=4, buffer FIFO2-1 writes the image row data of the i-th row of G pixels and reads the image row data of the (i-1)-th row of G pixels; buffer FIFO2-2 writes the image row data of the (i-1)-th row of G pixels and reads the image row data of the (i-2)-th row of G pixels; buffer FIFO2-3 writes the image row data of the (i-2)-th row of G pixels and reads the image row data of the (i-3)-th row of G pixels; buffer FIFO2-4 writes the image row data of the (i-3)-th row of G pixels and reads the image row data of the (i-4)-th row of G pixels.

[0074] Within the same FIFO buffer queue, the buffer FIFOs cache line by line. The image line data cached in the current buffer FIFO is read out and written back to the image line data read from the previous buffer FIFO.

[0075] When the object's direction of motion is opposite to the camera's scanning direction, the first FIFO buffer queue buffers the image row data of B pixels row by row. That is, buffer FIFO1-1 writes the image row data of the i-th B pixel row and reads the image row data of the (i-1)-th B pixel row; buffer FIFO1-2 writes the image row data of the (i-1)-th B pixel row and reads the image row data of the (i-2)-th B pixel row, and so on. Buffer FIFO1-k writes the image row data of the (i-k+1)-th B pixel row and reads the image row data of the ik-th B pixel row.

[0076] When the object's direction of motion is the same as the camera's scanning direction, image row data of R, G, and B pixel rows are obtained sequentially along the camera's scanning direction, and the first FIFO buffer queue buffers the image row data of the first pixel row; when the object's direction of motion is opposite to the camera's scanning direction, image row data of R, G, and B pixel rows are obtained in reverse order along the camera's scanning direction, and the first FIFO buffer queue buffers the image row data of the third pixel row.

[0077] Specifically, taking a 3-line true-color camera with a data stream sequence of R, G, B as an example, a=1, N=0.5, and the object's motion direction is the same as the camera's scanning direction, then the position P corresponding to the R pixel row... R As a baseline, calculate the position P corresponding to the row of R pixels. R The integer delay over G pixel rows is 4 G pixel rows; calculate the position P corresponding to R pixel rows. R The integer delay on the B-pixel row is 8 B-pixel rows.

[0078] If only the object's direction of movement is changed relative to the camera's scanning direction, making the object's direction of movement opposite to the camera's scanning direction, then the position P corresponding to pixel row B will... B As a baseline, calculate the position P corresponding to pixel row B. BThe integer delay over G pixel rows is 4 G pixel rows; calculate the position P corresponding to B pixel row. B The integer delay on the B-pixel row is 8 B-pixel rows.

[0079] If only the ratio between the camera's motion speed relative to the object and the camera's scanning line frequency is changed, N=1, then the position P corresponding to pixel R in the line will be... R As a baseline, calculate the position P corresponding to the row of R pixels. R The integer delay over G pixel rows is 2G pixel rows; calculate the position P corresponding to R pixel rows. R The integer delay on the B-pixel row is 4 B-pixel rows.

[0080] If the object's direction of movement is changed to be opposite to the camera's scanning direction, and the ratio of the camera's speed of movement relative to the object to the camera's scanning line frequency is N=1, then the position P corresponding to pixel B will be... B As a baseline, calculate the position P corresponding to pixel row B. B The integer delay over G pixel rows is 2G pixel rows; calculate the position P corresponding to B pixel rows. B The integer delay on the B-pixel row is 4 B-pixel rows.

[0081] Therefore, when the object's direction of motion is the same as the camera's scanning direction, increasing the ratio N between the object's relative speed to the camera's line frequency will increase the position P corresponding to the R pixel line. R The integer delay amounts in both the G-pixel and B-pixel rows are reduced; similarly, when the object's motion direction is opposite to the camera's scanning direction, the ratio N between the object's relative speed to the camera's line frequency is increased, and the corresponding position P in the B-pixel row is adjusted. B The integer delay on both the G pixel row and the R pixel row is reduced.

[0082] To ensure the hardware design, within the range of the ratio N between the object's relative speed to the camera and the camera's line frequency, the minimum value of N is selected to determine the number of preset buffer FIFOs in each FIFO buffer queue, so as to meet the requirement of the number of buffer FIFOs required for any N within the selected value range.

[0083] To address the issue that the number of buffered FIFOs in each FIFO buffer queue is less than the preset number of buffered FIFOs in the FIFO buffer queue, an arbitrary value of N is selected within the range of the ratio N between the object's relative motion speed to the camera's line frequency. Calculate the number of buffer FIFOs required for the pixel rows adjacent to the trigger pixel row; use The number of buffer FIFOs required to calculate the number of pixel rows with a one-pixel interval between the trigger pixel rows is calculated, where a represents the number of pixels between RGB pixel rows; and N represents the ratio between the object's motion speed relative to the camera and the camera's line frequency.

[0084] Preferably, in this embodiment, when N is equal to 1, and the number of buffered FIFOs in the first FIFO buffer queue that needs to buffer the first or third pixel row is less than the set number of buffered FIFOs in the first FIFO buffer queue, the enable pins of the excess FIFOs are pulled low, which can reduce the dynamic power consumption of the FIFOs; similarly, when the number of buffered FIFOs in the second FIFO buffer queue that needs to buffer the second pixel row is less than the set number of buffered FIFOs in the second FIFO buffer queue, the enable pins of the excess FIFOs are pulled low.

[0085] To calculate the two missing color components at the same position in a trigger pixel row, this embodiment discloses a method for calculating the missing color components at the same position in a trigger pixel row, including: determining the integer delay corresponding to a pixel row adjacent to the trigger pixel row or a pixel row separated by one pixel row; extracting the pixel row corresponding to the integer delay and the previous pixel row of the pixel row corresponding to the integer delay; and using a linear interpolation model to calculate to obtain the two missing color components at any position in any trigger pixel row.

[0086] Using the fractional delay of the pixel row adjacent to the trigger pixel row or the pixel row separated by one pixel row, calculate the weight of the pixel row corresponding to the integer delay and the data at the same position in the pixel row preceding the pixel row corresponding to the integer delay.

[0087] The integer delay amount is the pixel row adjacent to the trigger pixel row. An integer delay of a pixel row that is one pixel away from the trigger pixel row.

[0088] For example, under the following conditions, Figure 7 As shown, a 3-line true-color camera with R, G, and B pixel rows is selected, a=1, N=0.6, and the object's motion direction is the same as the camera's scanning direction. The B pixel row is used as the trigger pixel row, and the position P corresponding to the i-th B pixel row is... B As a baseline, calculate the position P corresponding to the B pixel in the i-th row. B The integer delay over G pixel rows is 3 G pixel rows; calculate the position P corresponding to the i-th row of B pixel rows. B The integer delay over R pixel rows is 6 R pixel rows.

[0089] At position P corresponding to pixel B in row i. BWhen calculating the G color component, an integer delay is used to determine the position P corresponding to the B pixel row. B Given the G-pixel row and the preceding pixel row of the G-pixel row, if the position P corresponding to the i-th row of B-pixel row... B , denoted as B(P) B (i)), the position P corresponding to the row B of the i-th row. B The G-pixel row and the preceding pixel row of the G-pixel row are respectively denoted as G(P). G (i-3)) and G(P G (i-4)).

[0090] Using a fractional delay, calculate the position P corresponding to pixel B in the i-th row. B In the G color component process, the pixel row G(P) corresponding to the integer delay G (i-3)), the pixel row G(P) preceding the pixel row corresponding to the integer delay. G In (i-4), the position corresponding to pixel B in row P is... B The weights they occupy are L1 B and L2 B L1 B =2 / 3, L2 B =1-L1 B .

[0091] Position P corresponding to row B B Using a linear interpolation model as a baseline, the position P corresponding to pixel row B is calculated. B G color component:

[0092] At position P corresponding to pixel B in row i. B When calculating the R color component, an integer delay is used to determine the position P corresponding to the B pixel row. B Given the R pixel row and the preceding pixel row, if the corresponding position P of the B pixel row... B , denoted as B(P) B (i)), the position corresponding to pixel row B is P B The R-pixel row and the preceding pixel row of the R-pixel row are respectively denoted as R(P) R (i-6)) and R(P R (i-7)).

[0093] Using a fractional delay, calculate the position P corresponding to row B. B In the R color component process, the pixel row R(P) corresponding to the integer delay R (i-6)), the pixel row preceding the pixel row corresponding to the integer delay R(P) R In (i-7), the position corresponding to pixel B in row P is... BThe weights they occupy are L3 B and L4 B L3 B =1 / 3, L4 B =1-L3 B .

[0094] Position P corresponding to row B B Using a linear interpolation model as a baseline, the position P corresponding to pixel row B is calculated. B R color component:

[0095] The above conditions apply to the case where the object's motion direction is the same as the camera's scanning direction. A 3-line true-color camera with R, G, and B pixel rows is still used, with a=1 and N=0.6. When the object's motion direction is opposite to the camera's scanning direction, the R pixel row is used as the trigger pixel row, with the position P corresponding to the i-th R pixel row... R As a baseline, calculate the position P corresponding to the i-th row of R pixels. R The integer delay over G pixel rows is 3 G pixel rows; calculate the position P corresponding to the i-th R pixel row. R The integer delay on the B-pixel row is 6 B-pixel rows.

[0096] At position P corresponding to the i-th row of R pixels R When calculating the G color component, an integer delay is used to determine the position P corresponding to the R pixel row. R Given the G-pixel row and the preceding pixel row of the G-pixel row, if the position P of the i-th row of R-pixels is... R , denoted as R(P) R (i)), the position P corresponding to the i-th row of R pixels. R The G-pixel row and the preceding pixel row of the G-pixel row are respectively denoted as G(P). G (i-3)) and G(P G (i-4)).

[0097] Using a fractional delay, calculate the position P corresponding to the i-th row of R pixels. R In the G color component process, the pixel row G(P) corresponding to the integer delay G (i-3)), the pixel row G(P) preceding the pixel row corresponding to the integer delay. G In (i-4), the position corresponding to pixel R in row P is... R The weights they occupy are L1 R and L2 R L1 R =2 / 3, L2 R =1-L1 R .

[0098] The corresponding position P of the R pixel row R Using a linear interpolation model as a baseline, the position P corresponding to the row of R pixels is calculated. R G color component:

[0099] At position P corresponding to the i-th row of R pixels R When calculating the B color component, an integer delay is used to determine the position P corresponding to the R pixel row. R Given the B pixel row and the preceding pixel row of the B pixel row, if the corresponding position P of the R pixel row... R , denoted as R(P) R (i)), the position P corresponding to the row of R pixels R The B-pixel row and the preceding pixel row of the B-pixel row are respectively denoted as B(P). B (i-6)) and B(P) B (i-7)).

[0100] Using a fractional delay, calculate the position P corresponding to the row of R pixels. R In the B color component process, the pixel row B(P) corresponding to the integer delay B (i-6)), the pixel row B(P) preceding the pixel row corresponding to the integer delay. B In (i-7), the position corresponding to pixel R in row P is... R The weights they occupy are L3 R and L4 R L3 R =1 / 3, L4 R =1-L3 R .

[0101] The corresponding position P of the R pixel row R Using a linear interpolation model as a baseline, the position P corresponding to the row of R pixels is calculated. R B color component:

[0102] In a 3-line true-color camera using R, G, and B pixel rows, with a=1 and N=0.6, if the object's movement direction is the same as the camera's scanning direction, the number of cascaded FIFO buffers required in the first FIFO buffer queue for the first pixel row (R pixel row) is less than the preset number of the first FIFO buffer queue. If the object's movement direction is opposite to the camera's scanning direction, the number of cascaded FIFO buffers required in the first FIFO buffer queue for the third pixel row (B pixel row) is less than the preset number of the first FIFO buffer queue. The number of cascaded FIFO buffers required in the second FIFO buffer queue for the second pixel row (G pixel row) is less than the preset number of the second FIFO buffer queue.

[0103] With N set to 0.5, the number of FIFOs in the cascaded buffer area required for the first FIFO buffer queue to cache the first or third pixel row is equal to the set number of the first FIFO buffer queue. Similarly, the number of FIFOs in the cascaded buffer area required for the second FIFO buffer queue to cache the second pixel row is equal to the set number of the second FIFO buffer queue.

[0104] In this embodiment, as Figure 8 As shown, a 3-line true-color camera with R, G, and B pixel rows is selected, a=1, N=1, and the object's motion direction is the same as the camera's scanning direction. The B pixel row is used as the trigger pixel row, with the position P corresponding to the i-th B pixel row. B As a baseline, calculate the position P corresponding to the B pixel in the i-th row. B The integer delay over G pixel rows is 2G pixel rows; calculate the position P corresponding to the i-th row of B pixel rows. B The integer delay over R pixel rows is 4 R pixel rows.

[0105] At position P corresponding to pixel B in row i. B When calculating the G color component, an integer delay is used to determine the position P corresponding to the i-th row of B pixels. R The G-pixel row is denoted as G(P). G (i-2)).

[0106] At this point, there is only an integer delay, no fractional delay, with the position P corresponding to pixel row B. B Using B as a reference, calculate the position P corresponding to the row of pixels B. B G color component: G(P) B )=G(P G (i-2)).

[0107] At position P corresponding to pixel B in row i. B When calculating the R color component, an integer delay is used to determine the position P corresponding to the i-th row of B pixels. B The R-pixel row is denoted as R(P) R (i-4)).

[0108] At this point, using a zero-decimal-delay method, the position P corresponding to pixel row B is... B Using B as a reference, calculate the position P corresponding to the row of pixels B. B R color component: R(P) B )=R(P R (i-4)).

[0109] The above conditions apply to the case where the object's motion direction is the same as the camera's scanning direction. A 3-line true-color camera with R, G, and B pixel rows is still used, with a=1 and N=1. When the object's motion direction is opposite to the camera's scanning direction, the R pixel row is used as the trigger pixel row, with the position P corresponding to the i-th R pixel row... R As a baseline, calculate the position P corresponding to the i-th row of R pixels. R The integer delay over G pixel rows is 2G pixel rows; calculate the position P corresponding to the i-th R pixel row. R The integer delay on the B-pixel row is 4 B-pixel rows.

[0110] At position P corresponding to the i-th row of R pixels R When calculating the G color component, an integer delay is used to determine the position P corresponding to the R pixel row. R The G-pixel row is denoted as G(P). G (i-2)).

[0111] At this point, there is no decimal delay, and the position P corresponding to the row of R pixels is... R Using R pixels as a reference, calculate the position P corresponding to the row of R pixels. R G color component: G(P) R )=G(P G (i-2)).

[0112] At position P corresponding to the i-th row of R pixels R When calculating the B color component, an integer delay is used to determine the position P corresponding to the i-th row of R pixels. R The row of B pixels is denoted as B(P). B (i-4)).

[0113] At this point, there is no decimal delay, and the position P corresponding to the row of R pixels is... R Using R pixels as a reference, calculate the position P corresponding to the row of R pixels. R B color component: B(P) R )=B(P B (i-4)).

[0114] In a 3-line true color camera using R, G, and B pixel rows, with a=1 and N=1, if the object's movement direction is the same as or opposite to the camera's scanning direction, the pixel rows adjacent to the reference pixel row and the pixel rows separated by one pixel row have only integer delays. There is no need to interpolate two adjacent pixel rows of the same pixel row to calculate the two missing color components at the position above the reference pixel row.

[0115] like Figure 9As shown, a 3-line true color camera, with the number of pixels 'a' between RGB pixel rows, and using a linear interpolation model with the ratio N between the object's relative speed to the camera's line frequency, can calculate the two missing color components at the same position in the trigger pixel row, thus obtaining the RGB color components at the same position and eliminating edge dispersion problems.

[0116] This embodiment discloses a hardware structure for a serial color difference correction system. Compared to a parallel color difference correction system, the serial color difference correction system further includes a serial-to-parallel conversion module. The data selector is located before the serial-to-parallel conversion module and is used to adjust the data storage of the first pixel row or the third pixel row to the first FIFO buffer queue according to the control signal.

[0117] The serial-to-parallel conversion module is used to process the data streams of the sequentially input R, G, and B pixel rows in parallel, so as to simultaneously output the data streams of the R, G, and B pixel rows to the data buffer module.

[0118] like Figure 10 As shown, the serial-to-parallel conversion module includes a first buffer FIFO, a second buffer FIFO, a first buffer register, a second buffer register, and a third buffer register. Image row data read from the first buffer FIFO is written to the first buffer register, image row data read from the second buffer FIFO is written to the first buffer register, and the third buffer register is used to buffer image data of the reference pixel row.

[0119] In the serial-to-parallel conversion module, the first buffer FIFO and the second buffer FIFO serve as the first-level FIFO to convert serial input data into parallel RGB data; and several serially connected buffer FIFOs in the first FIFO buffer queue and several serially connected buffer FIFOs in the second FIFO buffer queue serve as the second-level FIFO.

[0120] The hardware structure of this system uses a 3-line true color camera. When a=1 and N=0.5, the first-stage FIFO requires 2 buffer FIFOs, the first FIFO buffer queue in the second-stage FIFO requires 8 buffer FIFOs, and the second FIFO buffer queue requires 4 buffer FIFOs. This hardware structure requires a total of 14 FIFOs, which can save buffer FIFO resources, reduce BRAM resource consumption, and reduce power consumption and cost.

[0121] When addressing chromatic aberration, the FIFO buffer size is reduced. Compared to the number of FIFO buffers used in existing technologies, chromatic aberration correction can be achieved when the ratio N between the camera's motion rate relative to the object and the camera's scanning line frequency is larger.

[0122] According to the control signal, the first FIFO buffer is used to buffer the monochrome image row data of the first or third pixel row, and the second FIFO buffer is used to buffer the image row data of the second pixel row. The monochrome pixel row data read from the first FIFO buffer is written to the first buffer register, and the monochrome pixel row data read from the second FIFO buffer is written to the second buffer register.

[0123] When the control signal indicates that the object's motion direction is the same as the camera's scanning direction, the first buffer FIFO writes the image row data of the first pixel row, and the third pixel row serves as the trigger pixel row. When the control signal indicates that the object's motion direction is opposite to the camera's scanning direction, the first buffer FIFO writes the image row data of the third pixel row, and the first pixel row serves as the trigger pixel row.

[0124] The trigger pixel row is affected by the RGB pixel arrangement order of the 3-line true color camera and the control signal. According to the data stream order, the first pixel row or the third pixel row is written to the first buffer FIFO, and the second pixel row is written to the second buffer FIFO. When the trigger pixel row is received, the image row data of the first buffer FIFO, the second buffer FIFO and the trigger pixel row are output simultaneously to form parallel RGB data.

[0125] The 3-line true color camera in this embodiment is not limited to the arrangement order of R, G, B pixels. It can be arranged in the order of B, G, R pixels, G, B, R pixels, or any arrangement order of R, G, B pixels.

[0126] This application does not limit the order of the R, G, B data streams of the 3-line true color camera. It can be in the order of R, G, B, B, R, G, R, B, G, R, G, B, or B, G, R. In this invention, the color difference correction of the true color line scan camera is affected by the row arrangement order of the R, G, B pixels in the line scan true color camera, but not by the order of the R, G, B data streams. After the serial-to-parallel conversion module, any order of the R, G, B data streams is converted into parallel RGB image row data.

[0127] Based on the same inventive concept, this application also proposes a parallel color difference correction method, applicable to any arrangement order of R, G, and B pixel rows, simultaneously obtaining parallel data streams of R, G, and B pixel rows. The color difference correction method includes:

[0128] Obtain the data for the first pixel row, the second pixel row, and the third pixel row;

[0129] The data of the second pixel row is selected and stored in the FIFO buffer in the first FIFO buffer queue, and the data of the first pixel row or the third pixel row is stored in the FIFO buffer in the second FIFO buffer queue.

[0130] Calculate the missing color component at the same position in the trigger pixel row, where the trigger pixel row is a pixel row of data in the B, G, and R pixel rows that are not stored in the FIFO cache queue.

[0131] Specifically, based on the interval between the trigger pixel row and the pixel rows in the R, G, and B pixel rows, the delay amount of each pixel row is determined, so as to determine the number of FIFO buffers connected in series in each FIFO buffer queue.

[0132] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements any of the dispersion correction methods described above.

[0133] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0134] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

[0135] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A parallel color difference correction system, applicable to any arrangement order of R, G, and B pixel rows, characterized in that, Obtain parallel data streams of R, G, and B pixel rows, including: The data caching module includes two parallel FIFO cache queues. The first FIFO cache queue stores the data of the first pixel row or the third pixel row, and the second FIFO cache queue stores the data of the second pixel row. The two FIFO cache queues are used to store image row data of two different pixel rows. Each FIFO cache queue contains several cascaded FIFO buffer areas. A data selector is used to select data from the first pixel row or the third pixel row to be input into the first FIFO buffer queue according to a control signal, wherein the control signal is that the direction of object movement is the same as or opposite to the direction of camera scanning; The data correction module is used to obtain the trigger pixel row and use a linear interpolation model to calculate the two missing color components at the same position in the trigger pixel row. The trigger pixel row is a pixel row data in the R, G, B pixel rows that are not stored in the FIFO cache queue. Specifically, based on the numerical range of the ratio between the camera's motion rate relative to the object and the camera's scanning line frequency, the smallest ratio in the numerical range is selected. Based on the interval between the trigger pixel line and the pixel lines in the R, G, and B pixel lines, the delay amount of each pixel line is determined. The smallest integer not less than the delay amount is selected to obtain the number of FIFO buffers that need to be cascaded in each FIFO buffer queue.

2. The parallel color difference correction system according to claim 1, characterized in that, The FIFO buffer queue contains several cascaded FIFO buffers, which store image row data in a first-in-first-out (FIFO) order.

3. A serial color difference correction system, characterized in that, The system applied to any one of claims 1-2 further includes a serial-to-parallel conversion module, wherein the data selector is located before the serial-to-parallel conversion module and is used to adjust the data of the first pixel row or the third pixel row to the first FIFO buffer queue according to the control signal. The serial-to-parallel conversion module is used to process the data streams of the sequentially input R, G, and B pixel rows in parallel, so as to simultaneously output the data streams of the R, G, and B pixel rows to the data buffer module.

4. A parallel color difference correction method, characterized in that, Applied to the system described in any of claims 1-2, and using any arrangement order of the R, G, and B pixel rows, a parallel data stream of R, G, and B pixel rows is obtained, the color difference correction method includes: Obtain the data for the first pixel row, the second pixel row, and the third pixel row; According to the control signal, the data of the first pixel row or the third pixel row is selected and stored in the FIFO buffer area connected in series in the first FIFO buffer queue, and the data of the second pixel row is selected and stored in the FIFO buffer area connected in series in the second FIFO buffer queue. The missing color component at the same position in the trigger pixel row is calculated. The trigger pixel row is a pixel row of data in the B, G, R pixel rows that are not stored in the FIFO buffer queue. The control signal is that the object's motion direction is the same as or opposite to the camera's scanning direction. Specifically, based on the numerical range of the ratio between the camera's motion rate relative to the object and the camera's scanning line frequency, the smallest ratio in the numerical range is selected. Based on the interval between the trigger pixel line and the pixel lines in the R, G, and B pixel lines, the delay amount of each pixel line is determined. The smallest integer not less than the delay amount is selected to determine the number of FIFO buffers that need to be cascaded in each FIFO buffer queue.

5. The parallel color difference correction method according to claim 4, characterized in that, The number of buffer FIFOs required for the pixel rows adjacent to the trigger pixel row, expressed as a delay. Calculated; the number of buffer FIFOs required for a pixel row that is one pixel away from the trigger pixel row, using the latency. The calculations show that 'a' represents the number of pixels between rows of RGB pixels, and 'N' represents the ratio between the object's speed relative to the camera and the camera's line frequency.

6. The parallel color difference correction method according to claim 5, characterized in that: The calculation of the missing color components at the same position in the trigger pixel row includes: determining the integer delay of the pixel row adjacent to the trigger pixel row or the pixel row between them; extracting the pixel row corresponding to the integer delay and the pixel row preceding the pixel row corresponding to the integer delay; and using a linear interpolation model to calculate to obtain the two missing color components at any position in any trigger pixel row.

7. The parallel color difference correction method according to claim 5, characterized in that, Using the fractional delay of the pixel row adjacent to the trigger pixel row or the pixel row between them, calculate the weight of the pixel row corresponding to the integer delay and the data at the same position in the pixel row preceding the pixel row corresponding to the integer delay.

8. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores a computer program that, when executed by a processor, implements the color difference correction method according to any one of claims 4-7.

Citation Information

Patent Citations

  • Method, system and device for image display fault tolerance and storage medium

    CN114283047A

  • Dispersion correction method and system and multi-line true color camera

    CN119012021A

  • Image enhancement system and method and medium

    CN119540026A