Cameralink image data encapsulation method and system

By detecting the usage status of the video control signal DVAL and generating synchronization words, it solves the problem of unclear image data transmission timing relationship in the CameraLink standard, realizes unified processing and transmission of image data, simplifies the image encoding and decoding program, and saves data transmission and Storage bandwidth.

CN115801967BActive Publication Date: 2024-08-27TIANJIN JINHANG INST OF TECH PHYSICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211424235.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-15
Publication Date
2024-08-27
Estimated Expiration
2042-11-15

AI Technical Summary

Technical Problem

The image data transmission timing relationship in the CameraLink standard is not clear, which makes image data collection, processing, storage and transmission more difficult and difficult to unify.

Method used

By detecting the usage status of the video control signal DVAL in the CameraLink standard, the data enable signal DEN is generated, and combined with the synchronization clock signal CLK and the video control signals FVAL and LVAL, the number of rows and columns of the image is calculated, and a synchronization word is generated for splicing. Image data forms a unified data structure.

Benefits of technology

It realizes the encapsulation of different CameraLink standard time-series images under the same transmission mode into the same data, simplifying the collection, processing, storage and transmission of image data, saving bandwidth, unifying the image interface, and reducing standard coordination and conventions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115801967B
    Figure CN115801967B
Patent Text Reader

Abstract

The present invention provides a Cameralink image data encapsulation method and system, wherein the image data encapsulation method automatically detects the use of DVAL, generates corresponding synchronization words for each image data according to the state of the video control signal, splices the synchronization words with the image data bit by bit, and then caches the spliced ​​data for use. Images with the same transmission mode and the same image data but with very different CameraLink standard transmission timings can be encapsulated into completely identical data, and users can perform operations such as acquisition, processing, storage, display, error correction and transmission of the image data according to the synchronization words, thereby saving data transmission and storage bandwidth, unifying image interfaces, simplifying image encoding and decoding procedures, and reducing standard coordination and agreements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data encapsulation, and in particular to a Cameralink image data encapsulation method and system. Background Art

[0002] CameraLink is a serial communication standard specifically designed for machine vision applications. It uses low voltage differential signaling (LVDS) for data transmission and communication. In most applications, the CameraLink standard only uses its core part, namely video data signal transmission. The CameraLink standard clearly specifies the splicing, assignment, and timing requirements of 24-bit image data signals in applications. For the key video control signals FVAL, LVAL, and DVAL, only high validity is specified, but the timing relationship between video control signals and whether DVAL is used are not clearly specified.

[0003] This means that even if there are tens of thousands of transmission timings that meet the CameraLink standard for the same transmission mode and the same image data, it all depends on the user's personal understanding of the standard, which increases the difficulty of image data acquisition, processing, storage, display, error correction and transmission, and makes it difficult to unify. In order to correctly send or receive CameraLink standard video data, in addition to the total number of image rows, total number of columns and pixel data bit width, it is also necessary to coordinate and agree on the timing relationship between video control signals, the envelope relationship between video control signals and image data, and whether DVAL is used. Summary of the invention

[0004] The present invention provides a CameraLink image data encapsulation method and system, which encapsulates images with the same transmission mode and the same image data but with very different CameraLink standard transmission timings into completely identical data. Users can collect, process, store, display, correct errors and transmit the image data according to synchronization words, thereby saving data transmission and storage bandwidth, unifying image interfaces, simplifying image encoding and decoding procedures, and reducing standard coordination and conventions.

[0005] In a first aspect, an embodiment of the present invention provides a Cameralink image data encapsulation method, wherein the image data encapsulation includes:

[0006] Connect the image differential pair in the CameraLink standard to the serial-to-parallel converter to obtain the synchronous clock signal CLK and the video control signal parallel image data; wherein the video control signal includes a frame synchronization signal FVAL, a line synchronization signal LVAL, and a data valid signal DVAL;

[0007] Sending the synchronous clock signal CLK and the video control signal to the control signal detector, detecting the use status of the data valid signal DVAL and generating a data enable signal DEN;

[0008] The synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN are sent to the row and column counter, and the row and column counter obtains the current row number row_num and the current column number col_num of the image by counting according to the data enable signal DEN and the synchronous clock CLK;

[0009] The synchronous clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num are sent to the synchronous word generator, and the synchronous word generator delays the input data enable signal DEN by three synchronous clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer;

[0010] The synchronous clock signal CLK and the parallel image data are sent to the image data delayer, and the parallel image data is delayed by three synchronous clock CLK cycles and then output to the data splicer;

[0011] Sending the synchronous clock signal CLK, delayed image data, synchronization word and splicing enable signal WEN_S to a data splicer;

[0012] The data splicer delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle and assigns it to the cache write enable signal WEN; sends the synchronous clock signal CLK, the cache write enable signal WEN and the splicing data to the splicing data buffer for reading.

[0013] As a possible implementation method, sending the synchronous clock signal CLK and the video control signal to the control signal detector, detecting the use status of the data valid signal DVAL and generating the data enable signal DEN includes:

[0014] The control signal detector detects the rising edge of the frame synchronization signal FVAL, and after detecting the rising edge, when FVAL is high, detects the rising edge and falling edge of the data valid signal DVAL and counts them.

[0015] As a possible implementation, if the number of rising edges and falling edges of the detected data valid signal DVAL is greater than 1, it is determined that the DVAL in the CameraLink standard is used; at this time, the frame synchronization signal FVAL, the data valid signal DVAL and the line synchronization signal LVAL are ANDed, and the calculation result is assigned to the data enable signal DEN and output;

[0016] If the number of rising edges and falling edges of the detected data valid signal DVAL is less than or equal to 1, it is determined that DVAL in this CameraLink standard is not used; at this time, the frame synchronization signal FVAL and the line synchronization signal LVAL are taken "AND", and the calculation result is assigned to the data enable signal DEN and output.

[0017] As a possible implementation, the synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN are sent to the row and column counter, and the row and column counter obtains the current row number row_num and the current column number col_num of this row of this image by counting according to the data enable signal DEN and the synchronous clock CLK, including:

[0018] The row and column counter detects the rising and falling edges of the data enable signal DEN. When the frame synchronization signal FVAL is low, the current row number row_num is assigned a value of 0. When the falling edge of the data enable signal DEN is detected, the current row number row_num is assigned a value that is accumulated by 1 until the frame synchronization signal FVAL is low.

[0019] When the data enable signal DEN is low, the current column number col_num is assigned a value of 0. When the data enable signal DEN is high, the current column number col_num is assigned a value that is accumulated by 1 at each rising edge of the synchronous clock signal CLK until the data enable signal DEN is low.

[0020] As a possible implementation method, the synchronization clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num are sent to the synchronization word generator, and the synchronization word generator delays the input data enable signal DEN by three synchronization clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer, including:

[0021] The synchronization word generator detects the rising edge and the falling edge of the frame synchronization signal FVAL, and detects the rising edge and the falling edge of the data enable signal DEN;

[0022] When the falling edge of the frame synchronization signal FVAL is detected, the 3-bit wide synchronization word S_img_sync is assigned C_FE_LE_DE, indicating the end of the frame, the end of the line, and the end of the data;

[0023] When the rising edge of the data enable signal DEN is detected, if the current row number row_num value is 0, the 3-bit wide synchronization word S_img_sync is assigned to C_FS_LS_DS, indicating the start of the frame, the start of the row, and the start of the data; if the current row number row_num value is not 0, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LS_DS, indicating that the frame is valid, the row starts, and the data starts;

[0024] When the falling edge of the data enable signal DEN is detected, if the current row number row_num value is the total number of image rows minus 1, the 3-bit wide synchronization word S_img_sync is assigned to C_FE_LE_DE, indicating the end of the frame, the end of the row, and the end of the data. If the current row number row_num value is not the total number of image rows minus 1, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LE_DE, indicating that the frame is valid, the row is ended, and the data is ended;

[0025] When neither the rising edge nor the falling edge of the frame synchronization signal FVAL nor the rising edge nor the falling edge of the data enable signal DEN is detected, if the data enable signal DEN is high, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LV_DV, indicating that the frame is valid, the row is valid, and the data is valid; if the data enable signal DEN is low, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LE_DE, indicating that the frame is valid, the row is ended, and the data is ended.

[0026] As a possible implementation, when the splicing enable signal WEN_S is high, the data splicer performs bit splicing on the 3-bit wide synchronization word S_img_sync and the delayed image data, and the 3-bit wide synchronization word S_img_sync occupies the lower three bits.

[0027] As a possible implementation method, when the cache write enable signal WEN is high, data is written, and when the cache write enable signal WEN is low, no data is written.

[0028] In a second aspect, an embodiment of the present invention provides a Cameralink image data encapsulation system, the image data encapsulation system comprising:

[0029] A serial-to-parallel converter, connecting the image differential pair in the CameraLink standard to the serial-to-parallel converter to obtain a synchronous clock signal CLK and a video control signal parallel image data; wherein the video control signal includes a frame synchronization signal FVAL, a line synchronization signal LVAL, and a data valid signal DVAL;

[0030] A control signal detector, which sends the synchronous clock signal CLK and the video control signal to the control signal detector, detects the use status of the data valid signal DVAL and generates a data enable signal DEN;

[0031] A row-column counter, wherein the synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN are sent to the row-column counter, and the row-column counter obtains the current row number row_num and the current column number col_num of the image by counting according to the data enable signal DEN and the synchronous clock CLK;

[0032] A synchronization word generator, which sends the synchronization clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num to the synchronization word generator, and the synchronization word generator delays the input data enable signal DEN by three synchronization clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer;

[0033] An image data delayer, which sends the synchronous clock signal CLK and the parallel image data to the image data delayer, and the parallel image data is delayed by three synchronous clock CLK cycles and then output to the data splicer;

[0034] A data splicer, which sends the synchronous clock signal CLK, delayed image data, synchronization word and splicing enable signal WEN_S to the data splicer;

[0035] The data splicing buffer delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle and assigns it to the cache write enable signal WEN; the synchronous clock signal CLK, the cache write enable signal WEN and the splicing data are sent to the splicing data buffer for reading.

[0036] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the program, the method described in any one of the first aspects is implemented.

[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method as described in any one of the first aspects.

[0038] Beneficial Effects

[0039] The present invention provides a CameraLink image data encapsulation method and system. The image data encapsulation method comprises the following steps: connecting an image differential pair in the CameraLink standard to a serial-to-parallel converter to obtain a synchronous clock signal CLK and a video control signal parallel image data; sending the synchronous clock signal CLK and the video control signal to a control signal detector to detect the use status of a data valid signal DVAL and generate a data enable signal DEN; sending the synchronous clock signal CLK, a frame synchronization signal FVAL and the data enable signal DEN to a row and column counter, and the row and column counter generates a signal based on the data enable signal DEN and the synchronous clock CLK. The current row number row_num and the current column number col_num of this row of this image are obtained by counting; the synchronous clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num are sent to the synchronous word generator, and the synchronous word generator delays the input data enable signal DEN by three synchronous clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer; the synchronous clock signal CLK and the parallel image data are sent to the image data delayer, and the parallel image data is delayed by three synchronous clock CLK cycles and then output to the data splicer;

[0040] The synchronous clock signal CLK, delayed image data, synchronous word and splicing enable signal WEN_S are sent to the data splicer; the data splicer delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle and assigns it to the cache write enable signal WEN; the synchronous clock signal CLK, the cache write enable signal WEN and the splicing data are sent to the splicing data buffer for reading. The user can collect, process, store, display, correct errors and transmit the image data according to the synchronous word, saving data transmission and storage bandwidth, unifying the image interface, simplifying the image encoding and decoding program, and reducing the coordination and agreement of standards.

[0041] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The above and other features, advantages and aspects of the embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements.

[0043] Figure 1 A flowchart of a Cameralink image data encapsulation method according to an embodiment of the present invention is shown;

[0044] Figure 2 A schematic structural diagram of a Cameralink image data encapsulation system according to an embodiment of the present invention is shown;

[0045] Figure 3 A structural diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0046] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.

[0047] It should be noted that the description of the embodiments of the present invention is only for more clearly illustrating the technical solutions of the embodiments of the present invention, and does not constitute a limitation on the technical solutions provided by the embodiments of the present invention.

[0048] In the related technology, the CameraLink standard has four types of signals: power signal, video data signal, camera control signal, and serial communication signal. The video data signal part is the core of CameraLink, and the video transmission mode of the CameraLink standard is divided into five modes: lite mode, base mode, medium mode, full mode, and 80-bit mode.

[0049] Taking the base mode as an example, it mainly includes 5 pairs of differential lines, namely X0-~X0+, X1-~X1+, X2-~X2+, X3-~X3+, and Xclk-~Xclk+; the video transmitter converts 28-bit data and a clock signal into 5 pairs of differential pairs in a 7:1 ratio, and the receiver converts the 5 pairs of differential signals into 28-bit data signals and one clock signal. The 28-bit video data signal includes a 24-bit image data signal and a 4-bit video control signal.

[0050] The 24-bit image data signal can be configured in various ways, such as 24-bit RGB data for one pixel, 14-bit grayscale data for one pixel, or 8-bit grayscale data for three pixels.

[0051] The 4-bit video control signals include:

[0052] FVAL: Frame synchronization signal. When FVAL is high, it means the camera is outputting a frame of valid image data.

[0053] LVAL: Line synchronization signal. When FVAL and LVAL are both high, it means the camera is outputting a line of valid image data.

[0054] DVAL: Data valid signal. When FVAL and LVAL are both high, DVAL is high, indicating that the camera is outputting valid image data. This signal may or may not be used, and can also be used as a check bit in data transmission.

[0055] SPACE: Reserve signal.

[0056] CLK: Image pixel clock. The image data is stable on the rising edge of the pixel clock during the effective period of the line. It should be noted that the CLK signal is transmitted using a pair of LVDS signals alone. Regardless of whether the camera is in working state, the CLK signal is valid.

[0057] The CameraLink standard only uses its core part, i.e., video data signal transmission, in most applications. The CameraLink standard clearly specifies the splicing, assignment, and timing requirements of 24-bit image data signals in applications. For the key video control signals FVAL, LVAL, and DVAL, only high validity is specified, but the timing relationship between video control signals and whether DVAL is used are not clearly specified.

[0058] This results in tens of thousands of transmission timings that conform to the CameraLink standard for the same transmission mode and the same image data, which all depend on the user's personal understanding of the standard. This situation increases the difficulty of image data acquisition, processing, storage, display, error correction and transmission, and makes it difficult to unify. In order to correctly send or receive CameraLink standard video data, in addition to the total number of image rows, total number of columns and pixel data bit width, it is also necessary to coordinate and agree on the timing relationship between video control signals, the envelope relationship between video control signals and image data, and whether DVAL is used.

[0059] The present invention aims to automatically detect the use of DVAL, generate corresponding synchronization words for each image data according to the state of the video control signal, splice the synchronization words with the image data bit by bit, and then cache the spliced ​​data for use. The present invention can encapsulate images with the same transmission mode and the same image data, but with very different CameraLink standard transmission timings, into completely identical data, and users can collect, process, store, display, correct errors, and transmit the image data according to the synchronization words. The advantages are saving data transmission and storage bandwidth, unifying image interfaces, simplifying image encoding and decoding procedures, and reducing standard coordination and agreements.

[0060] Figure 1 A Cameralink image data encapsulation method according to an embodiment of the present invention is shown, wherein the image data encapsulation comprises:

[0061] S10, connecting the image differential pair in the CameraLink standard to a serial-to-parallel converter to obtain a synchronous clock signal CLK and a video control signal parallel image data; wherein the video control signal includes a frame synchronization signal FVAL, a line synchronization signal LVAL, and a data valid signal DVAL;

[0062] S20, send the synchronization clock signal CLK and the video control signal to the control signal detector, detect the use status of the data valid signal DVAL and generate the data enable signal DEN; specifically, the control signal detector detects the rising edge of the frame synchronization signal FVAL, and after detecting the rising edge, when FVAL is high, detects the rising edge and falling edge of the data valid signal DVAL and counts them. Specifically, if the number of rising edges and falling edges of the detected data valid signal DVAL is greater than 1, it is determined that the DVAL in this CameraLink standard is used; at this time, the three signals of the frame synchronization signal FVAL, the data valid signal DVAL and the line synchronization signal LVAL are taken "AND", and the calculation result is assigned to the data enable signal DEN and output;

[0063] If the number of rising edges and falling edges of the detected data valid signal DVAL is less than or equal to 1, it is determined that DVAL in this CameraLink standard is not used; at this time, the frame synchronization signal FVAL and the line synchronization signal LVAL are taken "AND", and the calculation result is assigned to the data enable signal DEN and output.

[0064] S30, sending the synchronization clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN to the row and column counter, the row and column counter obtains the current row number row_num and the current column number col_num of the image by counting according to the data enable signal DEN and the synchronization clock CLK; the row and column counter detects the rising edge and the falling edge of the data enable signal DEN, when the frame synchronization signal FVAL is low, the current row number row_num is assigned a value of 0, and when the falling edge of the data enable signal DEN is detected, the current row number row_num is assigned a value that is accumulated by 1 until the frame synchronization signal FVAL is low;

[0065] When the data enable signal DEN is low, the current column number col_num is assigned a value of 0. When the data enable signal DEN is high, the current column number col_num is assigned a value that is accumulated by 1 at each rising edge of the synchronous clock signal CLK until the data enable signal DEN is low.

[0066] S40, sending the synchronous clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num to the synchronous word generator, the synchronous word generator delays the input data enable signal DEN by three synchronous clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer;

[0067] The synchronization word generator detects the rising edge and the falling edge of the frame synchronization signal FVAL, and detects the rising edge and the falling edge of the data enable signal DEN;

[0068] When the falling edge of the frame synchronization signal FVAL is detected, the 3-bit wide synchronization word S_img_sync is assigned C_FE_LE_DE, indicating the end of the frame, the end of the line, and the end of the data;

[0069] When the rising edge of the data enable signal DEN is detected, if the current row number row_num value is 0, the 3-bit wide synchronization word S_img_sync is assigned to C_FS_LS_DS, indicating the start of the frame, the start of the row, and the start of the data; if the current row number row_num value is not 0, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LS_DS, indicating that the frame is valid, the row starts, and the data starts;

[0070] When the falling edge of the data enable signal DEN is detected, if the current row number row_num value is the total number of image rows minus 1, the 3-bit wide synchronization word S_img_sync is assigned to C_FE_LE_DE, indicating the end of the frame, the end of the row, and the end of the data. If the current row number row_num value is not the total number of image rows minus 1, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LE_DE, indicating that the frame is valid, the row is ended, and the data is ended;

[0071] When neither the rising edge nor the falling edge of the frame synchronization signal FVAL nor the rising edge nor the falling edge of the data enable signal DEN is detected, if the data enable signal DEN is high, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LV_DV, indicating that the frame is valid, the row is valid, and the data is valid; if the data enable signal DEN is low, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LE_DE, indicating that the frame is valid, the row is ended, and the data is ended.

[0072] S50, sending the synchronous clock signal CLK and the parallel image data to the image data delayer, and after the parallel image data is delayed by three synchronous clock CLK cycles, output to the data splicer;

[0073] S60, sending the synchronous clock signal CLK, delayed image data, synchronization word and splicing enable signal WEN_S to the data splicer; when the splicing enable signal WEN_S is high, the data splicer splices the 3-bit wide synchronization word S_img_sync with the delayed image data, and the 3-bit wide synchronization word S_img_sync occupies the lower three bits.

[0074] S70, the data splicer delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle, and assigns it to the cache write enable signal WEN; the synchronous clock signal CLK, the cache write enable signal WEN and the spliced ​​data are sent to the splicing data buffer for reading. When the cache write enable signal WEN is high, the data is written, and when the cache write enable signal WEN is low, no data is written.

[0075] The present embodiment provides a CameraLink image data encapsulation method, wherein the image data encapsulation method obtains a synchronous clock signal CLK and a video control signal parallel image data by connecting an image differential pair in the CameraLink standard to a serial-to-parallel converter; the synchronous clock signal CLK and the video control signal are sent to a control signal detector to detect the use status of a data valid signal DVAL and generate a data enable signal DEN; the synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN are sent to a row and column counter, and the row and column counter obtains the current row number row_num and the current column number col_num of the image by counting according to the data enable signal DEN and the synchronous clock CLK; the synchronous clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num are sent to a synchronous word generator, and the synchronous word The generator delays the input data enable signal DEN by three synchronous clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer; the synchronous clock signal CLK and parallel image data are sent to the image data delayer, and the parallel image data is output to the data splicer after being delayed by three synchronous clock CLK cycles; the synchronous clock signal CLK, delayed image data, synchronization word and splicing enable signal WEN_S are sent to the data splicer; the data splicer delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle, and assigns it to the cache write enable signal WEN; the synchronous clock signal CLK, the cache write enable signal WEN and the splicing data are sent to the splicing data buffer for reading and use. The user can collect, process, store, display, correct errors and transmit the image data according to the synchronization word, saving data transmission and storage bandwidth, unifying the image interface, simplifying the image encoding and decoding procedures, and reducing the coordination and agreement of standards.

[0076] Based on the same inventive concept, an embodiment of the present invention further provides a Cameralink image data encapsulation system, which can be used to implement a Cameralink image data encapsulation method described in the above embodiment, as described in the following embodiment: Since the principle of solving the problem by the Cameralink image data encapsulation system is similar to that of the Cameralink image data encapsulation method, the implementation of the Cameralink image data encapsulation system can refer to the implementation of the Cameralink image data encapsulation method, and the repeated parts will not be repeated. Although the device described in the following embodiment is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0077] Specifically, a Cameralink image data encapsulation system includes a serial-to-parallel converter 1, a control signal detector 2, a row and column counter 3, a synchronization word generator 4, an image data delay 5, a data splicer 6 and a spliced ​​data buffer 7.

[0078] Figure 2 FIG. 4 shows a schematic structural diagram of a Cameralink image data encapsulation system according to an embodiment of the present invention; Figure 2 As shown, the image data packaging system includes:

[0079] A serial-to-parallel converter 1, which connects the image differential pair in the CameraLink standard to the serial-to-parallel converter 1 to obtain a synchronous clock signal CLK and a video control signal parallel image data; wherein the video control signal includes a frame synchronization signal FVAL, a line synchronization signal LVAL, and a data valid signal DVAL;

[0080] A control signal detector 2, which sends the synchronous clock signal CLK and the video control signal to the control signal detector 2, detects the use status of the data valid signal DVAL and generates a data enable signal DEN;

[0081] The row and column counter 3 sends the synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN to the row and column counter 3. The row and column counter 3 obtains the current row number row_num and the current column number col_num of the image by counting according to the data enable signal DEN and the synchronous clock CLK.

[0082] The synchronization word generator 4 sends the synchronization clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num to the synchronization word generator 4, and the synchronization word generator 4 delays the input data enable signal DEN by three synchronization clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer 6;

[0083] The image data delayer 5 sends the synchronous clock signal CLK and the parallel image data to the image data delayer. After the parallel image data is delayed by three synchronous clock CLK cycles, it is output to the data splicer 6.

[0084] The data splicer 6 sends the synchronous clock signal CLK, the delayed image data, the synchronization word and the splicing enable signal WEN_S to the data splicer 6;

[0085] The data splicing buffer 7, the data splicing device 6 delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle and assigns it to the cache write enable signal WEN; the synchronous clock signal CLK, the cache write enable signal WEN and the splicing data are sent to the splicing data buffer 7 for reading.

[0086] The beneficial effects of the present invention are described below with a preferred embodiment: Figure 2 As shown;

[0087] Assuming that the total number of rows and columns of the received CameraLink standard image is 512, the total number of columns is 640, and the pixel data width is 14-bit grayscale, this CameraLink image data encapsulation method is implemented based on FPGA, and the program code is written in Verilog.

[0088] S1: Connect the image differential pair in the CameraLink standard to the dedicated serial-to-parallel converter 1 to obtain the synchronous clock signal CLK, video control signals FVAL, LVAL, DVAL, SPACE, and parallel image data.

[0089] S2: Send the synchronous clock signal CLK and the video control signal to the control signal detector 2. The control signal detector 2 detects the rising edge of the frame synchronization signal FVAL, and after detecting the rising edge, when FVAL is high, detects the rising and falling edges of the data valid signal DVAL and counts them.

[0090] The rising and falling edge instantiation modules of the signal are as follows:

[0091]

[0092]

[0093]

[0094]

[0095] In this embodiment, the rising and falling edges of all signals call this program, and only the input and output signals are adjusted accordingly.

[0096] If the number of rising and falling edges of the detected data valid signal DVAL is greater than 1, it is determined that the DVAL in this CameraLink standard is used. At this time, the frame synchronization signal FVAL, the data valid signal DVAL and the line synchronization signal LVAL are ANDed, and the calculation result is assigned to the data enable signal DEN and output.

[0097] If the number of rising and falling edges of the data valid signal DVAL is less than or equal to 1, it is determined that DVAL in this CameraLink standard is not used. At this time, the frame synchronization signal FVAL and the line synchronization signal LVAL are "ANDed", and the calculation result is assigned to the data enable signal DEN and output. When the data enable signal DEN is high, the corresponding image data is valid, and when the data enable signal DEN is low, the corresponding image data is invalid.

[0098] The data enable signal DEN procedure is as follows:

[0099] assign DEN=(DVAL_cnt>'d1)? (FVAL&LVAL&DVAL):(FVAL&LVAL);

[0100] The main function of the control signal detector 2 is to automatically detect the use of DVAL and generate the data enable signal DEN. The control signal detector only works during the first rising edge of the frame synchronization signal FVAL to the first falling edge of the frame synchronization signal FVAL. Before the next system power-on restart, the assignment relationship of the data enable signal DEN is maintained.

[0101] S3: Send the synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN to the row and column counter 3. The row and column counter 3 detects the rising edge and the falling edge of the data enable signal DEN. When the frame synchronization signal FVAL is low, the current row number row_num is assigned a value of 0. When the falling edge of the data enable signal DEN is detected, the current row number row_num is assigned a value that is accumulated by 1 until the frame synchronization signal FVAL is low.

[0102] The current row number row_num program is as follows:

[0103]

[0104]

[0105] When the data enable signal DEN is low, the current column number col_num is assigned a value of 0. When the data enable signal DEN is high, the current column number col_num is assigned a value that is accumulated by 1 at each rising edge of the synchronous clock signal CLK until the data enable signal DEN is low.

[0106] The current column number col_num program is as follows:

[0107]

[0108]

[0109] The row and column counter 3 mainly functions to obtain the current row number row_num and the current column number col_num of the row of the image by counting according to the data enable signal DEN and the synchronization clock CLK.

[0110] S4: Send the synchronization clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num to the synchronization word generator 4. The synchronization word generator 4 detects the rising edge and the falling edge of the frame synchronization signal FVAL and the rising edge and the falling edge of the data enable signal DEN. The image data of the five video transmission modes of the CameraLink standard can be encapsulated using the following five synchronization words.

[0111] / / / ************************************************************************

[0112] / / / Image synchronization word

[0113] / / / ************************************************************************

[0114] / / S: valid start, E: valid end, V: valid, X: any state, W: invalid,

[0115] localparam C_FS_LS_DS = 3'b001; / / frame start, line start, data start

[0116] localparam C_FV_LV_DV = 3'b010; / / frame valid, line valid, data valid

[0117] localparam C_FV_LE_DE = 3'b011; / / frame valid, line end, data end

[0118] localparam C_FV_LS_DS = 3'b100; / / frame valid, line start, data start

[0119] localparam C_FE_LE_DE = 3'b101; / / frame end, line end, data end.

[0120] When the falling edge of the frame synchronization signal FVAL is detected, the 3-bit wide synchronization word S_img_sync is assigned a value of 3'b101, indicating the end of the frame, the end of the line, and the end of the data.

[0121] When the rising edge of the data enable signal DEN is detected, if the current row number row_num value is 0, the 3-bit wide synchronization word S_img_sync is assigned to 3'b001, indicating the start of the frame, the start of the row, and the start of the data. If the current row number row_num value is not 0, the 3-bit wide synchronization word S_img_sync is assigned to 3'b100, indicating that the frame is valid, the row starts, and the data starts.

[0122] When the falling edge of the data enable signal DEN is detected, if the current row number row_num value is 511 (512-1), the 3-bit wide synchronization word S_img_sync is assigned to 3'b101, indicating the end of the frame, the end of the row, and the end of the data. If the current row number row_num value is not 511 (512-1), the 3-bit wide synchronization word S_img_sync is assigned to 3'b011, indicating that the frame is valid, the row is ended, and the data is ended.

[0123] When the rising edge or falling edge of the frame synchronization signal FVAL and the rising edge or falling edge of the data enable signal DEN are not detected, if the data enable signal DEN is high, the 3-bit wide synchronization word S_img_sync is assigned to 3'b010, indicating that the frame is valid, the line is valid, and the data is valid. If the data enable signal DEN is low, the 3-bit wide synchronization word S_img_sync is assigned to 3'b011, indicating that the frame is valid, the line ends, and the data ends.

[0124] The synchronization word S_img_sync program is as follows:

[0125]

[0126]

[0127]

[0128] The synchronization word generator 4 delays the input data enable signal DEN by three synchronization clock CLK cycles, assigns it to the splicing enable signal WEN_S, and outputs it.

[0129] The procedure for splicing enable signal WEN_S is as follows:

[0130]

[0131]

[0132] S5: Send the synchronous clock signal CLK and the parallel image data to the image data delayer 5. After the parallel image data is delayed by three synchronous clock CLK cycles, it is output to the data splicer 6.

[0133] The image data delay 5 program is as follows:

[0134]

[0135] S6: Send the synchronous clock signal CLK, the delayed image data S_valid_databuf3, the synchronization word S_img_sync and the splicing enable signal WEN_S to the data splicer 6. When the splicing enable signal WEN_S is high, the data splicer 6 splices the 3-bit wide synchronization word S_img_sync with the delayed image data. The spliced ​​data S_final_data is 17 bits wide, of which the upper 14 bits are image data and the lower 3 bits are synchronization words.

[0136] The data splicer 6 program is as follows:

[0137]

[0138] S7, the data splicer 6 delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle and assigns it to the cache write enable signal WEN. The synchronous clock signal CLK, the cache write enable signal WEN and the spliced ​​data are sent to the splicing data buffer 7 for reading. When the cache write enable signal WEN is high, the data is written, and when the cache write enable signal WEN is low, no data is written.

[0139] In this embodiment, a large number of synchronous timings are used, and all synchronous clocks CLK are output by the serial-to-parallel converter. The Cameralink image data encapsulation method of this method only adds 4 synchronous clock CLK cycle delays, which is negligible for the total image cycle of 327680 (640*512).

[0140] The Cameralink image data encapsulation system of this embodiment automatically detects the use of DVAL, generates corresponding synchronization words for each image data according to the state of the video control signal, splices the synchronization words with the image data bit by bit, and then caches the spliced ​​data for use. Images with the same transmission mode and the same image data, but with very different CameraLink standard transmission timings, can be encapsulated into completely identical data, and users can collect, process, store, display, correct errors, and transmit the image data according to the synchronization words. This saves data transmission and storage bandwidth, unifies image interfaces, simplifies image encoding and decoding procedures, and reduces standard coordination and conventions.

[0141] The CameraLink image data encapsulation system of this embodiment can be applied to multiple CameraLink image acquisition devices, image information processing circuit boards, and optical fiber transmission devices, thereby improving system compatibility, reducing software development difficulty, and providing an image error correction mechanism.

[0142] An embodiment of the present invention further provides a computer electronic device, Figure 3 FIG. 1 shows a schematic diagram of the structure of an electronic device to which an embodiment of the present invention can be applied. Figure 3 As shown, the computer electronic device includes a central processing module (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, the ROM 302 and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0143] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.

[0144] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0145] As another aspect, the present invention further provides a computer-readable storage medium, which may be a computer-readable storage medium included in a file protection device described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into an electronic device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute a Cameralink image data encapsulation method described in the present invention.

[0146] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.

Claims

1. A Cameralink image data encapsulation method, characterized in that: The image data package includes: Connect the image differential pair in the CameraLink standard to the serial-to-parallel converter to obtain the synchronous clock signal CLK and the video control signal parallel image data; wherein the video control signal includes a frame synchronization signal FVAL, a line synchronization signal LVAL, and a data valid signal DVAL; Sending the synchronous clock signal CLK and the video control signal to the control signal detector, detecting the use status of the data valid signal DVAL and generating a data enable signal DEN; The synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN are sent to the row and column counter, and the row and column counter obtains the current row number row_num and the current column number col_num of the image by counting according to the data enable signal DEN and the synchronous clock CLK; The synchronous clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num are sent to the synchronous word generator, and the synchronous word generator delays the input data enable signal DEN by three synchronous clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer; The synchronous clock signal CLK and the parallel image data are sent to the image data delayer, and the parallel image data is delayed by three synchronous clock CLK cycles and then output to the data splicer; Sending the synchronous clock signal CLK, delayed image data, synchronization word and splicing enable signal WEN_S to a data splicer; The data splicer delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle and assigns it to the cache write enable signal WEN; sends the synchronous clock signal CLK, the cache write enable signal WEN and the splicing data to the splicing data buffer for reading.

2. The image data encapsulation method according to claim 1, characterized in that: The step of sending the synchronous clock signal CLK and the video control signal to the control signal detector, detecting the use status of the data valid signal DVAL and generating the data enable signal DEN comprises: The control signal detector detects the rising edge of the frame synchronization signal FVAL, and after detecting the rising edge, when FVAL is high, detects the rising edge and falling edge of the data valid signal DVAL and counts them.

3. The image data encapsulation method according to claim 2, characterized in that: If the number of rising edges and falling edges of the detected data valid signal DVAL is greater than 1, it is determined that the DVAL in this CameraLink standard is used; at this time, the three signals of the frame synchronization signal FVAL, the data valid signal DVAL and the line synchronization signal LVAL are "ANDed", and the calculation result is assigned to the data enable signal DEN and output; If the number of rising and falling edges of the detected data valid signal DVAL is less than or equal to 1, it is determined that DVAL in this CameraLink standard is not used; at this time, the frame synchronization signal FVAL and the line synchronization signal LVAL are "ANDed", and the calculation result is assigned to the data enable signal DEN and output.

4. The image data encapsulation method according to claim 1, characterized in that: The synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN are sent to the row and column counter, and the row and column counter obtains the current row number row_num and the current column number col_num of this row of this image by counting according to the data enable signal DEN and the synchronous clock CLK. The row and column counter detects the rising and falling edges of the data enable signal DEN. When the frame synchronization signal FVAL is low, the current row number row_num is assigned a value of 0. When the falling edge of the data enable signal DEN is detected, the current row number row_num is assigned a value that is accumulated by 1 until the frame synchronization signal FVAL is low. When the data enable signal DEN is low, the current column number col_num is assigned a value of 0. When the data enable signal DEN is high, the current column number col_num is assigned a value that is accumulated by 1 at each rising edge of the synchronous clock signal CLK until the data enable signal DEN is low.

5. The image data encapsulation method according to claim 1, characterized in that: The synchronous clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num are sent to the synchronous word generator, the synchronous word generator delays the input data enable signal DEN by three synchronous clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer, including: The synchronization word generator detects the rising edge and the falling edge of the frame synchronization signal FVAL, and detects the rising edge and the falling edge of the data enable signal DEN; When the falling edge of the frame synchronization signal FVAL is detected, the 3-bit wide synchronization word S_img_sync is assigned C_FE_LE_DE, indicating the end of the frame, the end of the line, and the end of the data; When the rising edge of the data enable signal DEN is detected, if the current row number row_num value is 0, the 3-bit wide synchronization word S_img_sync is assigned to C_FS_LS_DS, indicating the start of the frame, the start of the row, and the start of the data; if the current row number row_num value is not 0, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LS_DS, indicating that the frame is valid, the row starts, and the data starts; When the falling edge of the data enable signal DEN is detected, if the current row number row_num value is the total number of image rows minus 1, the 3-bit wide synchronization word S_img_sync is assigned to C_FE_LE_DE, indicating the end of the frame, the end of the row, and the end of the data; if the current row number row_num value is not the total number of image rows minus 1, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LE_DE, indicating that the frame is valid, the row is ended, and the data is ended; When neither the rising edge nor the falling edge of the frame synchronization signal FVAL nor the rising edge nor the falling edge of the data enable signal DEN is detected, if the data enable signal DEN is high, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LV_DV, indicating that the frame is valid, the row is valid, and the data is valid; if the data enable signal DEN is low, the 3-bit wide synchronization word S_img_sync is assigned to C_FV_LE_DE, indicating that the frame is valid, the row is ended, and the data is ended.

6. The image data encapsulation method according to claim 5, characterized in that: When the splicing enable signal WEN_S is high, the data splicer performs bit splicing on the 3-bit wide synchronization word S_img_sync and the delayed image data, and the 3-bit wide synchronization word S_img_sync occupies the lower three bits.

7. The image data encapsulation method according to any one of claims 1 to 6, characterized in that: When the cache write enable signal WEN is high, data is written, and when the cache write enable signal WEN is low, no data is written.

8. A Cameralink image data encapsulation system, characterized in that: The image data packaging system comprises: A serial-to-parallel converter, connecting the image differential pair in the CameraLink standard to the serial-to-parallel converter to obtain a synchronous clock signal CLK and a video control signal parallel image data; wherein the video control signal includes a frame synchronization signal FVAL, a line synchronization signal LVAL, and a data valid signal DVAL; A control signal detector, which sends the synchronous clock signal CLK and the video control signal to the control signal detector, detects the use status of the data valid signal DVAL and generates a data enable signal DEN; A row-column counter, wherein the synchronous clock signal CLK, the frame synchronization signal FVAL and the data enable signal DEN are sent to the row-column counter, and the row-column counter obtains the current row number row_num and the current column number col_num of the image by counting according to the data enable signal DEN and the synchronous clock CLK; A synchronization word generator, which sends the synchronization clock signal CLK, the frame synchronization signal FVAL, the data enable signal DEN, the current row number row_num and the current column number col_num to the synchronization word generator, and the synchronization word generator delays the input data enable signal DEN by three synchronization clock CLK cycles, assigns it to the splicing enable signal WEN_S and outputs it to the data splicer; An image data delayer, which sends the synchronous clock signal CLK and the parallel image data to the image data delayer, and the parallel image data is delayed by three synchronous clock CLK cycles and then output to the data splicer; A data splicer, which sends the synchronous clock signal CLK, delayed image data, synchronization word and splicing enable signal WEN_S to the data splicer; The data splicing buffer delays the input splicing enable signal WEN_S by one synchronous clock CLK cycle and assigns it to the cache write enable signal WEN; the synchronous clock signal CLK, the cache write enable signal WEN and the splicing data are sent to the splicing data buffer for reading.

9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.