Data processing method and device, chip, electronic equipment and traffic equipment
By reading the image frames collected by the camera and comparing their parameters, determining their effectiveness and storing them into memory frames, the problems of missing field information in interlaced scanning and misjudging parity field order are solved, and the robustness and picture quality of the video equipment are improved.
Patent Information
- Application Number
- CN202411844805.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-25
AI Technical Summary
During interlacing, existing video devices cause field information to be lost or incomplete due to cost and bandwidth limitations, and the receiver lacks robustness, which makes it easy to misjudge the parity field order, resulting in sawtoothing, jitter and blurred images after deinterleaving.
By reading the image frames captured by the camera, they obtain their actual parameters, such as parity field parameters, number of rows and number of pixels, and based on the comparison of preset parameters and actual parameters, the validity of the image frame is determined and discarded when invalid; when valid, the base address of the image frame is determined and stored in the memory frame.
It effectively avoids the loss or incomplete field information, improves the robustness of data processing, significantly improves the picture quality after the display is sent, and prevents field chaos and incorrect field order judgment.
Smart Images

Figure CN119893007A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data processing method, device, chip, electronic equipment and transportation equipment. Background Art
[0002] Some video devices, such as analog cameras in surveillance systems, use interlaced scanning due to cost and bandwidth limitations. Interlaced scanning means that each image frame is divided into two fields, each field contains all odd scan lines or even scan lines in a frame. Usually, the odd lines are scanned first to get the first field, which we call the odd field, and then the even lines are scanned to get the second field, which we call the even field. In order to get a better video image effect, the receiving end needs to perform deinterlacing, that is, to restore the interlaced lines to progressive scanning.
[0003] The interlaced scanning order of different standards may be different. Some standards produce odd fields first and even fields later. Some standards produce even fields first and odd fields later. In addition, if there are force majeure such as loose wiring harness or device restart at the sender or receiver during the work process, the field information will be lost or the field will be incomplete. If the receiver is not robust enough and it is completely left to the software to judge whether it is an odd field or an even field, it is easy to cause the receiver to get the field order wrong, and the deinterlaced image will have obvious jagged edges, and even jitter and blur. Moreover, this error is irreversible unless the system is restarted or a soft reset is performed. Summary of the invention
[0004] The present application provides a data processing method, device, chip, electronic equipment and transportation equipment.
[0005] On the one hand, an embodiment of the present application provides a data processing method, the method comprising:
[0006] Read the image frame captured by the camera, and obtain actual parameters of the image frame, wherein the actual parameters include odd and even field parameters, the number of rows, and the number of pixels in each row of the image frame;
[0007] In the case where the image frame is determined to be an invalid frame based on preset parameters and the actual parameters, the image frame is discarded, the preset parameters including preset odd and even field parameters, a preset number of rows and a preset number of pixels per row, the preset number of rows and the preset number of pixels per row being determined based on a preset number of image frames at the start of reading;
[0008] In the case where the image frame is determined to be a valid frame based on the preset parameters and the actual parameters, a base address corresponding to the image frame is determined based on the actual parameters, wherein the base address is determined based on the preset number of rows and the preset number of pixels per row;
[0009] The image frame is stored in a memory frame based on the base address.
[0010] Wherein, the preset parameters further include a preset identification bit, and determining that the image frame is a valid frame based on the preset parameters and the actual parameters includes:
[0011] Determining an odd-even field type of the image frame based on an odd-even field parameter of the image frame;
[0012] If it is determined that the preset flag indicates that the previous image frame has not been stored in the memory and the parity field type of the image frame is the same as the parity field type indicated by the preset parity field parameters, the image frame is determined to be a valid frame, and the preset flag is modified so that the preset flag indicates that the previous image frame has been stored in the memory, and the parity field type of the previous image frame is the same as the parity field type indicated by the preset parity field parameters.
[0013] Wherein, determining the image frame as a valid frame based on the preset parameters and the actual parameters includes:
[0014] If it is determined that the preset flag indicates that a previous image frame has been stored in the memory and the odd and even field type of the image frame is different from the odd and even field type indicated by the preset odd and even field parameters, the image frame is determined to be a valid frame, and the preset flag is modified so that the preset flag indicates that the previous image frame has not been stored in the memory.
[0015] Wherein, determining the image frame as a valid frame based on the preset parameters and the actual parameters includes:
[0016] Comparing the number of rows and the number of pixels in each row of the image frame with the preset number of rows and the preset number of pixels in each row;
[0017] If the comparison passes, the image frame is determined to be a valid frame.
[0018] The step of comparing the number of rows and the number of pixels in each row of the image frame with the preset number of rows and the preset number of pixels in each row comprises:
[0019] Determining the total number of pixels of the image frame based on the number of rows of the image frame and the number of pixels in each row;
[0020] Determining a standard total number of pixels based on the preset number of rows and the preset number of pixels;
[0021] Comparing the total number of pixels of the image frame with the standard total number of pixels;
[0022] If the comparison passes, the image frame is determined to be a valid frame.
[0023] Wherein, determining the base address corresponding to the image frame based on the actual parameter includes:
[0024] Determining an odd-even field type of the image frame based on an odd-even field parameter of the image frame;
[0025] If the odd-even field type of the image frame is an odd field, determining that the base address corresponding to the image frame is a first base address;
[0026] If the odd-even field type of the image frame is an even field, the base address corresponding to the image frame is determined to be a second base address, and the address space indicated by the second base address differs from the address space indicated by the first base address by one row.
[0027] Another aspect of the present application provides a data processing device, the device comprising:
[0028] A transmission module, used for reading the image frame collected by the camera and obtaining the actual parameters of the image frame, wherein the actual parameters include the odd and even field parameters, the number of rows and the number of pixels in each row of the image frame;
[0029] a processing module, configured to discard the image frame if it is determined that the image frame is an invalid frame based on preset parameters and the actual parameters, the preset parameters including preset odd and even field parameters, a preset number of rows and a preset number of pixels per row, the preset number of rows and the preset number of pixels per row being determined based on a preset number of image frames starting from reading;
[0030] The processing module is further configured to determine a base address corresponding to the image frame based on the actual parameters when the image frame is determined to be a valid frame based on the preset parameters and the actual parameters, wherein the base address is determined based on the preset number of rows and the preset number of pixels per row;
[0031] The transmission module is further used to store the image frame into a memory frame based on the base address.
[0032] On the other hand, the present application provides a chip, the chip includes a processor, and the processor can execute the data processing method.
[0033] Another aspect of the present application provides an electronic device, the electronic device includes a component, the component includes a chip, and the chip can execute the data processing method.
[0034] On the other hand, the present application provides a traffic device, which includes a chip, and the chip can execute the data processing method.
[0035] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein:
[0037] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0038] Figure 1 A flow chart showing a data processing method according to an embodiment of the present application is shown;
[0039] Figure 2 A flow chart showing a data processing method according to another embodiment of the present application is shown;
[0040] Figure 3 A flow chart showing a data processing method according to another embodiment of the present application is shown;
[0041] Figure 4 A flow chart showing a data processing method according to another embodiment of the present application is shown;
[0042] Figure 5 A flow chart showing a data processing method according to another embodiment of the present application is shown;
[0043] Figure 6 A schematic diagram of storing image frames according to an embodiment of the present application is shown;
[0044] Figure 7 A schematic diagram of storing image frames according to another embodiment of the present application is shown;
[0045] Figure 8 A schematic diagram showing the structure of a data processing device according to an embodiment of the present application is shown;
[0046] Fig. 9 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0047] In order to make the purpose, features, and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0048] In order to avoid field confusion (i.e., odd-even field error) or the situation where field information is lost or image frames with incomplete fields are sent for display when reading image frames captured by a camera, and to improve the robustness of data processing, an embodiment of the present application provides a data processing method, such as Figure 1 As shown, the method includes:
[0049] Step 101, read the image frame captured by the camera, and obtain actual parameters of the image frame, wherein the actual parameters include odd and even field parameters, the number of rows, and the number of pixels in each row of the image frame.
[0050] In this embodiment, the camera interface control unit (CSI, ca mera sensor interface ) to read the image frames captured by the camera, and synchronously obtain the actual parameters of the read image frames. In other implementations, any other hardware that can read the image frames captured by the camera and process the image frames can be used.
[0051] In this embodiment, the actual parameters of the image frame include odd and even field parameters, the number of rows and the number of pixels in each row of the image frame. In other implementations, the actual parameters of the image frame may include any other image parameters.
[0052] The odd and even field parameters of an image frame can characterize whether the image frame is an odd field image frame or an even field image frame. In video signal processing, the odd and even field parameters are obtained by interlaced scanning. Interlaced scanning is a video display method in which each frame of an image is divided into two fields, each field containing half the number of lines of the image, one is the odd field, which usually includes the odd lines in the image frame (1, 3, 5...). The other is the even field, which usually includes the even lines in the image frame (2, 4, 6...). The odd and even field parameters are usually represented by a field identifier. For example, when the field identifier of the odd and even field parameter is binary, 0 represents the even field and 1 represents the odd field.
[0053] Step 102, when it is determined that the image frame is an invalid frame based on preset parameters and the actual parameters, the image frame is discarded, the preset parameters include preset odd and even field parameters, a preset number of rows and a preset number of pixels per row, and the preset number of rows and the preset number of pixels per row are determined based on a preset number of image frames starting from the read.
[0054] In this embodiment, there are two situations where the image frame is an invalid frame:
[0055] The first is odd-even field error. For example, under the current standard, the odd field image frame should be output first, and then the even field image frame, but the even field image frame is output first. At this time, if it continues to be sent for display, it will cause field confusion.
[0056] The second is that the field information of the image frame is lost or the field is incomplete. For example, under the current format, the odd-field image frame should be 200 lines, each line has 1000 pixels, but the currently read odd-field image frame is 199 lines, missing a line of data. At this time, if it continues to be sent for display, the picture display will be incomplete.
[0057] In other implementations, situations where the image frame is an invalid frame may also include frame duplication, synchronization error, signal interference, color distortion, frame skipping, etc.
[0058] When the currently read image frame is determined to be an invalid frame through preset parameters and actual parameters, continuing to display it will cause display problems. Therefore, it is necessary to discard the currently read image frame and continue to read the next image frame.
[0059] Since the number of rows and the number of pixels per row of the read image frame occasionally do not match the fixed preset parameters, in this embodiment, the preset number of rows and the preset number of pixels per row in the preset parameters are determined by reading the initial preset number of image frames, so as to avoid the above situation causing errors in the determination of invalid frames.
[0060] Step 103, when the image frame is determined to be a valid frame based on preset parameters and the actual parameters, a base address corresponding to the image frame is determined based on the actual parameters, and the base address is determined based on the preset number of rows and the preset number of pixels per row.
[0061] When it is determined through the preset parameters and the actual parameters that the currently read image frame does not have the above-mentioned invalid frame, the currently read image frame is determined as a valid frame, and the base address corresponding to the image frame is determined based on the actual parameters of the image frame.
[0062] In this embodiment, it can be determined by the odd and even field parameters, the number of rows and the number of pixels in each row in the actual parameters of the image frame. For example, when the storage method is row-by-row storage, the starting address of the memory frame is B, and the number of pixels in each row is R, then the base address corresponding to the data of the i-th row in the odd-field image frame is B+(2i+1)R, where i is an integer greater than or equal to 0. The base address corresponding to the data of the j-th row in the even-field image frame is B+2jR, where j is an integer greater than 0. For another example, when the storage method is field-by-field storage, the starting address of the memory frame is B, the total number of rows of the image frame (the sum of the number of rows of the odd-field image frame and the number of rows of the even-field image frame) is H, and the number of pixels in each row is R, then the base address corresponding to the odd-field image frame is B, and the base address corresponding to the even-field image frame is
[0063] Step 104: storing the image frame into a memory frame based on the base address.
[0064] Based on the determined base address, the image frame is stored in the corresponding position in the memory frame.
[0065] In the above scheme, the actual parameters of the image frame are compared with the preset parameters to determine whether the image frame is an invalid frame or a valid frame. When the image frame is determined to be an invalid frame, the image frame is discarded. When the image frame is determined to be a valid frame, the base address corresponding to the image frame is further determined based on the actual parameters of the image frame, and then the image frame is sent for display, which effectively avoids the situation where field confusion occurs when reading the image frame captured by the camera or the image frame with lost field information or incomplete field is sent for display, improves the robustness of data processing, and significantly improves the picture quality presented after sending for display.
[0066] In an example of the present application, a data processing method is also provided, such as Figure 2 As shown, the preset parameters also include a preset identification bit, and determining that the image frame is a valid frame based on the preset parameters and the actual parameters includes:
[0067] Step 201: determine the odd and even field type of the image frame based on the odd and even field parameters of the image frame.
[0068] For example, the odd and even field parameters are represented by a field identifier. When the field identifier of the odd and even field parameters is binary, 0 represents an even field, and 1 represents an odd field.
[0069] For another example, the odd-even field parameter is represented by a field number. When the field number of an image frame is an odd number, it is an odd field image frame. When the field number of an image frame is an even number, it is an even field image frame.
[0070] Step 202, if it is determined that the preset flag indicates that a previous image frame has not been stored in the memory and the parity field type of the image frame is the same as the parity field type indicated by the preset parity field parameters, the image frame is determined to be a valid frame, and the preset flag is modified so that the preset flag indicates that a previous image frame has been stored in the memory and the parity field type of the previous image frame is the same as the parity field type indicated by the preset parity field parameters.
[0071] For example, the preset flag is 0, indicating that the previous image frame has not been stored in the memory. The odd field type indicated by the preset odd-even field parameter is odd field, and it is determined that the next image frame to be displayed under normal circumstances should be an odd field image frame. And based on the odd-even field parameter of the currently read image frame, the odd field type of the image frame is determined to be odd field, which is the same as the odd field type determined based on the preset flag and the preset odd-even field parameter, and the image frame is determined to be a valid frame. Then the preset flag is modified to 1, indicating that the previous image frame has been stored in the memory.
[0072] For another example, the preset flag is 0, indicating that the previous image frame is not stored in the memory. The odd field type indicated by the preset odd-even field parameter is odd field, and it is determined that the next image frame to be displayed should be an odd field image frame under normal circumstances. However, if the odd-even field type of the image frame is determined to be an even field based on the odd-even field parameter of the currently read image frame, which is different from the odd-even field type determined based on the preset flag and the preset odd-even field parameter, the image frame is determined to be an invalid frame.
[0073] Since the same frame of image is divided into odd and even fields in interlaced scanning, when reading the image frame, the odd and even fields should be read alternately. Therefore, in the above scheme, by presetting the identification bit and the odd and even field parameters, the correct odd and even field type of the currently read image frame can be determined, thereby realizing the monitoring of the odd and even fields of the image frame and avoiding the situation of field confusion.
[0074] In an example of the present application, a data processing method is also provided, wherein determining the image frame as a valid frame based on the preset parameters and the actual parameters includes:
[0075] If it is determined that the preset flag indicates that a previous image frame has been stored in the memory and the odd and even field type of the image frame is different from the odd and even field type indicated by the preset odd and even field parameters, the image frame is determined to be a valid frame, and the preset flag is modified so that the preset flag indicates that the previous image frame has not been stored in the memory.
[0076] For example, the preset flag is 1, indicating that the previous image frame has been stored in the memory. The odd-even field type indicated by the preset odd-even field parameter is odd field, and it is determined that the next image frame to be displayed should be an even field under normal circumstances. However, based on the odd-even field parameter of the currently read image frame, the odd-even field type of the image frame is determined to be an even field, which is different from the odd-even field type determined based on the preset flag and the preset odd-even field parameter, and the image frame is determined to be a valid frame. Then the preset flag is modified to 0.
[0077] For another example, the preset flag is 1, indicating that the previous image frame has been stored in the memory. The odd-even field type indicated by the preset odd-even field parameter is odd field, and it is determined that the next image frame to be displayed should be an even field image frame under normal circumstances. If the odd-even field type of the image frame is determined to be odd field based on the odd-even field parameter of the currently read image frame, which is the same as the odd-even field type determined based on the preset flag and the preset odd-even field parameter, the image frame is determined to be an invalid frame.
[0078] In the above scheme, by presetting the identification bit and the odd and even field parameters, the correct odd and even field type of the currently read image frame can be determined, thereby realizing the monitoring of the odd and even fields of the image frame and avoiding the situation of field confusion.
[0079] In an example of the present application, a data processing method is also provided, such as Figure 3As shown, the determining that the image frame is a valid frame based on the preset parameters and the actual parameters includes:
[0080] Step 301 : Compare the number of rows and the number of pixels in each row of the image frame with the preset number of rows and the preset number of pixels in each row.
[0081] In this embodiment, the number of pixels in each row of the image frame is the same.
[0082] Step 302: If the comparison passes, determine that the image frame is a valid frame.
[0083] If the actual total number of pixels of the image frame is the same as the preset total number of pixels, the image frame is determined to be a valid frame.
[0084] In the above scheme, if the information of the image frame is determined to be complete based on the actual number of rows, the number of pixels per row, the preset number of rows, and the preset number of pixels per row, the image frame is determined to be a valid frame. If the information of the image frame is incomplete, it is determined to be an invalid frame and discarded. This effectively avoids the situation where the field information is lost or the image frame with incomplete field is sent for display when reading the image frame captured by the camera, and improves the robustness of data processing.
[0085] In an example of the present application, a data processing method is also provided, such as Figure 4 As shown, the comparing the number of rows and the number of pixels in each row of the image frame with the preset number of rows and the preset number of pixels in each row includes:
[0086] Step 401 : determining the total number of pixels of the image frame based on the number of rows of the image frame and the number of pixels in each row.
[0087] Multiply the number of rows by the number of pixels per row to get the total number of pixels in the image frame.
[0088] Step 402: determining a standard total number of pixels based on the preset number of rows and the preset number of pixels.
[0089] Multiply the preset number of rows by the preset number of pixels per row to get the standard total number of pixels.
[0090] Step 403: compare the total number of pixels of the image frame with the standard total number of pixels.
[0091] Compare the actual total number of pixels in the image frame with the standard total number of pixels.
[0092] Step 404: If the comparison passes, determine that the image frame is a valid frame.
[0093] If the actual total number of pixels of the image frame is the same as the standard total number of pixels, the image frame is determined to be a valid frame. If the actual total number of pixels of the image frame is different from the standard total number of pixels, the image frame is determined to be an invalid frame.
[0094] In the above scheme, the actual total number of pixels of the image frame is determined based on the actual number of rows and the number of pixels in each row of the image frame. The standard total number of pixels is determined based on the preset number of rows and the preset number of pixels in each row. Then, based on the actual total number of pixels of the image frame and the standard total number of pixels, it is determined that the information of the image frame is complete, and the image frame is determined to be a valid frame. If it is determined that the information of the image frame is incomplete, it is determined to be an invalid frame and discarded. This effectively avoids the situation where the image frame with lost field information or incomplete field is sent for display when reading the image frame captured by the camera, and improves the robustness of data processing.
[0095] In an example of the present application, a data processing method is also provided, such as Figure 5 As shown, determining the base address corresponding to the image frame based on the actual parameter includes:
[0096] Step 501: Determine the odd and even field type of the image frame based on the odd and even field parameters of the image frame.
[0097] Similarly, the odd and even field parameters can be represented by a field identifier or a field number, and the odd and even field type of the image frame can be determined by the field identifier or the field number.
[0098] Step 502: If the odd-even field type of the image frame is an odd field, determine that the base address corresponding to the image frame is a first base address.
[0099] Step 503: If the odd-even field type of the image frame is an even field, determine that the base address corresponding to the image frame is a second base address, and the address space indicated by the second base address differs from the address space indicated by the first base address by one row.
[0100] For example, Figure 6 As shown, when the storage mode is row-by-row storage, the starting address of the memory frame is B, and the number of pixels in each row is R, then the first base address corresponding to the data of the first row in the odd-field image frame is B, and the first base address corresponding to the data of the third row in the odd-field image frame is B+2R, and so on, the first base address corresponding to the data of the i-th row in the odd-field image frame is B+2iR, where i is an integer greater than or equal to 0. The second base address corresponding to the data of the second row in the even-field image frame is B+R, and the second base address corresponding to the data of the fourth row in the even-field image frame is B+3R, and so on, the second base address corresponding to the data of the j-th row in the even-field image frame is B+(2j+1)R, where j is an integer greater than 0.
[0101] For example, Figure 7As shown in the figure, when the storage mode is field-by-field storage, the starting address of the memory frame is B, the total number of lines of the image frame (the sum of the number of lines of the odd field image frame and the number of lines of the even field image frame) is H, and the number of pixels in each line is R. Then, the first base address corresponding to the odd field image frame is B, and the second base address corresponding to the even field image frame is B+6R. Similarly, the second base address corresponding to the even field image frame can be expressed as
[0102] In the above scheme, by determining the odd and even field type of the image frame and then determining the base address corresponding to the image frame, the image frame can be correctly stored in the memory frame and then sent for display.
[0103] In an example of the present application, a data processing method is also provided, including:
[0104] The preset number of image frames at the beginning of reading are blocked, i.e. they are not sent for display.
[0105] Since the camera may send some frames with disordered field sequence numbers when it is just started or restarted, shielding the first multiple image frames to be read can further improve the robustness of data processing.
[0106] In order to implement the above data processing method, Figure 8 As shown, an example of the present application provides a data processing device, including:
[0107] The transmission module 10 is used to read the image frame collected by the camera and obtain the actual parameters of the image frame, wherein the actual parameters include the odd and even field parameters, the number of rows and the number of pixels per row of the image frame;
[0108] A processing module 20, configured to discard the image frame if it is determined that the image frame is an invalid frame based on preset parameters and the actual parameters, the preset parameters including preset odd and even field parameters, a preset number of rows and a preset number of pixels per row, the preset number of rows and the preset number of pixels per row being determined based on a preset number of image frames starting from reading;
[0109] The processing module 20 is further configured to determine a base address corresponding to the image frame based on the actual parameter when the image frame is determined to be a valid frame based on the preset parameter and the actual parameter, wherein the base address is determined based on the preset number of rows and the preset number of pixels per row;
[0110] The transmission module 10 is further configured to store the image frame into a memory frame based on the base address.
[0111] Wherein, the processing module 20 is further used to determine the odd and even field type of the image frame based on the odd and even field parameters of the image frame;
[0112] The processing module 20 is further used to determine that if the preset flag indicates that the previous image frame has not been stored in the memory and the parity field type of the image frame is the same as the parity field type indicated by the preset parity field parameters, then determine that the image frame is a valid frame, and modify the preset flag so that the preset flag indicates that the previous image frame has been stored in the memory, and the parity field type of the previous image frame is the same as the parity field type indicated by the preset parity field parameters.
[0113] Among them, the processing module 20 is also used to determine that the preset flag indicates that a previous image frame has been stored in the memory and the parity field type of the image frame is different from the parity field type indicated by the preset parity field parameters, then determine that the image frame is a valid frame, and modify the preset flag so that the preset flag indicates that the previous image frame has not been stored in the memory.
[0114] Wherein, the processing module 20 is further used to compare the number of rows and the number of pixels in each row of the image frame with the preset number of rows and the preset number of pixels in each row;
[0115] The processing module 20 is further configured to determine that the image frame is a valid frame if the comparison passes.
[0116] Wherein, the processing module 20 is further used to determine the total number of pixels of the image frame based on the number of rows of the image frame and the number of pixels in each row;
[0117] The processing module 20 is further used to determine a standard total number of pixels based on the preset number of rows and the preset number of pixels;
[0118] The processing module 20 is further used to compare the total number of pixels of the image frame with the standard total number of pixels;
[0119] The processing module 20 is further configured to determine that the image frame is a valid frame if the comparison passes.
[0120] Wherein, the processing module 20 is further used to determine the odd and even field type of the image frame based on the odd and even field parameters of the image frame;
[0121] The processing module 20 is further configured to determine that the base address corresponding to the image frame is the first base address if the odd-even field type of the image frame is an odd field;
[0122] The processing module 20 is further used to determine that the base address corresponding to the image frame is a second base address if the odd-even field type of the image frame is an even field, and the address space indicated by the second base address differs from the address space indicated by the first base address by one row.
[0123] The hardware structure diagram of the chip provided in the embodiment of the present application is as follows: Fig. 9As shown, the chip 600 includes at least one processor 610, a user interface 630, a memory 650 and a bus 640; the various components in the chip 600 are coupled together through the bus 640. It can be understood that the bus 640 is used to realize the connection and communication between these components. In addition to the data bus, the bus 640 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig. 9 Various buses are labeled as bus 640.
[0124] The processor 610 can be built into a system on chip or an application specific integrated circuit (ASIC), or the processor 610 can be located on an independent semiconductor chip and has signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), a microprocessor, a microcontroller unit (MCU), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., wherein the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0125] The user interface 630 is used for interacting and exchanging information with the user.
[0126] The memory 650 stores executable instructions for implementing the data processing method provided in the embodiment of the present application; the memory 650 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drive, optical disk drive, etc. The memory 650 may optionally include one or more storage devices that are physically far away from the processor 610.
[0127] In some embodiments, memory 650 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof.
[0128] In some embodiments, the chip 600 may further include:
[0129] Operating system 651, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, application layer, etc., for implementing various basic services and processing hardware-based tasks;
[0130] The network communication module 652 is used to reach other computing devices via one or more (wired or wireless) network interfaces 620. Exemplary network interfaces 620 include: Bluetooth, Wireless Authentication (WiFi), and Universal Serial Bus (USB).
[0131] An embodiment of the present application also provides an electronic device, which includes components, and the components include a chip. The chip can execute the data processing method provided by the embodiment of the present application.
[0132] In some optional embodiments, the component may be a chassis, a door, a main board, a dashboard, etc.
[0133] An embodiment of the present application also provides a traffic device, which includes a chip, and the chip can execute the data processing method provided in the embodiment of the present application.
[0134] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the data processing method provided by the embodiment of the present application.
[0135] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.
[0136] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0137] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0138] An embodiment of the present application provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the data processing method described in the present application is implemented.
[0139] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A data processing method, the method comprising: Read the image frame captured by the camera, and obtain actual parameters of the image frame, wherein the actual parameters include odd and even field parameters, the number of rows, and the number of pixels in each row of the image frame; In the case where the image frame is determined to be an invalid frame based on preset parameters and the actual parameters, the image frame is discarded, the preset parameters including preset odd and even field parameters, a preset number of rows and a preset number of pixels per row, the preset number of rows and the preset number of pixels per row being determined based on a preset number of image frames at the start of reading; In the case where the image frame is determined to be a valid frame based on the preset parameters and the actual parameters, a base address corresponding to the image frame is determined based on the actual parameters, wherein the base address is determined based on the preset number of rows and the preset number of pixels per row; The image frame is stored in a memory frame based on the base address.
2. The method according to claim 1, wherein the preset parameters further include a preset flag, and the determining that the image frame is a valid frame based on the preset parameters and the actual parameters comprises: Determining an odd-even field type of the image frame based on an odd-even field parameter of the image frame; If it is determined that the preset flag indicates that the previous image frame has not been stored in the memory and the parity field type of the image frame is the same as the parity field type indicated by the preset parity field parameters, the image frame is determined to be a valid frame, and the preset flag is modified so that the preset flag indicates that the previous image frame has been stored in the memory, and the parity field type of the previous image frame is the same as the parity field type indicated by the preset parity field parameters.
3. The method according to claim 2, wherein determining the image frame as a valid frame based on preset parameters and the actual parameters comprises: If it is determined that the preset flag indicates that a previous image frame has been stored in the memory and the odd and even field type of the image frame is different from the odd and even field type indicated by the preset odd and even field parameters, the image frame is determined to be a valid frame, and the preset flag is modified so that the preset flag indicates that the previous image frame has not been stored in the memory.
4. The method according to claim 1, wherein determining the image frame as a valid frame based on preset parameters and the actual parameters comprises: Comparing the number of rows and the number of pixels in each row of the image frame with the preset number of rows and the preset number of pixels in each row; If the comparison passes, the image frame is determined to be a valid frame.
5. The method according to claim 4, wherein comparing the number of rows and the number of pixels in each row of the image frame with the preset number of rows and the preset number of pixels in each row comprises: Determining the total number of pixels of the image frame based on the number of rows of the image frame and the number of pixels in each row; Determining a standard total number of pixels based on the preset number of rows and the preset number of pixels; Comparing the total number of pixels of the image frame with the standard total number of pixels; If the comparison passes, the image frame is determined to be a valid frame.
6. The method according to claim 1, wherein determining the base address corresponding to the image frame based on the actual parameter comprises: Determining an odd-even field type of the image frame based on an odd-even field parameter of the image frame; If the odd-even field type of the image frame is an odd field, determining that the base address corresponding to the image frame is a first base address; If the odd-even field type of the image frame is an even field, the base address corresponding to the image frame is determined to be a second base address, and the address space indicated by the second base address differs from the address space indicated by the first base address by one row.
7. A data processing device, comprising: A transmission module, used for reading the image frame collected by the camera and obtaining actual parameters of the image frame, wherein the actual parameters include odd and even field parameters, the number of rows and the number of pixels per row of the image frame; a processing module, configured to discard the image frame if it is determined that the image frame is an invalid frame based on preset parameters and the actual parameters, the preset parameters including preset odd and even field parameters, a preset number of rows and a preset number of pixels per row, the preset number of rows and the preset number of pixels per row being determined based on a preset number of image frames starting from reading; The processing module is further configured to determine a base address corresponding to the image frame based on the actual parameters when the image frame is determined to be a valid frame based on the preset parameters and the actual parameters, wherein the base address is determined based on the preset number of rows and the preset number of pixels per row; The transmission module is further used to store the image frame into a memory frame based on the base address.
8. A chip, comprising a processor, wherein the processor is capable of executing the data processing method according to any one of claims 1 to 6.
9. An electronic device, comprising a component, wherein the component comprises a chip, and the chip can execute the data processing method according to any one of claims 1 to 6.
10. A traffic device, comprising a chip, wherein the chip can execute the data processing method according to any one of claims 1 to 6.