Image processing method, electronic device and computer program product
By introducing a multi-level buffer structure into the electronic device, and using the first and second image processors to process the preview and target images respectively, the problem of buffer queue capacity limitation is solved, and shooting efficiency is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2026-03-10
AI Technical Summary
In the prior art, the shooting module of electronic devices cannot continuously respond to shooting commands within a certain period of time, resulting in reduced shooting efficiency, mainly due to the limited capacity of the image signal processor's processing buffer queue.
A multi-level buffer structure is adopted, with the first image processor acquiring the preview image and the second image processor acquiring the target image. Upon receiving a photo capture command, the image to be processed is stored in the first and/or second buffer, thereby expanding the caching capacity.
The caching capability of the image processing process has been improved, the number of times shooting commands are responded to has increased, and shooting efficiency has been improved.
Smart Images

Figure CN121644973A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, and particularly relates to an image processing method, an electronic device and a computer program product. BACKGROUND
[0002] With the continuous development of science and technology, in order to meet the growing demand, more and more electronic devices are configured with a shooting module to take pictures. When the shooting module of the electronic device is turned on, the sensor corresponding to the shooting module can obtain image data, and send the obtained image data to an image signal processor (ISP), and the ISP will process the image. In the offline shooting processing mechanism, the processing of the photographed image is usually limited by the capacity of the shooting image signal processor processing cache queue, so that after the triggering of the shooting instruction exceeds a certain number within a certain time, the electronic device cannot continue to respond to the shooting instruction, which reduces the shooting efficiency. SUMMARY
[0003] The main purpose of the present application is to provide an image processing method, an electronic device and a computer program product, which can improve the shooting efficiency.
[0004] The present application provides an image processing method. The image processing method comprises: in response to the start of at least one image sensor, determining at least one first image processor and at least one second image processor; when a target image sensor starts, using the first image processor corresponding to the target image sensor to perform first processing on the to-be-processed image obtained by the target image sensor to obtain a preview image; in response to receiving a shooting instruction, storing the to-be-processed image obtained by the target sensor in a first cache area and / or a second cache area; using the second image processor corresponding to the target image sensor to perform second processing on the to-be-processed image in the first cache area and / or the second cache area to obtain a target image.
[0005] The present application provides an electronic device. The electronic device comprises a memory and a processor, the memory is used to store program data, and the program data can be executed by the processor to realize the image processing method as described in the first technical solution.
[0006] The present application provides a computer program product. The computer program product stores program data, which can be executed by a processor to realize the image processing method as described in the first technical solution.
[0007] The beneficial effects of the present application at least include: after the image sensor is started, the first image processor is used to acquire a preview image, and the second image processor is used to acquire a target image. In the process of generating the target image, the first cache area and the second cache area are set for the to-be-processed image, and when the photographing instruction is received, the to-be-processed image can be stored in the first and / or second cache area. The second cache area is set to improve the cache capability of the image processing process, increase the response times of the photographing instruction for the target image within a certain time, and improve the shooting efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0009] Figure 1 is a flowchart of a first embodiment of the image processing method of the present application;
[0010] Figure 2 is a flowchart of a second embodiment of the image processing method of the present application;
[0011] Figure 3 is a flowchart of a third embodiment of the image processing method of the present application;
[0012] Figure 4 is a flowchart of a fourth embodiment of the image processing method of the present application;
[0013] Figure 5 is a flowchart of a fifth embodiment of the image processing method of the present application;
[0014] Figure 6 is a flowchart of a sixth embodiment of the image processing method of the present application;
[0015] Figure 7 is a flowchart of a seventh embodiment of the image processing method of the present application;
[0016] Figure 8 is a structural schematic diagram of a specific embodiment of the connection relationship between the image sensor and the image processor of the present application;
[0017] Figure 9 is a structural schematic diagram of a specific embodiment of the connection relationship between the image sensor and the image processor of the present application;
[0018] Figure 10 is a structural schematic diagram of an embodiment of the electronic device of the present application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0020] The terms "first", "second", and the like in the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product, or device.
[0021] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears at various places in the specification is not necessarily all referring to the same embodiment, nor is it necessarily referring to a preferred or alternative embodiment to the other embodiments. It is explicitly and implicitly understood by those skilled in the art that embodiments described herein can be combined with other embodiments.
[0022] Reference is made to Figure 1 , Figure 1 The flowchart of the first embodiment of the image processing method of the present application is shown. It includes but is not limited to the following steps.
[0023] S11: In response to the start of at least one image sensor, determine at least one first image processor and at least one second image processor.
[0024] Each image sensor corresponds to at least one first image processor and at least one second image processor.
[0025] S12: When the target image sensor starts, use the first image processor corresponding to the target image sensor to perform first processing on the to-be-processed image obtained by the target image sensor to obtain a preview image.
[0026] S13: In response to receiving a photographing instruction, store the to-be-processed image obtained by the target sensor to the first cache area and / or the second cache area.
[0027] Upon receiving a capture command, the image to be processed can be stored in the first buffer. If the first buffer is full, the image to be processed can be stored in the second buffer. If the first buffer is not yet full, but the amount of data for the image to be processed is large, and the remaining buffer space in the first buffer cannot meet the storage requirements, the image to be processed can be stored in both the first and second buffers. After the first buffer is full, any unstored images of the target image sensor to be processed can be stored in the second buffer.
[0028] S14: The target image is obtained by performing a second processing on the image to be processed in the first buffer and / or the second buffer using a second image processor corresponding to the target image sensor.
[0029] When the image sensor is activated, a corresponding first image processor and a second image processor are determined to process the image to be processed acquired by the image sensor. Each image sensor corresponds to at least one first image processor and at least one second image processor. The first image processor performs real-time processing to obtain a preview image, while the second image processor performs offline processing to obtain the target image according to the capture command.
[0030] When the target image sensor is activated, the image to be processed acquired by the target sensor is transmitted to the first image processor corresponding to the target sensor to obtain a preview image. The first image processor performs a first processing on the image to be processed, which consists of relevant processing steps corresponding to the preview image.
[0031] If a capture command is received, the image to be processed from the target sensor is stored in a multi-level buffer. The image is then transferred from the buffer to a second image processor for further processing. The second processing involves steps related to the target image. If the target image includes a captured image, the second processing may include steps related to that captured image. Typically, the second processing is more complex than the first processing, involving more algorithms and functions, including but not limited to test image generation, black level correction, lens shading correction, bad pixel correction, color interpolation, white balance correction, color correction, edge enhancement, color and contrast enhancement, exposure control, etc., while the first processing usually only includes some basic processing steps.
[0032] In this embodiment, after the image sensor is activated, a preview image is acquired using a first image processor, and a target image is acquired using a second image processor. During the generation of the target image, a first buffer and a second buffer are set for the image to be processed. When a photo-taking command is received, the image to be processed can be stored in the first buffer and / or the second buffer. The setting of the second buffer improves the caching capability of the image processing process, increases the number of responses to the photo-taking command for the target image within a certain period of time, and improves the shooting efficiency.
[0033] Reference Figure 2 , Figure 2 This is a schematic flowchart of a second embodiment of the image processing method of this application. This method is a further extension of step S13, and includes, but is not limited to, the following steps.
[0034] S21: In response to receiving a photo-taking command, acquire the image to be processed from the target image sensor and the corresponding image processing auxiliary information.
[0035] Upon receiving a capture command from the corresponding target image sensor, the system acquires and processes the image output by that sensor. In addition to the image data itself, it also needs to acquire additional image processing auxiliary information to assist in processing the image. This auxiliary information may include 3A statistics, capture mode, number of captures, etc.
[0036] In one embodiment, the target image sensor outputs RAW data. After receiving the shooting command, while sending the RAW data to the second image processor for processing, it is also necessary to obtain relevant 3A statistical information, shooting mode, number of shots, and other information related to the RAW data.
[0037] S22: In response to the existence of a free area in the first buffer, the image to be processed and the image processing auxiliary information are stored in the first buffer; or in response to the absence of a free area in the first buffer, the image to be processed and the image processing auxiliary information are stored in the second buffer, so that when a free area exists in the first buffer, the image to be processed and the image processing auxiliary information are stored from the second buffer to the first buffer.
[0038] After acquiring the image to be processed and its corresponding image processing auxiliary information, it needs to be sent to the second image processor for processing. The second image processor typically has a buffer to store the data that needs to be processed. This buffer is essentially the processing queue of the second image processor. Normally, this buffer is located in RAM. However, since RAM capacity is usually small in general electronic devices, the buffer can only store a limited number of images to be processed. Therefore, when too many photo-taking commands are triggered in a short period, the data storage speed of the buffer exceeds the data processing speed of the second image processor, eventually causing the buffer to fill up and become unable to respond to further photo-taking commands.
[0039] Therefore, in this embodiment, by setting an additional cache area, namely the second cache area mentioned above, a multi-level cache area structure is formed with the original cache area and the first cache area, which expands the cache capacity of the second image processor and enables it to accommodate more images to be processed.
[0040] When the first buffer is not full, the image to be processed and the corresponding image processing auxiliary information are still stored in the first buffer. When the first buffer is full, the image to be processed and the corresponding image processing auxiliary information are stored in the second buffer. When a free area appears in the first buffer after a period of processing, the data stored in the second buffer is read into the first buffer.
[0041] After the data is stored, the second image processor retrieves the image to be processed and corresponding image processing auxiliary information from the first buffer for processing. The second image processor processes the data according to the order in which the data was stored in the first buffer. The earliest stored data is processed first.
[0042] In this embodiment, when the image to be processed exists only in the first buffer, the image to be processed is retrieved from the first buffer and processed. When the image to be processed exists in both the first and second buffers, the image to be processed is still retrieved only from the first buffer and processed.
[0043] In one embodiment, in response to the existence of a free area in the first buffer, the image to be processed and image processing auxiliary information with the earliest storage time are stored in the first buffer from the second buffer.
[0044] In one embodiment, the first cache is a RAM cache and the second cache is a ROM cache.
[0045] Reference Figure 3 , Figure 3 This is a schematic flowchart of the third embodiment of the image processing method of this application. The method is a further extension of step S11, and includes, but is not limited to, the following steps.
[0046] S31: Obtain the preview image resolution and the image output resolution of the image sensor.
[0047] S32: Determine at least one first image processor corresponding to each activated image sensor based on the preview image resolution, the image output resolution, and the image processing capability of the image processor.
[0048] When at least one image sensor is activated, that activated image sensor is designated as the target image sensor, and its image output resolution is obtained. Further, combining the required output preview image resolution and the image processing capabilities of each image processor, a first image processor capable of producing a preview image of the required resolution based on the image output by the target image sensor is determined. The preview image resolution is the resolution selected by the device when displaying the preview image. This resolution can be adjusted according to the user's selection; for example, the user can choose to display a preview image at 1080P resolution or at 2K resolution. The image processing capabilities of the image processor include the resolution information of the images it can process. All activated image sensors are iterated through, and at least one corresponding first image processor is determined for each activated image sensor.
[0049] In one embodiment, the image processors can be first divided to obtain at least one preset first image processor. Then, the desired first image processor is selected from the preset first image processors.
[0050] Reference Figure 4 , Figure 4 This is a schematic flowchart of the fourth embodiment of the image processing method of this application. The method is a further extension of step S11, and includes, but is not limited to, the following steps.
[0051] S41: Obtain the target image resolution and the image output resolution of the image sensor.
[0052] S42: Determine at least one second image processor corresponding to each activated image sensor based on the target image resolution, image output resolution, and image processing capability of the image sensor.
[0053] When at least one image sensor is activated, one of the activated image sensors is designated as the target image sensor, and its image output resolution is acquired. Further, combining the required target image resolution with the image processing capabilities of each image sensor, a second image processor is determined capable of obtaining the target image at the required resolution based on the image output by the target image sensor. The target image resolution is the image resolution selected during image acquisition and required for storage. The device then acquires the image at this resolution and stores it in the image storage application. For example, when acquiring an image, the selected storage resolution might be 2K or 1080P. The image processing capability of the image processor includes the resolution information of the images it can process. All activated image sensors are iterated through, and at least one corresponding second image processor is determined for each activated image sensor. The preview image resolution and the target image resolution can be the same or different. For example, when acquiring an image, the preview image resolution is set to 2K, and the user-selected storage resolution is also 2K. Later, the user adjusts the preview image resolution to 1080P, but does not adjust the storage resolution, continuing to acquire images at the storage resolution of 2K.
[0054] In one embodiment, the image processors can be first divided to obtain at least one preset second image processor. Then, the desired second image processor is selected from the preset second image processors.
[0055] In one embodiment, the image processors can be first divided into a preset first image processor and a preset second image processor. Then, when the image sensor is started, the first image processor corresponding to the image sensor is selected from the preset first image processors, and the second image processor corresponding to the image sensor is selected from the preset second image processors.
[0056] Image processors (ISPs) are typically categorized into Lite ISPs and Full ISPs based on their processing capabilities. Lite ISPs generally handle low-resolution image processing, while Full ISPs handle high-resolution image processing. For example, Lite ISP 1 supports real-time processing at 1080p resolution, Lite ISP 2 supports real-time processing at 4K resolution, while Full ISP 1 supports 16M resolution data processing and Full ISP 2 supports 64M resolution data processing.
[0057] The first image processor in this application may include a Lite ISP or a Full ISP. The second image processor in this application may include a Lite ISP or a Full ISP.
[0058] In one embodiment, the first image processors corresponding to each image sensor need to be different to avoid affecting the acquisition of preview images due to the use of the same first image processor.
[0059] In one embodiment, the second image processors corresponding to each image sensor may be the same or partially the same.
[0060] In the above embodiments, the corresponding image processor is determined based on the image resolution input to the image processor, the processing capability of the image processor, and the required output image resolution. The image processor is then scheduled and used according to actual needs, thereby maximizing the utilization of the image processor's performance.
[0061] In one embodiment, a first image processor performs image processing using a first process, and a second image processor performs image processing using a second process. The first process and the second process are different processes; that is, the image processing of the first image processor and the image processing of the second image processor are executed in different processes. If they were executed in the same process, an error in the processing of the preview image or the processing of the target image might affect the execution of the other processing process. Therefore, by using different independent processes for the preview image processing of the first image processor and the target image processing of the second image processor, the possibility of processing errors is reduced, processing efficiency is improved, and thus the efficiency of taking pictures is improved.
[0062] Reference Figure 5 , Figure 5 This is a flowchart illustrating the fifth embodiment of the image processing method of this application. This method is a further extension of step S13, and includes, but is not limited to, the following steps.
[0063] S51: In response to receiving a photo-taking command, acquire an image to be processed from a target image sensor or a first image processor corresponding to the target image sensor.
[0064] S52: Store the image to be processed into the first buffer and / or the second buffer.
[0065] When a photo-taking command is received, if the image to be processed from the target image sensor needs to be processed, the image to be processed is sent to the second image processor corresponding to the target image sensor. The image to be processed by the second image processor can be obtained from the first image processor corresponding to the target image sensor, or it can be obtained directly from the target image sensor.
[0066] After the image to be processed is stored in the first buffer and / or the second buffer corresponding to the second image processor, the second image processor performs subsequent processing.
[0067] In one embodiment, image processing auxiliary information is acquired simultaneously with the image to be processed. The acquisition of the image processing auxiliary information may include acquisition from a first image processor, acquisition from an image sensor, or acquisition from both a first image processor and an image sensor.
[0068] Reference Figure 6 , Figure 6 This is a schematic flowchart of the sixth embodiment of the image processing method of this application. This method is a further extension of the above embodiments and includes, but is not limited to, the following steps.
[0069] S61: In response to all image sensors being turned off and there being an image to be processed, all second image processors are turned off after processing is completed; or in response to all image sensors being turned off and there being no image to be processed, all second image processors are turned off.
[0070] When all image sensors are off, i.e. when there is no need to acquire preview images, all first image processors are turned off.
[0071] Meanwhile, if there are images to be processed, all second image processors will be shut down only after the processing of those images is complete. If there are no images to be processed, all second image processors will be shut down directly.
[0072] Reference Figure 7 , Figure 7 This is a schematic flowchart of the seventh embodiment of the image processing method of this application. This method is a further extension of the above embodiments and includes, but is not limited to, the following steps.
[0073] S71: In response to receiving a data processing instruction and an image to be processed corresponding to the data processing instruction, at least one second image processor is determined based on the image resolution of the image to be processed corresponding to the data processing instruction, the image resolution of the image to be output, and the image processing capability of the image processor.
[0074] S72: The second image processor performs a second processing on the image to be processed corresponding to the data processing instruction to obtain the target image.
[0075] If, when the image sensor is not turned on, or when the image sensor is turned on, there are additional images that need to be processed, these additional images are not the images acquired by the currently turned-on image sensor, but rather received from other devices or are previously existing images, such as images in the image library (which could be image data that has not yet been processed in a previous photo capture process), or images that need to be processed received from other servers or devices. Upon receiving data processing instructions and the corresponding images to be processed, a second image processor capable of processing is determined based on the resolution of the image to be processed, the required output image resolution, and the processing capability of the image processor. This determination method is similar to that in the fourth embodiment of the image. The resolution of the image to be processed is equivalent to the image output resolution of the image sensor, and the required output image resolution is equivalent to the target image resolution.
[0076] Data processing instructions differ from photo-taking instructions; they are processing instructions that require certain images to be processed into the desired target image.
[0077] After all the images that need to be processed have been processed, shut down all the secondary image processors.
[0078] When the second image processor processes the image, the information acquired may also include image processing auxiliary information related to the image to be processed.
[0079] The image processing method of this application will be described in more detail below with specific embodiments.
[0080] In one scenario, a device has multiple image sensors (i.e., cameras) and multiple ISPs. The image sensors establish communication connections with the ISPs via sequential MIPI and CSI interfaces.
[0081] First, set up two independent processes: one can be called the real-time processing service, which is used to generate preview images, and the other can be called the offline processing service, which is used to generate captured images.
[0082] When the camera is turned on, a corresponding real-time processing ISP can be selected for each image sensor based on the number of image sensors activated, etc. The first ISP (i.e., the first image processor mentioned above) is usually a Lite ISP. If the output image resolution of the sensor exceeds the processing capability of the Lite ISP, a Full ISP can also be used.
[0083] When the camera is turned on, at least one offline processing ISP can be selected for each image sensor based on the number of image sensors activated, and the second ISP (i.e., the second image processor mentioned above). Usually, the offline processing ISP uses a Full ISP. If the processing capability of the Lite ISP can meet the output image resolution requirements of the image sensor, a Lite ISP can also be used.
[0084] Reference Figure 8 and Figure 9 , Figure 8 and Figure 9 This is a schematic diagram illustrating a specific embodiment of the connection between an image sensor and an image processor. Figure 8 In this example, a real-time processing ISP and an offline processing ISP were selected for image sensor 1. Similarly, a real-time processing ISP and an offline processing ISP were selected for image sensor 2. Figure 9 In this diagram, one real-time processing ISP and two offline processing ISPs were selected for image sensor 1. One real-time processing ISP and one offline processing ISP were selected for image sensor 2. Notably, image sensor 1 and image sensor 2 share the same offline processing ISP.
[0085] After the camera is started, you can select Lite ISP or Full ISP based on the preview image resolution, sensor output resolution and ISP processing capabilities. The image sensor is bound to the first ISP through real-time processing service. After starting the first ISP, the camera preview is then started.
[0086] At the same time, a second ISP can also be selected and activated through offline processing services;
[0087] When the user clicks to take a picture, the real-time processing service obtains the sensor's raw output and related image processing auxiliary information, such as 3A processing information, through the first ISP;
[0088] After acquiring the raw output from the sensor, the real-time processing service queries the first buffer of the offline processing service (equivalent to the processing queue of the second ISP, usually a RAM buffer) to see if it is empty.
[0089] If the first cache of the offline processing service is empty, the real-time processing service will transfer the photo-related data to the first cache. If the first cache of the offline processing service is full, the real-time processing service will store the photo-related data in the second cache (including the ROM cache). When the first cache is empty, the offline processing service will read the oldest data in the second cache into the first cache.
[0090] The offline processing service reads data from the first cache, processes it to obtain the target image, and then stores the target image, such as in a photo album application.
[0091] The offline processing service repeats the above steps until all data in the cache has been processed.
[0092] During processing, when the user stops taking pictures and exits the camera, the sensor and the first ISP are shut down. If there is any unprocessed offline data at this time, the offline service continues to process the offline data until all data is processed; otherwise, the second ISP is shut down simultaneously.
[0093] In one scenario, assuming that an application such as a photo gallery has images that need to be processed, an offline processing service can be started separately according to the data processing instructions. The offline processing service can then be used to select and start a second ISP, and the second ISP can then be used to process the images that need to be processed.
[0094] like Figure 10 As shown, Figure 10 This is a schematic diagram of the structure of an embodiment of the electronic device of this application.
[0095] The electronic device includes a processor 110 and a memory 120.
[0096] Processor 110 controls the operation of electronic devices. Processor 110 may also be referred to as a CPU (Central Processing Unit). Processor 110 may be an integrated circuit chip with signal sequence processing capabilities. Processor 110 may also be a general-purpose processor, a digital signal sequence processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[0097] The memory 120 stores the instructions and program data required for the processor 110 to operate.
[0098] The processor 110 is used to execute instructions to implement the methods provided in any of the foregoing embodiments and possible combinations of the image processing methods of this application.
[0099] This application also provides a computer program product.
[0100] One embodiment of the computer program product includes a memory storing program data that, when executed, implements the method provided by any embodiment and possible combinations of the image processing method of this application.
[0101] The storage device may include a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or it may be a server that stores the program instructions. The server can send the stored program instructions to other devices for execution, or it can execute the stored program instructions itself.
[0102] In summary, after the image sensor is activated, a preview image is acquired using the first image processor, and the target image is acquired using the second image processor. During the generation of the target image, a first buffer and a second buffer are set up for the image to be processed. Upon receiving a capture command, the image to be processed can be stored in the first and / or second buffer. The second buffer improves the caching capability of the image processing process, increases the number of responses to the capture command for the target image within a certain time, and improves shooting efficiency.
[0103] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0104] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0105] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0106] If the integrated units in the other embodiments described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0107] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An image processing method, characterized by, The method comprises: in response to at least one image sensor starting, determining at least one first image processor and at least one second image processor; when a target image sensor starts, performing first processing on a to-be-processed image obtained by the target image sensor by using the first image processor corresponding to the target image sensor to obtain a preview image; in response to receiving a photographing instruction, storing the to-be-processed image of the target image sensor into a first cache area and / or a second cache area; performing second processing on the to-be-processed image in the first cache area and / or the second cache area by using the second image processor corresponding to the target image sensor to obtain a target image.
2. The image processing method of claim 1, wherein, The step of in response to receiving a photographing instruction, storing the to-be-processed image of the target image sensor into a first cache area and / or a second cache area comprises: in response to receiving the photographing instruction, obtaining the to-be-processed image of the target image sensor and corresponding image processing auxiliary information; in response to the first cache area having a free area, storing the to-be-processed image and the image processing auxiliary information into the first cache area, or in response to the first cache area not having a free area, storing the to-be-processed image and the image processing auxiliary information into the second cache area, so as to store the to-be-processed image and the image processing auxiliary information from the second cache area into the first cache area when the first cache area has a free area.
3. The image processing method of claim 2, wherein, The step of in response to the first cache area having a free area, storing the to-be-processed image and the image processing auxiliary information from the second cache area into the first cache area comprises: in response to the first cache area having a free area, storing the to-be-processed image and the image processing auxiliary information stored in the second cache area for the earliest time into the first cache area.
4. The image processing method of claim 1, wherein, The first cache area is a RAM cache area, and the second cache area is a ROM cache area.
5. The image processing method of claim 1, wherein, The step of in response to at least one image sensor starting, determining at least one first image processor comprises: obtaining a preview image resolution and an image output resolution of an image sensor; determining at least one first image processor corresponding to each started image sensor according to the preview image resolution, the image output resolution and image processing capability of an image processor.
6. The image processing method of claim 1, wherein, The step of in response to at least one image sensor starting, determining at least one second image processor comprises: obtaining a target image resolution and an image output resolution of an image sensor; determining at least one second image processor corresponding to each started image sensor according to the target image resolution, the image output resolution and image processing capability of an image processor.
7. The image processing method of claim 1, wherein, The first image processor performs image processing by using a first process, and the second image processor performs image processing by using a second process, wherein the first process and the second process are different processes.
8. The image processing method of claim 1, wherein, The step of in response to receiving a photographing instruction, storing the to-be-processed image of the target image sensor into a first cache area and / or a second cache area comprises: in response to receiving the photographing instruction, acquiring the to-be-processed image from the target image sensor or the first image processor corresponding to the target image sensor; storing the to-be-processed image to the first cache area and / or the second cache area.
9. The image processing method of claim 1, wherein, The method further comprises: in response to all the image sensors being closed and the second image processors processing the to-be-processed image, closing all the second image processors after the processing is completed; or in response to all the image sensors being closed and the second image processors not processing the to-be-processed image, closing all the second image processors.
10. The image processing method of claim 1, wherein, The method further comprises: in response to receiving a data processing instruction and the to-be-processed image corresponding to the data processing instruction, determining at least one second image processor according to the image resolution of the to-be-processed image corresponding to the data processing instruction, the image resolution of the to-be-output image and the image processing capability of the image processor; processing the to-be-processed image corresponding to the data processing instruction by using the second image processor to obtain the target image.
11. An electronic device, comprising: A memory and a processor are included, the memory is used to store program data, the program data can be executed by the processor to realize the method as claimed in any one of claims 1-10.
12. A computer program product, characterised in that, Program data is stored, which can be executed by a processor to realize the method as claimed in any one of claims 1-10.