Simulation camera interface de-interlacing optimization method and system
By obtaining the original image data and frame information data of the analog camera, and using the I2C bus to read the data field information register of the video decoder to determine the category information of the current frame, the sawtooth and flickering problems of the analog camera when using interlaced scanning in fast motion scenes are solved, and the clarity and stability of the image are improved.
Patent Information
- Application Number
- CN202411736502.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-11-29
AI Technical Summary
When the simulated camera uses interlaced scanning in fast motion scenes, obvious jagged and flickering may occur, affecting the clarity and stability of the image. The relevant methods may set the top and bottom fields inversely, resulting in a degradation of the image quality.
By acquiring the original image data and frame information data of the analog camera, reading the data field information register of the video decoder using the I2C bus, determining the category information of the current frame, and then performing deinterlacing operation processing.
The image quality of the displayed video image is improved, the problem of setting inverse to the top and bottom fields is avoided, and the clarity and stability of the image is enhanced.
Smart Images

Figure CN119767134A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of video image processing, and in particular to an optimization method and system for de-interlacing of an analog camera interface. Background Art
[0002] In the power usage scenario, analog cameras are chosen for image acquisition. Generally, several analog cameras are connected to a video decoding chip to acquire, splice and convert the analog camera data into digital signals, which are then transmitted to the main controller SOC through the MIPI-CSI interface. After the main controller acquires the data, it undergoes various processing and finally performs LCD display or other actions. Among them, interlaced scanning of analog cameras is a common video scanning method. Interlaced scanning divides a frame of image into two fields, namely odd fields and even fields. The odd field scans odd lines, and the even field scans even lines. In this way, the amount of information transmitted per unit time is reduced by half, reducing the requirements for transmission bandwidth. However, interlaced scanning may cause obvious jagged and flickering phenomena in fast-moving scenes, affecting the clarity and stability of the image. The relevant method is implemented by software, but it may set the top field and bottom field in reverse, resulting in a worse effect than the original image.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose an optimized method and system for deinterlacing of an analog camera interface, which can determine the category information of the current frame of the original image data before performing the deinterlacing operation, thereby improving the image quality of the displayed video image.
[0005] To achieve the above-mentioned purpose, an embodiment of the present application provides an optimization method for analog camera interface deinterlacing, the method comprising:
[0006] Acquire raw image data of a simulated camera and frame information data corresponding to the raw image data;
[0007] According to the frame information data, the original image data is subjected to a deinterlacing operation to obtain image data after the deinterlacing operation;
[0008] The image data processed by the deinterlacing operation is read and displayed to obtain the image data after display.
[0009] In some embodiments, the acquiring of raw image data of a simulated camera and frame information data corresponding to the raw image data includes:
[0010] Acquire raw image data of the simulated camera;
[0011] The thread for reading the field information is awakened, and parameter reading processing is performed on the register of the analog camera through the I2C bus to obtain frame information data corresponding to the original image data.
[0012] In some embodiments, the obtaining of raw image data of the simulated camera includes:
[0013] Transmitting the raw image data of the analog camera to the main controller in the form of an interrupt signal;
[0014] Based on the main controller, judging the frame completion flag bit of the CS I status register;
[0015] If the frame completion flag does not have a set flag, continue to monitor the frame completion flag of the CS I status register;
[0016] If the frame completion flag has the set flag, the original image data of the analog camera is acquired and stored in the data buffer.
[0017] In some embodiments, it also includes:
[0018] Submit the next data buffer to the CS I hardware and clear the frame complete flag of the CS I status register.
[0019] In some embodiments, the frame information data corresponding to the original image data includes top frame information of the original image data and bottom frame information of the original image data.
[0020] In some embodiments, performing a deinterlacing operation on the original image data according to the frame information data to obtain image data after the deinterlacing operation includes:
[0021] Define input ring buffer and output ring buffer;
[0022] Inputting the raw image data into the input ring buffer;
[0023] Perform logical reasoning and judgment according to the frame information data to construct a first parameter and a second parameter;
[0024] Based on the first parameter and the second parameter, a de-interlacing operation is performed on the original image data in the input ring buffer, and the processing result is input into the output ring buffer to obtain the image data after the de-interlacing operation.
[0025] In some embodiments, performing logical reasoning and judgment according to the frame information data to construct the first parameter and the second parameter includes:
[0026] Determining a current frame of the frame information data;
[0027] If the current frame of the frame information data is the top frame information, marking the current frame of the frame information data as the first parameter, and marking the next frame of the frame information data as the second parameter;
[0028] If the current frame of the frame information data is the bottom frame information, the current frame of the frame information data is marked as the second parameter, and the next frame of the frame information data is marked as the first parameter.
[0029] In some embodiments, performing a deinterlacing operation on the original image data in the input ring buffer based on the first parameter and the second parameter, and inputting the processing result into the output ring buffer to obtain the image data after the deinterlacing operation, includes:
[0030] According to the first parameter and the second parameter, the original image data in the input ring buffer is divided and processed to obtain divided images;
[0031] A de-interlacing operation is performed on the divided image, and the processing result is input into the output ring buffer to obtain image data after the de-interlacing operation.
[0032] In some embodiments, it also includes:
[0033] The divided image includes odd rows and even rows, the first parameter is filled into the odd rows, and the second parameter is filled into the even rows.
[0034] To achieve the above object, another aspect of the embodiment of the present application provides an optimization system for analog camera interface deinterlacing, the system comprising:
[0035] The first module is used to obtain the original image data of the simulated camera and the frame information data corresponding to the original image data;
[0036] The second module is used to perform a deinterlacing operation on the original image data according to the frame information data to obtain image data after the deinterlacing operation;
[0037] The third module is used to read the image data after the deinterlacing operation and perform display processing to obtain the image data after display.
[0038] The embodiments of the present application include at least the following beneficial effects: the present application provides an optimized method and system for deinterlacing of an analog camera interface, the scheme obtains the original image data of the analog camera and the frame information data corresponding to the original image data, and then performs a deinterlacing operation on the original image data according to the frame information data, that is, reads the data field information register of the video decoder through the I2C bus, so that the main controller determines the category information of the current frame of the original image data before performing the deinterlacing operation, avoiding the problem that the related methods may set the top field and the bottom field oppositely, thereby improving the image quality of the displayed video image. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flow chart of an optimization method for analog camera interface deinterlacing provided by an embodiment of the present application;
[0040] Figure 2 It is a structural schematic diagram of an optimization system for analog camera interface de-interlacing provided by an embodiment of the present application;
[0041] Figure 3 It is a schematic diagram of a framework for deinterlacing and displaying original image data provided by an embodiment of the present application;
[0042] Figure 4 is a schematic diagram of frame mode deinterlacing provided in an embodiment of the present application;
[0043] Figure 5 is a schematic diagram of field mode deinterlacing provided in an embodiment of the present application;
[0044] Figure 6 is a schematic diagram of a process of a main controller receiving raw image data provided by an embodiment of the present application;
[0045] Figure 7 It is a schematic diagram of a process of deinterlacing original image data provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of systems and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0047] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0048] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0050] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0051] 1) SoC internal video acquisition device (mipi-csi): MIPI-CSI is a high-speed serial interface used to connect camera sensors (or image sensors) to host controllers (such as SoCs). The MIPI-CSI protocol supports high-bandwidth, low-power data transmission and is widely used in mobile devices and embedded systems.
[0052] 2) Top field in interlaced video image: The top field is the first part in interlaced scanning, usually containing the even-numbered lines of the image (0, 2, 4, ... lines). In each complete image frame, the top field is transmitted first and is usually identified as Field 1. The quality and content of the top field determines the upper half of the image.
[0053] 3) Bottom field in interlaced video image: The bottom field is the second part of the interlaced scan, containing the odd-numbered lines of the image (1, 3, 5, ... lines). In a complete image frame, the bottom field is usually transmitted after the top field and is identified as Field 2. The bottom field determines the lower half of the image.
[0054] 4) Deinterlacing: Deinterlacing is the process of converting an interlaced image into a progressive scan image. Through interpolation, motion compensation and other methods, the top field and bottom field data are merged to generate the final frame.
[0055] There are some deficiencies in the related technology. For example, since MIPI-CSI has no concept of fields, it can only determine whether it is a top frame or a bottom frame based on the CNT of the frame (for example, the count CNT of the frame). Therefore, if one of the fields is wrong or lost, it cannot be corrected automatically, and the jagged phenomenon will occur with a probability of being filled in reverse.
[0056] In view of this, an optimized method for deinterlacing of an analog camera interface is provided in an embodiment of the present application. The data field information register of the video decoder is read through the I2C bus, so that the main controller determines the category information of the current frame of the original image data before performing the deinterlacing operation, thereby avoiding the problem that the related methods may set the top field and the bottom field oppositely, thereby improving the image quality of the displayed video image.
[0057] Reference Figure 1 , Figure 1 A flowchart of an optimization method for deinterlacing an analog camera interface provided by an embodiment of the present invention, referring to Figure 1 , the method comprises the following steps:
[0058] S100, obtaining original image data of a simulated camera and frame information data corresponding to the original image data;
[0059] It should be noted that, in some embodiments, step S100 may include:
[0060] S110, obtaining original image data of the simulated camera;
[0061] It should be noted that, in some embodiments, step S110 may include: S111, transmitting the raw image data of the analog camera to the main controller in the form of an interrupt signal; S112, judging the frame completion flag of the CS I status register based on the main controller; S113, if the frame completion flag does not have a set flag, continuing to monitor the frame completion flag of the CS I status register; S114, if the frame completion flag has a set flag, obtaining the raw image data of the analog camera and storing it in the data buffer.
[0062] S120, waking up the thread for reading the field information, performing parameter reading processing on the register of the analog camera through the I2C bus, and obtaining frame information data corresponding to the original image data.
[0063] In some specific embodiments, Figure 3As shown in the figure, several analog cameras are connected to a video decoding chip, and the analog camera data is collected, spliced and converted into digital signals, and then transmitted to the main controller SOC through the MIPI-CS I interface. When the SOC receives the image data of the MIPI-CS I, it reads the data field information register of the video decoder through the I2C bus. After the main controller collects the data, it undergoes various processing and finally performs LCD display or other actions.
[0064] Among them, the parameter reading process of the register of the analog camera through the I2C bus is explained. By controlling the I2C to read a data, it is possible to judge whether it is the top by judging the data after getting the data. For example, if 0x0 is read, it means the top field, and 0x1 means the bottom. In this way, the SOC can know whether the current frame is the top frame or the bottom frame, which is beneficial to subsequent image processing.
[0065] In summary, if Figure 6 As shown, data will be transmitted from the CVBS camera in the form of an interrupt; after the SOC receives the interrupt signal, it checks whether the frame completion flag of the CSI status register is set. If it is not set, it means that the previous frame is still being processed, then continue to monitor the frame completion flag of the status register until the frame completion flag is set; after the frame completion flag is successfully set, it means that the corresponding CSI hardware is ready to receive this frame of data. Then the data buffer buff of the next frame is given to the hardware (the subsequent hardware will automatically put the received data into this data buffer buf); further, various flags need to be cleared; wake up the field information reading thread. After the new thread is awakened, read the value of a specific register through the I2C bus. Update this value to the structure of the current frame buff, and then enter the thread waiting.
[0066] Through the explanation of the above operations, the SOC will finally get a complete frame of data. This frame of data not only contains the data itself, but also contains some parameter values of specific registers on the camera side read through the I2C bus, which is ready for the subsequent de-interlacing operation.
[0067] S200, performing a deinterlacing operation on the original image data according to the frame information data to obtain image data after the deinterlacing operation;
[0068] It should be noted that, in some embodiments, step S200 may include:
[0069] S210, defining an input ring buffer and an output ring buffer;
[0070] It should be noted that the input ring buffer (input_ring_buffer) represents the ring buff input by the camera, and the output ring buffer (output_ring_buffer) represents the ring buff output by the camera.
[0071] S220, inputting the original image data into the input ring buffer;
[0072] S230, performing logical reasoning and judgment according to the frame information data to construct a first parameter and a second parameter;
[0073] In this embodiment, the current frame of the frame information data is judged; if the current frame of the frame information data is the top frame information, the current frame of the frame information data is marked as the first parameter, and the next frame of the frame information data is marked as the second parameter; if the current frame of the frame information data is the bottom frame information, the current frame of the frame information data is marked as the second parameter, and the next frame of the frame information data is marked as the first parameter.
[0074] S240 , based on the first parameter and the second parameter, perform a deinterlacing operation on the original image data in the input ring buffer, and input the processing result into the output ring buffer to obtain image data after the deinterlacing operation.
[0075] First of all, it should be noted that interlaced scanning of analog cameras is a common video scanning method. Interlaced scanning divides a frame of image into two fields, namely odd field and even field. The odd field scans odd lines, and the even field scans even lines. In this way, the amount of information transmitted per unit time is reduced by half, reducing the requirement for transmission bandwidth.
[0076] For the output of the MIPI-CSI interface, there are two modes: frame mode and field mode.
[0077] Among them, Figure 4 As shown, for the frame mode, the front-end input frame size is a 960x480 frame mode, wherein the upper part 960x240 is the top field, and the lower part 960x240 is the bottom field.
[0078] like Figure 5 As shown, for the field mode, the front-end input frame size is 960x240 field mode, where 1 / 3 / 5 / 7... frames are top, 2 / 4 / 6 / 8... frames are bottom, and CSI fills the odd frames in the odd rows of buf and the even frames in the even rows of buf, thus achieving deinterlacing.
[0079] However, the above method can only determine whether it is a top frame or a bottom frame based on the cnt of the frame. Therefore, if one of the frames is reported as an error or lost, it cannot be automatically corrected, and there is a probability that the frame will be filled in reverse and a jagged phenomenon will occur.
[0080] Therefore, in this embodiment, the original image data in the input ring buffer is divided and processed according to the first parameter and the second parameter, the divided image includes odd rows and even rows, the first parameter is filled in the odd rows, the second parameter is filled in the even rows, and then the deinterlacing operation is performed according to the divided image, and the processing result is input into the output ring buffer to obtain the image data after the deinterlacing operation.
[0081] In some specific embodiments, Figure 7 As shown, the next frame data of the ring buff input by the camera is obtained, one or more parameter values of the specific register on the camera side are obtained from the frame data, and it is determined whether this frame is the top field. If the current frame is the top field, the current frame is used as the first parameter of the deinterlacing operation, and the next frame is used as the second parameter. If the current frame is not the top field, the current frame is used as the second parameter of the deinterlacing operation, and the next frame is used as the second parameter. The above two parameters are used to perform the deinterlacing operation to obtain the processed data and put it in the output ring buff.
[0082] S300, reading the image data after the de-interlacing operation and performing display processing to obtain the image data after display;
[0083] Finally, this solution is explained in combination with actual engineering cases. There is a reset button next to or on the old display on traditional aircraft. If you see sawtooth on the display pattern, press the reset button and the picture will get better. The principle is: if there is sawtooth, it means that there is an error in the data of the top field and the bottom field when deinterlacing, that is, the top field and the bottom field are set up in reverse. After pressing it, the top field and the bottom field are reversed and interlaced, and the original image information is restored. Based on this, this solution method corrects the top field and the bottom field by automated means. In the scenario of analog camera and transmission using mipi-csi interface, the data field information register of the video decoder is read through the I2C bus, so that the SOC can know in real time whether the camera data it obtains is the top field or the bottom field, which is conducive to the subsequent deinterlacing processing. Otherwise, the SOC cannot know the field information. When the camera or some environmental factors cause data link errors or abnormalities, and one or several frames are lost, the change of the field may cause the deinterlaced data to be worse than the original data.
[0084] See also Figure 2 The embodiment of the present application further provides an optimization system for analog camera interface deinterlacing, which can implement the above-mentioned optimization method for analog camera interface deinterlacing, and the system includes:
[0085] The first module 201 is used to obtain the original image data of the simulated camera and the frame information data corresponding to the original image data;
[0086] The second module 202 is used to perform a deinterlacing operation on the original image data according to the frame information data to obtain image data after the deinterlacing operation;
[0087] The third module 203 is used to read the image data after the de-interlacing operation and perform display processing to obtain the image data after display.
[0088] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0089] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the rights of the present application is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present application should be within the scope of the rights of the present application.
Claims
1. An optimization method for deinterlacing of an analog camera interface, characterized in that: The method comprises the following steps: Acquire raw image data of a simulated camera and frame information data corresponding to the raw image data; According to the frame information data, the original image data is subjected to a deinterlacing operation to obtain image data after the deinterlacing operation; The image data processed by the deinterlacing operation is read and displayed to obtain the image data after display.
2. The method according to claim 1, characterized in that The acquiring of the original image data of the simulated camera and the frame information data corresponding to the original image data comprises: Acquire raw image data of the simulated camera; The thread for reading the field information is awakened, and parameter reading processing is performed on the register of the analog camera through the I2C bus to obtain frame information data corresponding to the original image data.
3. The method according to claim 2, characterized in that The obtaining of the original image data of the simulated camera comprises: Transmitting the raw image data of the analog camera to the main controller in the form of an interrupt signal; Based on the main controller, judging the frame completion flag bit of the CSI status register; If the frame completion flag does not have a set flag, continue to monitor the frame completion flag of the CSI status register; If the frame completion flag has the set flag, the original image data of the analog camera is acquired and stored in the data buffer.
4. The method according to claim 3, characterized in that Also includes: Submit the next data buffer to the CSI hardware and clear the frame completion flag of the CSI status register.
5. The method according to claim 2, characterized in that: The frame information data corresponding to the original image data includes top frame information of the original image data and bottom frame information of the original image data.
6. The method according to claim 5, characterized in that The step of performing a deinterlacing operation on the original image data according to the frame information data to obtain image data after the deinterlacing operation comprises: Define input ring buffer and output ring buffer; Inputting the raw image data into the input ring buffer; Perform logical reasoning and judgment according to the frame information data to construct a first parameter and a second parameter; Based on the first parameter and the second parameter, a de-interlacing operation is performed on the original image data in the input ring buffer, and the processing result is input into the output ring buffer to obtain the image data after the de-interlacing operation.
7. The method according to claim 6, characterized in that The performing logical reasoning and judgment according to the frame information data to construct the first parameter and the second parameter includes: Determining a current frame of the frame information data; If the current frame of the frame information data is the top frame information, marking the current frame of the frame information data as the first parameter, and marking the next frame of the frame information data as the second parameter; If the current frame of the frame information data is the bottom frame information, the current frame of the frame information data is marked as the second parameter, and the next frame of the frame information data is marked as the first parameter.
8. The method according to claim 6, characterized in that The method of performing a deinterlacing operation on the original image data in the input ring buffer based on the first parameter and the second parameter, and inputting the processing result into the output ring buffer to obtain the image data after the deinterlacing operation, includes: According to the first parameter and the second parameter, the original image data in the input ring buffer is divided and processed to obtain divided images; A de-interlacing operation is performed on the divided image, and the processing result is input into the output ring buffer to obtain image data after the de-interlacing operation.
9. The method according to claim 8, characterized in that Also includes: The divided image includes odd rows and even rows, the first parameter is filled into the odd rows, and the second parameter is filled into the even rows.
10. An optimized system for deinterlacing of an analog camera interface, characterized in that: The system comprises: The first module is used to obtain the original image data of the simulated camera and the frame information data corresponding to the original image data; The second module is used to perform a deinterlacing operation on the original image data according to the frame information data to obtain image data after the deinterlacing operation; The third module is used to read the image data after the deinterlacing operation and perform display processing to obtain the image data after display.
Citation Information
Patent Citations
Auxiliary signal synchronization for closed captioning insertion
CN1663247A
Apparatus and method for video de-interlace
US20080068497A1
Method and apparatus for processing video signal
US20180098024A1