Image data processing method and device and electronic equipment

By setting a device interface and a buffer between the shooting device and the image processing unit, the problem of image format mismatch is solved, real-time processing of image data is achieved, and processing efficiency is improved.

CN120751082APending Publication Date: 2025-10-03JINGWEI HIRAIN (TIANJIN) RES&DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510961386.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

In the prior art, the image data format (such as RAW format) captured by the shooting device cannot be directly processed by an image processing unit such as OpenCV, resulting in the inability to process the image data in real time.

Method used

By setting the device interface to communicate with the shooting device, the image data is obtained and written into the buffer, and the image format is determined to be consistent with the target format. If not, the format is converted, and finally the image is read from the buffer and processed.

Benefits of technology

Real-time processing of image data is achieved, processing delays caused by format mismatch are avoided, and image processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120751082A_ABST
    Figure CN120751082A_ABST
Patent Text Reader

Abstract

The invention discloses an image data processing method and device and electronic equipment. The method is applied to a format processing system. The format processing system comprises a device interface, and the device interface is in communication connection with a preset shooting device. The method comprises the following steps: acquiring image data from shooting equipment by utilizing an equipment interface, and writing the image data into a preset buffer area; judging whether the image format of the image data is matched with at least one preset target format or not; under the condition that the image format is not matched with at least one target format, performing format conversion on the image format of the image data to obtain an image format matched with the at least one target format; and reading the image data subjected to format conversion from the buffer area so as to carry out image processing. Through the method, the image data can be processed in time after being read from the buffer area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of image processing, and in particular relates to a method, device and electronic device for processing image data. Background Art

[0002] In relevant image data processing technologies, after a shooting device captures image data, in some cases, the image format used by the shooting device when capturing the image data is not an image format that can be processed by a processing unit. For example, the image data captured by some cameras is in a special RAW format (unprocessed format) image data. The processing unit used to process the image data, such as the OpenCV (Open Source Computer Vision) library, cannot process the special RAW format image data, resulting in the image data being unable to be processed in real time in this situation. Summary of the Invention

[0003] The embodiments of the present application provide a method, device, and electronic device for processing image data, which enable image data to be directly read from a buffer and processed in a timely manner.

[0004] In a first aspect, embodiments of the present application provide a method for processing image data, which is applied to a format processing system; the format processing system includes a device interface, the device interface being communicatively connected to a preset shooting device; the method comprising:

[0005] Obtain image data from the camera using the device interface and write the image data into a preset buffer;

[0006] determining whether an image format of the image data matches at least one preset target format;

[0007] When the image format does not match any target format, converting the image format of the image data to obtain an image format that matches at least one target format;

[0008] Read the format-converted image data from the buffer for image processing.

[0009] Furthermore, before acquiring image data from a preset shooting device using a preset device interface, the method further includes:

[0010] Use the device interface to configure the image format of the captured image data for the capture device.

[0011] Furthermore, before acquiring image data from a preset shooting device using a preset device interface, the method further includes:

[0012] Query the cache parameters of multiple buffers;

[0013] A buffer whose cache parameters meet the preset target parameters is selected from each buffer zone.

[0014] Furthermore, after selecting a buffer whose cache parameters meet the preset target parameters from each buffer, the method further includes:

[0015] Map the buffer to the preset address space.

[0016] Furthermore, obtaining image data from a preset shooting device using a preset device interface and writing the image data into a preset buffer includes:

[0017] Using the device interface to send a capture instruction to the shooting device, so that the shooting device captures image data according to the capture instruction;

[0018] Use the device interface to obtain image data;

[0019] Based on the mapping relationship between the address space and the buffer, the image data is written to the buffer frame by frame by accessing the address space.

[0020] Furthermore, after determining whether the image format of the image data matches at least one preset target format, the method further includes:

[0021] If the image format matches any of the target formats, creating a first set corresponding to the image format in the buffer;

[0022] Copy the image data to the first set.

[0023] Furthermore, performing format conversion on the image data to obtain an image format matching at least one target format includes:

[0024] Create the second and third sets in the buffer;

[0025] copying the image data to a second set;

[0026] performing format conversion on the image data in the second set;

[0027] The format-converted image data is copied to the third set.

[0028] Furthermore, the format-converted image data is read from the buffer, including:

[0029] While the image data is being written to the buffer, the image data is read from the buffer frame by frame.

[0030] In a second aspect, an embodiment of the present application provides an image data processing device, the device comprising:

[0031] An acquisition module, configured to acquire image data from a preset shooting device using a preset device interface, and write the image data into a preset buffer;

[0032] a matching module, configured to determine whether an image format of the image data matches at least one preset target format;

[0033] a conversion module, configured to convert the image format of the image data to obtain an image format that matches at least one target format when the image format does not match any target format;

[0034] The reading module is used to read the format-converted image data from the buffer for image processing.

[0035] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising:

[0036] a processor and a memory storing computer program instructions;

[0037] When the processor executes the computer program instructions, any of the above image data processing methods is implemented.

[0038] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, any of the above-mentioned image data processing methods is implemented.

[0039] In a fifth aspect, an embodiment of the present application provides a computer program product that, when instructions in the computer program product are executed by a processor of an electronic device, enables the electronic device to execute any of the above methods for processing image data.

[0040] In a sixth aspect, an embodiment of the present application further provides a vehicle, which includes an image data processing device or electronic device, and the electronic device executes any one of the above image data processing methods.

[0041] The image data processing method, device and electronic device of the embodiments of the present application can obtain image data from the shooting device based on the set device interface and write it to the buffer, so as to further determine whether the image format of the image data in the buffer matches the target format, thereby determining whether the image format of the captured image data belongs to an image format that can be processed.

[0042] Furthermore, when the image format of the image data does not match the target format, it can be determined that the image data in this image format cannot be processed. By performing format conversion on the image data, the image data can be converted into image data that matches the target format, so that the image data can be processed in a timely manner after being read out of the buffer. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0044] Figure 1 This is a flowchart of a method for processing image data provided by an embodiment of the present application;

[0045] Figure 2 1 is a schematic structural diagram of an image data processing device provided in an embodiment of the present application;

[0046] Figure 3 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating the examples of the present application.

[0048] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.

[0049] As described in the background technology section, the related image data processing technology is still difficult to meet the needs of actual work.

[0050] In actual work, the image processing unit directly obtains the image data captured by the shooting device based on the set interface, and performs image processing on the image data.

[0051] The image processing unit may be, for example, an open source computer vision and machine learning software library, such as the OpenCV library.

[0052] In the case where the shooting device is an embedded shooting device, for example, the shooting device is a shooting device in an embedded system based on the Advanced RISC (Reduced Instruction Set Computer) Machine (ARM) architecture. On the one hand, since OpenCV cannot directly obtain the image data captured by the shooting device from the ARM embedded system, but needs to save the captured image data first and then input it into OpenCV, the image data processing process will be greatly delayed due to the inability to obtain the image data in real time, that is, real-time processing of the image data cannot be achieved.

[0053] On the other hand, since the shooting devices on ARM embedded systems often output image data in RAW format, and OpenCV often cannot process some non-standardized RAW format image data, for example, RAW format image data customized by the shooting device manufacturer, therefore, before inputting the RAW format image data into OpenCV, it is necessary to first convert the RAW format image data into an image format that OpenCV can process, and then input it into OpenCV. This causes OpenCV to greatly increase the processing delay when processing image data, and it is unable to process the image data captured by the shooting device in real time.

[0054] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device and electronic device for processing image data.

[0055] The following is a detailed description of the image data processing technology method provided in the embodiments of the present application in conjunction with the accompanying drawings.

[0056] Figure 1 A flowchart of a technical method for processing image data provided by an embodiment of the present application is shown.

[0057] refer to Figure 1 The image data processing technology method of an embodiment of the present application is executed by a pre-set format processing system, which can communicate with the shooting device and the image processing unit, so as to obtain image data from the shooting device, and after formatting the image data, output the formatted image data to the image processing unit for further image processing in the image processing unit.

[0058] The method specifically comprises the following steps:

[0059] Step S101: Obtain image data from a shooting device using a device interface, and write the image data into a preset buffer.

[0060] The shooting device may be, for example, a camera based on an ARM embedded system.

[0061] The device interface is provided in the format processing system and is communicatively connected with the photographing device, so that the format processing system can communicate and interact with the photographing device through the device interface.

[0062] In an example, the device interface may be, for example, a preset V4L2 interface, where the V4L2 interface is an interface based on access and control of a shooting device.

[0063] The buffer area may be, for example, a pre-set memory area for storing image data captured by a photographing device.

[0064] In this embodiment, the format processing system can interact with the shooting device by calling the device interface and obtain the image data captured by the shooting device from the shooting device. After the format processing system obtains the image data, the image data can be written into a pre-set buffer.

[0065] In a specific example, the V4L2 interface may be used to obtain image data from a camera and write the image data into a buffer.

[0066] Step S102: Determine whether the image format of the image data matches at least one preset target format.

[0067] The target format is an image format that can be processed by the image processing unit. When the image processing unit is OpenCV, the target format is an image format that can be processed by OpenCV.

[0068] In this embodiment, the acquired multiple image data may be in multiple different image formats, and the target format may also be in multiple different image formats.

[0069] For each piece of image data acquired in the buffer, it can be determined whether the image format of the image data is consistent with any one of the multiple target formats.

[0070] In this embodiment, a correspondence between each image format acquired by the device interface and each target format may be pre-established.

[0071] Since each piece of image data is acquired through a device interface, the image format of each piece of image data is the image format currently used by the device interface.

[0072] For an image format that can be processed by the image processing unit, the image format corresponds to a specific target format in the image processing unit. When the image processing unit obtains image data in the image format, it can process the image data in the specific corresponding target format.

[0073] Based on this, for the image formats currently used by the device interface, a correspondence between the image formats and specific corresponding target formats can be established.

[0074] Furthermore, when determining whether each current image format matches the target format, based on the corresponding relationship, it can be determined whether there is any image format that has no corresponding target format. If not, it can be considered that each image format has a matching target format. If so, it can be considered that there is no target format that matches the image format.

[0075] In a specific example, a correspondence between the image format currently used by the V4L2 interface and the target format that can be directly processed by OpenCV can be established.

[0076] For example, the image format used by the V4L2 interface is V4L2_PIX_FMT_Y8. After inputting it into OpenCV, OpenCV will process the image data in the specific corresponding target format CV8_UC1. Based on this, the correspondence between the V4L2 image format V4L2_PIX_FMT_Y8 and the OpenCV target format CV8_UC1 can be established.

[0077] Furthermore, if any image format used by V4L2 does not have a corresponding OpenCV target format, it means that OpenCV cannot directly process image data in this image format.

[0078] Based on this, in this step, based on the pre-established correspondence between the image format and the target format, the image format that is difficult for the image processing unit to process can be directly determined through the correspondence, thereby accurately locating the image data that needs to be formatted.

[0079] Step S103: When the image format does not match any target format, convert the image format of the image data to obtain an image format that matches at least one target format.

[0080] Based on the above judgment on whether each image format matches, for any image data, when the image format of the image data does not match any target format, the format processing system can perform format conversion on the image data.

[0081] In this embodiment, the format of the image after format conversion can be preset according to requirements.

[0082] The image format of the image data after format conversion can match one of the target formats.

[0083] Step S104 : Read the format-converted image data from the buffer to perform image processing.

[0084] In one example, based on copying the format-converted image data to the corresponding third sets in the aforementioned step, the corresponding image data can be read from each third set and input to the image processing unit for processing.

[0085] When reading image data from the buffer, the reading may be performed frame by frame.

[0086] Furthermore, after the image data is read out from the buffer, the image data may be input into the image processing unit so that the image processing unit processes the image data.

[0087] It can be seen that in this embodiment, based on creating a device interface that can call and configure the shooting device in the format processing system, it is possible to control the shooting device to capture image data and obtain the captured image data from the shooting device. Based on the created buffer, the acquired image data can be temporarily stored in the buffer, thereby realizing the judgment of whether the image format of the image data matches the target format.

[0088] Furthermore, by judging whether the target format is matched, the image data can be format-converted in time when the image data does not match the target format, so that the image data after format conversion can match the target format, and then the image processing unit can directly read the image data after format conversion from the buffer, so that the image processing unit can process the input image data in real time.

[0089] In another embodiment of the present application, before acquiring image data, it is also necessary to configure device parameters for the shooting device using a device interface.

[0090] The device parameters configured for the shooting device may specifically include, for example, the image format of the image data required when the shooting device captures image data; and device parameters such as the resolution and frame rate of the shooting device.

[0091] The image format may be a required image format pre-set in the format processing system, or may be a required image format acquired by the format processing system through communication with other control platforms or other controllers.

[0092] In one example, when setting device parameters for a shooting device, the format processing system may open the shooting device by calling a device interface and interact with the shooting device through the device interface, thereby completing the operation of configuring parameters for the shooting device.

[0093] In a specific example, an instruction for configuring device parameters may be sent to the camera via the V4L2 interface.

[0094] The instruction for configuring the device parameters may be, for example, a system call function for device input and output operations, such as an ioctl function.

[0095] Specifically, the camera parameter configuration may be implemented through different statements in the ioctl function, for example, the VIDIOC_S_FMT statement and the VIDIOC_G_FMT statement.

[0096] The VIDIOC_S_FMT statement is specifically used to set the image format of the image data captured by the camera, and the VIDIOC_G_FMT statement is specifically used to obtain the image format of the image data captured by the camera.

[0097] Based on this, the format processing system can obtain image data from the shooting device through the device interface, thereby realizing real-time interaction between the format processing system and the shooting device.

[0098] In another embodiment of the present application, before acquiring the image data, a buffer zone may be set for the image data acquired by the format processing system using a device interface.

[0099] Specifically, the cache parameters of each of a plurality of preset buffers may be queried first, and then one or more buffers meeting predetermined target parameters may be selected from each buffer.

[0100] The target parameters are parameters of the buffer required to store image data.

[0101] In a specific example, when setting a buffer for image data, the format processing system can set required target parameters by calling a device interface, query cache parameters of each buffer, and request a required buffer by calling the device interface.

[0102] In a specific example, instructions for requesting and querying cache parameters may be issued to each buffer through a V4L2 interface.

[0103] The instruction for requesting and querying cache parameters may be, for example, a system call function for device input and output operations, such as an ioctl function.

[0104] Specifically, for example, the statements in the ioctl function can be used to request and query buffer parameters, as well as set target parameters. For example, the VIDIOC_QUERYBUF statement can be used to query the buffer parameters of each buffer and request operations on the corresponding buffer, and the VIDIOC_REQBUFS statement can be used to set the target parameters.

[0105] Based on this, after querying the buffer parameters of each buffer zone, a buffer zone whose buffer parameters meet the target parameters can be selected therefrom, so that the selected buffer zone can meet the requirement of storing image data.

[0106] In another embodiment of the present application, when a required buffer zone is selected from various buffer zones, the selected buffer zone may be mapped to a preset address space.

[0107] Specifically, the mapping relationship between the address space and the buffer can be established through the memory mapping function mmap.

[0108] Accordingly, after completing the construction of the mapping relationship, the task process can store the image data in the buffer by accessing the buffer through a pointer, without using a slow copy operation to store the image data.

[0109] In another embodiment of the present application, the format processing system may send a capture instruction for capturing image data to the photographing device through the device interface, so that the photographing device captures image data according to the capture instruction.

[0110] Furthermore, the format processing system can use the device interface to obtain image data from the shooting device. Based on the mapping relationship established above, the format processing system can access the buffer by accessing the address space, and write the image data into the buffer frame by frame through the pointer.

[0111] The capture instruction may specifically be, for example, a statement in an ioctl function, such as a VIDIOC_STREAMON statement.

[0112] Furthermore, when the image data is stored in the buffer, in order to execute the action of storing the image data, a storage thread may be created, and the operation of storing the image data in the buffer is completed by executing the storage thread.

[0113] In a specific example, the V4L2 interface can call the camera by using the VIDIOC_STREAMON statement, thereby starting the camera to start capturing image data and inputting the captured image data into the buffer frame by frame.

[0114] Based on this, this step can directly obtain image data from the shooting device through a pre-set device interface, and based on a pre-set buffer, the obtained image data can be directly stored in the buffer, and through mapping, the operation of storing image data can be made fast and without delay, thereby achieving real-time performance of the entire operation from obtaining image data to storing image data in the buffer.

[0115] In another embodiment of the present application, based on the above-mentioned judgment of whether each image format matches, for any image data, when the image format of the image data matches any target format, a first set corresponding to the image format can be created in the buffer to store the image data using the first set.

[0116] Each first set may specifically be, for example, a storage space created in a buffer area, and the storage space is used to store image data in the same image format.

[0117] In one example, when there are multiple image data that match different target formats, a first set corresponding to the respective image formats is created for each image data.

[0118] Accordingly, each piece of image data can be copied to the corresponding first set respectively.

[0119] When creating the first set, the format processing system may use, for example, the Mat::zeros statement to create an empty first set.

[0120] In one example, when any image data has a matching target format and a corresponding first set has been created for the image data, the image data can be directly copied to the corresponding first set without creating another first set.

[0121] Based on this, this embodiment can directly store the image data that can be directly processed by the image processing unit in the corresponding first set according to the image format based on the created first set, thereby selecting the image data that can be directly processed by the image processing unit.

[0122] In another embodiment of the present application, during the process of performing format conversion on the image data, an empty second set and an empty third set may be first created for the image data in the buffer.

[0123] The second set is used to store image data before format conversion, and the third set is used to store image data after format conversion.

[0124] Furthermore, after the image data is copied to the second set, the format of the image data in the second set may be converted, and the image data after the format conversion may be copied to the third set.

[0125] In a specific example, when creating the second set and the third set, the format processing system may use, for example, a Mat::zeros statement to create them.

[0126] In one example, when there are multiple image data that need to be converted into different image formats, corresponding to the converted image formats, a third set corresponding to each converted image format is created for each image data.

[0127] Accordingly, each piece of image data can be copied to the corresponding first set respectively.

[0128] Based on this, this step is based on the second set created in the buffer, and by storing the image data that cannot be processed by the image processing unit in the second set, it is possible to distinguish the image data whose image format does not match the target format from other image data, and by setting the third set in the buffer, it can be achieved that the image data in the third set can all be directly processed by the image processing unit, so that when outputting the image data to the image processing unit, there is no need to distinguish whether it can be directly processed, but according to different sets, the image data can be directly output from the corresponding set.

[0129] In another embodiment of the present application, the image data may be read from the buffer and written into the buffer at the same time.

[0130] In a specific example, when reading image data from the third set and the first set, in order to execute the action of reading the image data, a reading thread may be created, and the operation of reading the image data from the buffer is completed by executing the reading thread.

[0131] In one example, resource sharing, that is, a shared buffer, can be achieved between the reading thread and the storing thread in the aforementioned step.

[0132] In a specific example, the reading thread and the storing thread are two parallel threads. When multiple image inputs need to be stored and multiple image data need to be read simultaneously, multiple storing threads and multiple reading threads can be run in parallel.

[0133] Based on this, by reading image data from the buffer while writing image data into the buffer, image data can be transferred uninterruptedly between the reading thread and the storing thread, thereby increasing the speed of inputting image data to the image processing unit.

[0134] It can be seen that in this embodiment, based on creating a device interface that can call and configure the shooting device in the format processing system, it is possible to control the shooting device to capture image data and obtain the captured image data from the shooting device. Based on the created buffer, the acquired image data can be temporarily stored in the buffer, thereby realizing the judgment of whether the image format of the image data matches the target format.

[0135] Furthermore, by creating different sets for image data that can match the target format and image data that cannot match, it is possible to distinguish image data that can match the target format from image data that cannot match, and by creating a third set, it is possible to distinguish image data after format conversion from image data before format conversion, thereby achieving that all image data that can match the target format are in the first set and the third set, so that the image data can be directly read from the corresponding first set and third set and input into the image processing unit, thereby avoiding the problem of the image processing unit encountering an image format that cannot be processed, so that the image processing unit can process the input image data in real time.

[0136] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, an embodiment of the present application further provides an image data processing device.

[0137] refer to Figure 2 , the image data processing device comprises:

[0138] The acquisition module 201 is used to acquire image data from the camera using a device interface and write the image data into a preset buffer;

[0139] A matching module 202 is configured to determine whether the image format of the image data matches at least one preset target format;

[0140] A conversion module 203 is configured to, when the image format does not match any target format, perform format conversion on the image data to obtain an image format that matches at least one target format;

[0141] The reading module 204 is configured to read the format-converted image data from the buffer to perform image processing.

[0142] In one embodiment, the acquisition module 201 is specifically configured to:

[0143] Using the device interface to send a capture instruction to the shooting device, so that the shooting device captures the image data according to the capture instruction;

[0144] Acquiring the image data using the device interface;

[0145] Based on the mapping relationship between the address space and the buffer, the image data is written into the buffer frame by frame by accessing the address space.

[0146] Before obtaining image data from a preset shooting device using a preset device interface, the following steps are further performed:

[0147] The device interface is used to configure an image format for capturing image data for the photographing device.

[0148] Before acquiring image data from a preset shooting device using a preset device interface, the following steps are further performed:

[0149] Query the cache parameters of multiple buffers;

[0150] A buffer whose cache parameters meet the preset target parameters is selected from each buffer zone.

[0151] After selecting a buffer whose cache parameters meet the preset target parameters from each buffer, further executing:

[0152] The buffer is mapped to a preset address space.

[0153] In one embodiment, the matching module 202 is specifically configured to:

[0154] After determining whether the image format of the image data matches at least one preset target format, executing:

[0155] In a case where the image format matches any target format, creating a first set corresponding to the image format in the buffer;

[0156] The image data is copied to the first set.

[0157] In one embodiment, the conversion module 203 is specifically configured to:

[0158] creating a second set and a third set within the buffer;

[0159] copying the image data to the second set;

[0160] performing format conversion on the image data in the second set;

[0161] The format-converted image data is copied to the third set.

[0162] In one embodiment, the reading module 204 is specifically configured to:

[0163] While the image data is written into the buffer, the image data is read from the buffer frame by frame.

[0164] For the convenience of description, the above devices are described as being divided into various modules according to their functions. Of course, when implementing the embodiments of the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0165] The apparatus of the above embodiment is used to implement the corresponding image data processing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0166] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, an embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, it implements the image data processing method of any of the above embodiments.

[0167] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0168] The electronic device may include a processor 301 and a memory 302 storing computer program instructions.

[0169] Specifically, the processor 301 may include a central processing unit (CPU) or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0170] Memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the electronic device. In certain embodiments, memory 302 is a non-volatile solid-state memory.

[0171] In one example, in a particular embodiment, the memory 302 may include a read-only memory (ROM), which may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of the above, in one example, where appropriate. Random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present disclosure.

[0172] The processor 301 reads and executes computer program instructions stored in the memory 302 to implement any one of the image data processing methods in the above embodiments.

[0173] In one example, the electronic device may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301 , the memory 302 , and the communication interface 303 are connected via a bus 310 and communicate with each other.

[0174] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0175] The bus 310 includes hardware, software, or both that couples components of the electronic device to each other. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count Bus (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 310 may include one or more buses. Although embodiments herein describe and illustrate a particular bus, this application contemplates any suitable bus or interconnect.

[0176] The electronic device can execute the image data processing method in the embodiment of the present application based on the format conversion of the image data, thereby achieving Figure 1 Describes the processing methods of image data.

[0177] In addition, in conjunction with the image data processing methods in the above embodiments, embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the image data processing methods in the above embodiments is implemented.

[0178] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements any one of the image data processing methods in the above embodiments.

[0179] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.

[0180] The functional blocks shown in the structural block diagram described above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memories (ROMs), flash memory, erasable read-only memories (EROMs), floppy disks, compact disc read-only memories (CD-ROMs), optical discs, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via a computer network such as the Internet or an intranet.

[0181] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present application also provides a vehicle, which includes an image data processing device and / or electronic device of any of the above-mentioned embodiments, and the electronic device executes any of the above-mentioned image data processing methods.

[0182] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0183] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0184] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.

Claims

1. A method for processing image data, characterized in that: Applied to format processing systems; The format processing system includes a device interface, and the device interface is communicatively connected to a preset shooting device; the method includes: Acquiring image data from the photographing device using the device interface, and writing the image data into a preset buffer; determining whether an image format of the image data matches at least one preset target format; In a case where the image format does not match any target format, performing format conversion on the image format of the image data to obtain an image format that matches at least one target format; The image data after format conversion is read from the buffer to perform image processing.

2. The method for processing image data according to claim 1, wherein: Before acquiring image data from the photographing device using the device interface, the method further includes: The device interface is used to configure an image format for capturing image data for the photographing device.

3. The method for processing image data according to claim 1, wherein: Before acquiring image data from the photographing device using the device interface, the method further includes: Query the cache parameters of multiple buffers; A buffer whose cache parameters meet the preset target parameters is selected from each buffer zone.

4. The method for processing image data according to claim 3, wherein: After selecting a buffer whose cache parameters meet the preset target parameters from each buffer, the method further includes: The buffer is mapped to a preset address space.

5. The method for processing image data according to claim 4, wherein: The acquiring image data from the shooting device by using the device interface and writing the image data into a preset buffer zone includes: Using the device interface to send a capture instruction to the shooting device, so that the shooting device captures the image data according to the capture instruction; Acquiring the image data using the device interface; Based on the mapping relationship between the address space and the buffer, the image data is written into the buffer frame by frame by accessing the address space.

6. The method for processing image data according to claim 1, wherein: After determining whether the image format of the image data matches at least one preset target format, the method further includes: In a case where the image format matches any target format, creating a first set corresponding to the image format in the buffer; The image data is copied to the first set.

7. The method for processing image data according to claim 1, wherein: The converting the image format of the image data to obtain an image format matching at least one target format includes: creating a second set and a third set within the buffer; copying the image data to the second set; performing format conversion on the image data in the second set; The format-converted image data is copied to the third set.

8. The method for processing image data according to claim 1, wherein: The step of reading the format-converted image data from the buffer comprises: While the image data is written into the buffer, the image data is read from the buffer frame by frame.

9. An image data processing device, characterized in that: The device comprises: An acquisition module, configured to acquire image data from a photographing device using a device interface and write the image data into a preset buffer; a matching module, configured to determine whether an image format of the image data matches at least one preset target format; a conversion module, configured to, when the image format does not match at least one target format, perform format conversion on the image data to obtain an image format that matches any target format; The reading module is used to read the image data after format conversion from the buffer to perform image processing.

10. An electronic device, characterized in that: The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for processing image data according to any one of claims 1 to 8 is implemented.