Image processing method and device, electronic equipment and computer readable storage medium

By introducing a collaborative mechanism between the first and second threads in electronic devices, the problem of low operational efficiency in image processing is solved, enabling users to continue performing other operations while image processing is in progress.

CN116308992BActive Publication Date: 2026-03-17GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-10-31
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In existing technologies, there is a problem of low operational efficiency in image processing, especially when the shooting command is triggered, users cannot perform other operations on the interface.

Method used

A collaborative mechanism of first thread and second thread is adopted. The first thread is responsible for interface operation, and the second thread performs image processing. The second thread performs a second processing on the original image to ensure that the user can continue to perform other operations during the processing.

Benefits of technology

It improves the operating efficiency of electronic devices, allowing users to continue other operations while image processing is in progress, reducing waiting time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116308992B_ABST
    Figure CN116308992B_ABST
Patent Text Reader

Abstract

The application relates to an image processing method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: when a first thread receives a shooting instruction and a second thread in an idle state exists in the electronic equipment, sending an original image obtained by shooting to the second thread in the idle state through the first thread; wherein the first thread is a thread allowed to access interface controls of the electronic equipment, and the second thread is a thread prohibited to access the interface controls of the electronic equipment; and performing second processing on the original image through the second thread to obtain a second target image. The method can improve the operation efficiency of the electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application filed with the Chinese Patent Office on October 31, 2018, with application number 2018112917556, entitled "Image Processing Method and Apparatus, Electronic Device, Computer-Readable Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of image processing technology, and in particular to an image processing method and apparatus, electronic device, and computer-readable storage medium. Background Technology

[0003] Image processing methods are diverse, and different methods can produce different image effects. To obtain personalized images, users can select image processing modes on their electronic devices. For example, electronic devices can store various lighting effect modes, such as natural light, studio lighting, contour light, and stage light. When a user selects the stage light effect mode, the electronic device can process an image that simulates stage lighting effects. Summary of the Invention

[0004] This application provides an image processing method and apparatus, an electronic device, and a computer-readable storage medium, which can improve the operating efficiency of electronic devices.

[0005] An image processing method, comprising:

[0006] When the first thread receives a shooting command and there is a second thread in the electronic device that is in an idle state, the first thread sends the captured original image to the idle second thread; wherein, the first thread is a thread that is allowed to access the interface controls of the electronic device, and the second thread is a thread that is prohibited from accessing the interface controls of the electronic device.

[0007] The second thread performs a second processing on the original image to obtain a second target image.

[0008] An image processing apparatus, comprising:

[0009] An image sending module is used to send the captured original image to the idle second thread through the first thread when the first thread receives a shooting instruction and there is an idle second thread in the electronic device; wherein, the first thread is a thread that is allowed to access the interface controls of the electronic device, and the second thread is a thread that is prohibited from accessing the interface controls of the electronic device.

[0010] The image processing module is used to perform a second processing on the original image through the second thread to obtain a second target image.

[0011] An electronic device includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the following steps:

[0012] When the first thread receives a shooting command and there is a second thread in the electronic device that is in an idle state, the first thread sends the captured original image to the idle second thread; wherein, the first thread is a thread that is allowed to access the interface controls of the electronic device, and the second thread is a thread that is prohibited from accessing the interface controls of the electronic device.

[0013] The second thread performs a second processing on the original image to obtain a second target image.

[0014] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0015] When the first thread receives a shooting command and there is a second thread in the electronic device that is in an idle state, the first thread sends the captured original image to the idle second thread; wherein, the first thread is a thread that is allowed to access the interface controls of the electronic device, and the second thread is a thread that is prohibited from accessing the interface controls of the electronic device.

[0016] The second thread performs a second processing on the original image to obtain a second target image.

[0017] The aforementioned image processing method, apparatus, electronic device, and computer-readable storage medium, when a first thread receives a shooting command and a second thread in the electronic device is in an idle state, sends the captured original image to the idle second thread through the first thread. The first thread is a thread allowed to access the interface controls of the electronic device, while the second thread is a thread prohibited from accessing the interface controls. The second thread performs a second processing on the original image to obtain a second target image. By sending the captured original image to the idle second thread through the first thread for second processing, and because the first thread is allowed to access the interface controls of the electronic device while the second thread is prohibited, the second processing of the image by the second thread can be performed without being displayed on the interface of the electronic device. While the second thread is processing the image, the user can continue to perform other operations on the electronic device, thus improving the operating efficiency of the electronic device. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is an application environment diagram of an image processing method in one embodiment;

[0020] Figure 2 This is a flowchart of an image processing method in one embodiment;

[0021] Figure 3 This is a flowchart of a method for sending the original image to a second thread in one embodiment;

[0022] Figure 4 Here is a flowchart of a method for sending the original image to a second thread in another embodiment;

[0023] Figure 5 This is a flowchart of a method for processing an original image in one embodiment;

[0024] Figure 6 Here is a flowchart of a method for storing a target image in one embodiment;

[0025] Figure 7 This is a structural block diagram of an image processing device in one embodiment;

[0026] Figure 8 This is a schematic diagram of the internal structure of an electronic device in one embodiment;

[0027] Figure 9 This is a schematic diagram of an image processing circuit in one embodiment. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0029] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first thread may be referred to as a second thread, and similarly, a second thread may be referred to as a first thread. Both the first thread and the second thread are threads, but they are not the same thread.

[0030] Figure 1 This is a schematic diagram illustrating the application environment of an image processing method in one embodiment. For example... Figure 1 As shown, the application environment includes an electronic device 110. When the first thread receives a shooting command, the electronic device 110 can capture a raw image through its camera and send the captured raw image to the second thread through the first thread. The first thread is a thread that is allowed to access the interface controls of the electronic device 110; the second thread is a thread that is prohibited from accessing the interface controls of the electronic device 110. The electronic device 110 can perform a second processing on the raw image through the second thread to obtain a second target image. It is understood that the aforementioned electronic device 110 can be a mobile phone, computer, tablet computer, wearable device, etc., and is not limited here.

[0031] In one embodiment, an image processing method is provided for application to the aforementioned electronic device, as illustrated by example. Figure 2 As shown, the information processing method includes steps 202 to 204. Wherein:

[0032] Step 202: When the first thread receives the shooting instruction, it sends the captured original image to the second thread; wherein, the first thread is a thread that is allowed to access the interface controls of the electronic device, and the second thread is a thread that is prohibited from accessing the interface controls of the electronic device.

[0033] A thread is a single, sequential flow of control, through which electronic devices run programs. Multiple threads can exist within an electronic device, each running different programs. These threads can run concurrently. A shooting command can be an instruction used to direct the electronic device to capture an image. For example, when a user clicks the shooting control on the electronic device's display, the device generates a shooting command; when a user presses the shooting button on the electronic device, it generates a shooting command.

[0034] The first thread is the thread that is allowed to access the interface controls of the electronic device. For example, the first thread could be the UI (User Interface) thread, or any other thread that is allowed to access the interface controls of the electronic device; this is not limited to this. The second thread is the thread that is prohibited from accessing the interface controls of the electronic device. The raw image refers to the unprocessed image captured by the camera.

[0035] When the first thread receives a shooting command, the electronic device can capture the original image on the first thread. The electronic device can then send the captured original image to the second thread through the first thread.

[0036] Step 204: Perform a second processing on the original image using a second thread to obtain the second target image.

[0037] The second processing can be image processing of the original image, such as light effect processing, blurring processing, beautification processing, etc. After the electronic device sends the original image to the second thread through the first thread, the electronic device can perform a second processing on the original image through the second thread to obtain a second target image. For example, if the electronic device performs light effect processing on the original image through the second thread, the second target image obtained can be a light effect image.

[0038] When the first thread receives a shooting command, it sends the captured raw image to the second thread. The first thread is authorized to access the electronic device's interface controls, while the second thread is not. The second thread performs a second processing on the raw image to obtain the second target image. Because the first thread allows access to the electronic device's interface controls while the second thread restricts access, the image processing by the second thread can be hidden from the electronic device's interface. While the second thread is processing the image, the user can continue to perform other operations on the electronic device, improving its operational efficiency.

[0039] like Figure 3 As shown, in one embodiment, the provided image processing method may further include the process of sending the original image to a second thread, specifically including the following steps:

[0040] Step 302: When the first thread receives the shooting instruction, it obtains the shooting mode corresponding to the shooting instruction.

[0041] A shooting mode can be a mode used by an electronic device to capture images. For example, a shooting mode can be time-lapse mode, slow motion mode, video mode, photo mode, panorama mode, etc. The shooting mode corresponding to a shooting command can be the shooting mode selected by the user when capturing images, or the shooting mode switched by the electronic device during image capture. When the first thread receives a shooting command, the electronic device can obtain the shooting mode corresponding to the shooting command. For example, if the user selects video mode, and the user clicks a control on the electronic device's display screen to generate a shooting command, the first thread can receive the shooting command, and the electronic device can obtain the shooting mode corresponding to the shooting command as video mode.

[0042] Step 304: When the shooting mode is the first shooting mode, the original image captured is sent to the second thread through the first thread.

[0043] After receiving a shooting command and corresponding shooting mode, the electronic device can determine whether the received shooting mode is the first shooting mode. The first shooting mode can be set by the user through the electronic device, or it can be a mode defined by the electronic device based on pre-stored shooting modes. For example, the first shooting mode could be photo mode, panorama mode, etc.

[0044] When the acquired shooting mode is the first shooting mode, the electronic device can send the captured raw image to the second thread through the first thread. For example, if the electronic device acquires the shooting mode as photo mode, and the first shooting mode in the electronic device is photo mode or panorama mode, then the electronic device can send the captured raw image to the second thread through the first thread.

[0045] Step 306: When the shooting mode is the second shooting mode, the original image obtained by the first thread is processed in the second way to obtain the second target image.

[0046] The second shooting mode can be set by the user through the electronic device, or it can be a classification based on pre-stored shooting modes. For example, the second shooting mode can be a time-lapse mode, slow motion mode, video mode, etc. When the electronic device obtains the second shooting mode, it can perform a second processing on the original image captured by the first thread to obtain the second target image.

[0047] In this embodiment, when the first thread receives a shooting command, it obtains the shooting mode corresponding to the shooting command. When the shooting mode is the first shooting mode, the first thread sends the captured original image to the second thread. When the shooting mode is the second shooting mode, the first thread performs a second processing on the captured original image to obtain the second target image. After obtaining the shooting mode, the electronic device can select different threads to perform the second processing on the original image according to the shooting mode, which improves the operating efficiency of the electronic device and the image processing efficiency.

[0048] In another embodiment, such as Figure 4 As shown, the provided image processing method may further include the process of sending the original image to a second thread, and the specific steps include:

[0049] Step 402: Detect whether there is a second thread in the electronic device that is in an idle state.

[0050] Threads in electronic devices can be in different states. There are three basic states: idle, blocked, and running. The idle state means that the thread has all the conditions to run and is waiting to be executed; logically, it can execute. The blocked state means that the thread is waiting for an event and logically, it cannot execute. The running state means that the thread is running the program.

[0051] The electronic device can detect the state of the second thread. Specifically, the electronic device can detect whether a second thread is in an idle state.

[0052] Step 404: When there is a second thread in the electronic device that is in an idle state, the original image captured is sent to the second thread in the idle state through the first thread.

[0053] When the electronic device detects the existence of a second thread in an idle state, it indicates that the electronic device has a second thread that meets all the operating conditions and is waiting to run. The electronic device can send the captured raw image to the idle second thread through the first thread, and the idle second thread will perform a second processing on the raw image to obtain the second target image.

[0054] Step 406: When there is no idle second thread in the electronic device, a new second thread is created, and the original image captured is sent to the new second thread through the first thread.

[0055] When the electronic device detects that there is no idle second thread, it means that there is no runnable second thread in the electronic device, and the electronic device can create a new second thread. After the new second thread is created, the electronic device can send the captured original image to the new second thread through the first thread, and the new second thread will perform a second processing on the original image to obtain the second target image.

[0056] In this embodiment, by detecting whether a second thread is idle in the electronic device, when an idle second thread exists, the first thread sends the captured original image to the idle second thread. When no idle second thread exists, a new second thread is created, and the first thread sends the captured original image to the new second thread. By detecting whether the second thread is idle, the electronic device only creates a new second thread when no idle second thread exists, thus making full use of the idle second threads and improving the resource utilization rate of the electronic device.

[0057] like Figure 5As shown, in one embodiment, the provided image processing method may further include a process of processing the original image, specifically including:

[0058] Step 502: When there is no second thread in the electronic device that is in an idle state, count the number of threads in the second thread in the electronic device.

[0059] An electronic device can have multiple secondary threads. When there are no idle secondary threads in the electronic device, the device can count the number of secondary threads.

[0060] Step 504: When the number of threads is less than the number threshold, a new second thread is created, and the original image captured by the first thread is sent to the new second thread.

[0061] The quantity threshold can be set by the user or by the electronic device based on its own system operation. The quantity threshold is a specific numerical value; for example, it can be 3, 5, 6, etc.

[0062] After the electronic device counts the number of threads in the second thread, it compares this count with a threshold. If the number of threads in the second thread is less than the threshold, the electronic device can create a new second thread. For example, if the electronic device detects 3 threads in the second thread and the threshold is 4, the number of threads in the second thread is less than the threshold, so the electronic device can create a new second thread. After the new second thread is created, the electronic device can send the captured raw image from the first thread to the new second thread for processing.

[0063] Step 506: When the number of threads is greater than or equal to the number threshold, the first thread performs a second processing on the captured original image to obtain the second target image.

[0064] When the electronic device compares the number of threads in the second thread with the number threshold and the result is that the number of threads is greater than or equal to the number threshold, it indicates that there are already a large number of second threads running in the electronic device. The electronic device can then use the second threads to perform a second processing on the original image captured to obtain a second target image.

[0065] In this embodiment, when there is no idle second thread in the electronic device, the number of second threads in the electronic device is counted. When the number of threads is less than a threshold, a new second thread is created, and the original image captured is sent to the new second thread through the first thread. When the number of threads is greater than or equal to the threshold, the original image captured is processed by the first thread to obtain the second target image. When there is no idle second thread in the electronic device, the decision to create a new second thread is made based on the number of second threads, and the decision is made on which thread to process the original image, thereby reducing the burden on the electronic device.

[0066] In one embodiment, such as Figure 6 As shown, the provided image processing method may further include a process of storing the target image, specifically including the following steps:

[0067] Step 602: Perform first processing on the original image through the first thread to obtain the first target image.

[0068] The first processing can be a simplified processing of the original image by the electronic device through a first thread. When the first thread receives a shooting command, the electronic device can perform a first processing on the captured original image through the first thread to obtain the first target image.

[0069] Step 604: Store the first target image.

[0070] After obtaining the first target image, the electronic device can store it. Specifically, the electronic device can store the first target image in an image library, for example, it can store the first target image in a photo album.

[0071] Step 606: Perform a second processing on the original image through a second thread, wherein the time consumed by the first processing is less than the time consumed by the second processing.

[0072] The second processing can be a fine-tuning of the original image by the electronic device through a second thread. The time consumed by the electronic device to perform the first processing on the original image through the first thread is less than the time consumed to perform the second processing on the original image through the second thread.

[0073] Step 608: When the second processing is detected to be complete, the first target image will be replaced and stored according to the second target image obtained from the second processing.

[0074] The electronic device can detect the processing progress of the first and second processing steps. When the electronic device detects that the second processing is complete, it can obtain the second target image. The electronic device can then replace the first target image with the second target image for storage. For example, the electronic device stores the first target image obtained by performing the first processing on the original image through the first thread in a photo album. When the electronic device detects that the second processing is complete, it can replace the first target image with the obtained second target image for storage in the photo album; that is, the electronic device can delete the first target image from the photo album and store the second target image in the photo album.

[0075] In this embodiment, a first thread performs a first processing on the original image to obtain a first target image, which is then stored. A second thread then performs a second processing on the original image. The time consumed by the first processing is less than the time consumed by the second processing. When the second processing is complete, the first target image is replaced and stored with the second target image obtained from the second processing. The electronic device performs the first processing on the original image using the first thread and the second processing using the second thread. Because both threads process the original image simultaneously, the second processing takes longer than the first processing, resulting in a more accurate image. Storing this more accurate image in the electronic device demonstrates the accuracy of the image processing. Since the second processing takes longer, the electronic device can store the first target image obtained from the first processing. When the electronic device acquires the original image and the user needs to view it immediately, the electronic device can display the stored first target image, reducing the user's waiting time.

[0076] In one embodiment, the provided image processing method may further include a process of displaying a thumbnail, specifically including: compressing the first target image to generate a corresponding thumbnail, and displaying the thumbnail on the interface of an electronic device.

[0077] After acquiring the first target image, the electronic device can compress the image and generate a corresponding thumbnail. The electronic device can then display the generated thumbnail on its interface. Specifically, the location where the thumbnail is displayed on the interface can be user-defined or it can be the electronic device's default location.

[0078] In one embodiment, the provided image processing method may further include a process of performing a first processing on the original image through a first thread and a second processing on the original image through a second thread, specifically including: obtaining a first light effect model through the first thread, and performing a first processing on the original image according to the first light effect model to obtain a first target image; obtaining a second light effect model through the second thread, and performing a second processing on the original image according to the second light effect model.

[0079] The first and second lighting effect models are models simulating changes in light. For example, the first and second lighting effect models can be natural light effect models, contour light effect models, stage light effect models, background blur models, etc. The resource usage of the first lighting effect model is less than that of the second lighting effect model. For example, if both the first and second lighting effect models are natural light effect models, the resource usage of the first natural light effect model will be less than that of the second natural light effect model. Resource usage refers to the amount of resources used by the program during runtime. For example, resource usage can be 40%, 43%, 65%, etc. Resource usage can be CPU usage, memory usage, storage space usage, etc., and is not limited here.

[0080] The electronic device can acquire a first lighting effect model through a first thread, and use the acquired first lighting effect model to perform a first processing on the original image to obtain a first target image. The electronic device can acquire a second lighting effect model through a second thread, and use the second lighting effect model to perform a first processing on the original image to obtain a second target image.

[0081] In this embodiment, the electronic device acquires a first lighting effect model through a first thread and performs a first processing on the original image according to the first lighting effect template to obtain a first target image; it then acquires a second lighting effect model through a second thread and performs a second processing on the original image according to the second lighting effect model. The resource occupancy rate of the first lighting effect model is less than that of the second lighting effect model. By using different lighting effect models in different threads to process the image, the electronic device can achieve different levels of image processing.

[0082] In one embodiment, an image processing method is provided, and the specific steps for implementing the method are as follows:

[0083] (1) When the first thread receives the shooting instruction, it obtains the shooting mode corresponding to the shooting instruction.

[0084] (2) When the shooting mode is the second shooting mode, the original image obtained by the first thread is processed in the second way to obtain the second target image.

[0085] (3) When the shooting mode is the first shooting mode, detect whether there is a second thread in the electronic device that is in an idle state.

[0086] (4) When there is a second thread in the electronic device that is in an idle state, the first thread performs a first processing on the original image to obtain a first target image; the first target image is compressed to generate a corresponding thumbnail, and the thumbnail is displayed on the interface of the electronic device; the first target image is stored; the original image captured is sent to the second thread that is in an idle state through the first thread, the second light effect model is obtained through the second thread that is in an idle state, and the original image is processed in a second way according to the second light effect model; when the second processing is detected to be completed, the first target image is replaced by the second target image obtained by the second processing and stored.

[0087] (5) When there is no second thread in the electronic device that is in an idle state, count the number of threads of the second thread in the electronic device.

[0088] (6) When the number of threads is less than the number threshold, the first thread performs the first processing on the original image to obtain the first target image; the first target image is compressed to generate the corresponding thumbnail, and the thumbnail is displayed on the interface of the electronic device; a new second thread is established, and the original image captured by the first thread is sent to the new second thread; the second light effect model is obtained through the new second thread, and the original image is processed in the second way according to the second light effect model; when the second processing is detected to be completed, the first target image is replaced by the second target image obtained by the second processing and stored.

[0089] (7) When the number of threads is greater than or equal to the number threshold, the second light effect model is obtained through the first thread, and the original image is processed according to the second light effect model to obtain the second target image.

[0090] It should be understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0091] In one embodiment, such as Figure 7As shown, an image processing apparatus 700 is provided, including: an image sending module 710 and an image processing module 720, wherein:

[0092] The image sending module 710 is used to send the captured original image to the second thread through the first thread when the first thread receives the shooting instruction; wherein the first thread is a thread that is allowed to access the interface controls of the electronic device, and the second thread is a thread that is prohibited from accessing the interface controls of the electronic device.

[0093] The image processing module 720 is used to perform a second processing on the original image through a second thread to obtain a second target image.

[0094] The image processing apparatus provided in the above embodiments, when a first thread receives a shooting command, sends the captured original image to a second thread. The first thread is a thread that allows access to the interface controls of the electronic device, while the second thread is a thread that prohibits access to the interface controls. The second thread performs a second processing on the original image to obtain a second target image. By sending the captured original image to the second thread for second processing, and because the first thread allows access to the interface controls of the electronic device while the second thread prohibits access, the image processing by the second thread can be performed without being displayed on the electronic device's interface. While the second thread is processing the image, the user can continue to perform other operations on the electronic device, improving the operational efficiency of the electronic device.

[0095] In one embodiment, the image sending module 702 is further configured to obtain the shooting mode corresponding to the shooting command when the first thread receives the shooting command; when the shooting mode is the first shooting mode, the first thread sends the original image obtained by shooting to the second thread.

[0096] In one embodiment, the image sending module 702 is further configured to detect whether there is a second thread in the electronic device that is in an idle state; when there is a second thread in the electronic device that is in an idle state, the original image captured is sent to the second thread in the idle state through the first thread; when there is no second thread in the electronic device that is in an idle state, a new second thread is established, and the original image captured is sent to the new second thread through the first thread.

[0097] In one embodiment, the image sending module 702 is further configured to count the number of threads of the second thread in the electronic device when there is no second thread in the electronic device that is in an idle state; when the number of threads is less than the number threshold, to create a new second thread and send the captured original image to the new second thread through the first thread.

[0098] In one embodiment, the image processing module 704 is further configured to perform second processing on the original image captured by the first thread to obtain a second target image when the shooting mode is the second shooting mode.

[0099] In one embodiment, the image processing module 704 is further configured to perform a second processing on the captured original image through the first thread when the number of threads is greater than or equal to a number threshold, thereby obtaining a second target image.

[0100] In one embodiment, the image processing module 704 is further configured to perform a first processing on the original image through a first thread to obtain a first target image; store the first target image; perform a second processing on the original image through a second thread; wherein the time consumed by the first processing is less than the time consumed by the second processing; when the second processing is detected to be completed, the first target image is replaced by the second target image obtained by the second processing and stored.

[0101] In one embodiment, the image processing module 704 is further configured to compress the first target image to generate a corresponding thumbnail, and display the thumbnail in the interface of the electronic device.

[0102] In one embodiment, the image processing module 704 is further configured to obtain a first light effect model through a first thread, and perform a first processing on the original image according to the first light effect model to obtain a first target image; obtain a second light effect model through a second thread, and perform a second processing on the original image according to the second light effect model; wherein the first light effect model and the second light effect model are models simulating changes in light, and the resource occupancy rate of the first light effect model is less than that of the second light effect model.

[0103] The division of the various modules in the above-described image processing device is only for illustrative purposes. In other embodiments, the image processing device may be divided into different modules as needed to complete all or part of the functions of the above-described image processing device.

[0104] For specific limitations regarding the image processing apparatus, please refer to the limitations on the image processing method above, which will not be repeated here. Each module in the aforementioned image processing apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.

[0105] The various modules in the image processing apparatus provided in this application embodiment can be implemented in the form of a computer program. This computer program can run on a terminal or server. The program modules constituted by this computer program can be stored in the memory of the terminal or server. When the computer program is executed by a processor, it implements the steps of the method described in the embodiments of this application.

[0106] In one embodiment, such as Figure 8 The diagram illustrates the internal structure of an electronic device. This electronic device includes a processor, a memory, a display, and a network interface connected via a system bus. The processor provides computing and control capabilities to support the operation of the entire electronic device. The memory stores data, programs, and / or instruction code, and at least one computer program is stored in the memory. This computer program can be executed by the processor to implement the image processing method for electronic devices provided in the embodiments of this application. The memory may include non-volatile storage media such as magnetic disks, optical disks, and read-only memory (ROM), or random-access memory (RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, a database, and a computer program. This computer program can be executed by the processor to implement an image processing method provided in various embodiments of this application. The internal memory provides a cached operating environment for the operating system, database, and computer program in the non-volatile storage medium. The display can be used to display an upload interface, etc. The network interface can be an Ethernet card or a wireless network card, etc., used to communicate with external electronic devices, such as servers or other electronic devices.

[0107] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0108] This application also provides an electronic device. The electronic device includes an image processing circuit, which can be implemented using hardware and / or software components, and may include various processing units that define an ISP (Image Signal Processing) pipeline. Figure 9 This is a schematic diagram of an image processing circuit in one embodiment. For example... Figure 9 As shown, for ease of explanation, only aspects of the image processing technology related to the embodiments of this application are shown.

[0109] like Figure 9 As shown, the image processing circuit includes an ISP processor 940 and a control logic unit 950. Image data captured by the imaging device 910 is first processed by the ISP processor 940, which analyzes the image data to capture image statistics that can be used to determine and / or control parameters of the imaging device 910. The imaging device 910 may include a camera having one or more lenses 912 and an image sensor 914. The image sensor 914 may include a color filter array (such as a Bayer filter), and can acquire light intensity and wavelength information captured by each imaging pixel of the image sensor 914, providing a set of raw image data that can be processed by the ISP processor 940. A sensor 920 (such as a gyroscope) can provide the acquired image processing parameters (such as image stabilization parameters) to the ISP processor 940 based on the sensor 920 interface type. The sensor 920 interface may utilize an SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above interfaces.

[0110] In addition, image sensor 914 can also send raw image data to sensor 920. Sensor 920 can provide the raw image data to ISP processor 940 based on sensor 920 interface type, or sensor 920 can store the raw image data in image memory 930.

[0111] The ISP processor 940 processes raw image data pixel by pixel in various formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits. The ISP processor 940 can perform one or more image processing operations on the raw image data and collect statistical information about the image data. The image processing operations can be performed with the same or different bit depth precision.

[0112] The ISP processor 940 can also receive image data from the image memory 930. For example, the sensor 920 interface sends raw image data to the image memory 930, and the raw image data in the image memory 930 is then provided to the ISP processor 940 for processing. The image memory 930 may be part of a memory device, a storage device, or a separate dedicated memory within an electronic device, and may include DMA (Direct Memory Access) features.

[0113] Upon receiving raw image data from the image sensor 914 interface, the sensor 920 interface, or the image memory 930, the ISP processor 940 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to the image memory 930 for further processing before display. The ISP processor 940 receives processed data from the image memory 930 and performs image data processing on the processed data in the raw domain and in the RGB and YCbCr color spaces. The processed image data may be output to the display 970 for user viewing and / or further processed by a graphics engine or GPU (Graphics Processing Unit). Furthermore, the output of the ISP processor 940 may also be sent to the image memory 930, and the display 970 may read image data from the image memory 930. In one embodiment, the image memory 930 may be configured to implement one or more frame buffers. Additionally, the output of the ISP processor 940 may be sent to an encoder / decoder 960 for encoding / decoding image data. The encoded image data may be stored and decompressed before being displayed on the display 970 device. The encoder / decoder 960 can be implemented using a CPU, GPU, or coprocessor.

[0114] The statistical data determined by the ISP processor 940 can be sent to the control logic unit 950. For example, the statistical data may include image sensor 914 statistics such as automatic exposure, automatic white balance, automatic focus, flicker detection, black level compensation, and lens 912 shading correction. The control logic unit 950 may include a processor and / or microcontroller executing one or more routines (such as firmware) that determine control parameters for the imaging device 910 and the ISP processor 940 based on the received statistical data. For example, the control parameters for the imaging device 910 may include sensor 920 control parameters (e.g., gain, integral time for exposure control, image stabilization parameters, etc.), camera flash control parameters, lens 912 control parameters (e.g., focal length for focusing or zooming), or combinations of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (e.g., during RGB processing), and lens 912 shading correction parameters.

[0115] This application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of an image processing method.

[0116] A computer program product containing instructions that, when run on a computer, causes the computer to perform an image processing method.

[0117] Any references to memory, storage, databases, or other media used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).

[0118] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. An image processing method, characterized by, The method comprises: when the first thread receives a shooting instruction, obtaining a shooting mode corresponding to the shooting instruction; when the shooting mode is a first shooting mode, and when there is a second thread in an idle state in the electronic device, sending, by the first thread, a raw image obtained by shooting to the second thread in the idle state; wherein the first thread is a thread that is allowed to access interface controls of the electronic device, and the second thread is a thread that is prohibited from accessing interface controls of the electronic device; performing, by the second thread, second processing on the raw image to obtain a second target image; the second processing comprises one or more of light effect processing, blurring processing, or beautifying processing.

2. The method of claim 1, wherein, The method further comprises: when the shooting mode is a second shooting mode, performing, by the first thread, second processing on a raw image obtained by shooting to obtain a second target image.

3. The method of claim 1, wherein, The method further comprises: when the first thread receives a shooting instruction and there is no second thread in an idle state in the electronic device, establishing a new second thread, and sending, by the first thread, a raw image obtained by shooting to the new second thread.

4. The method of claim 3, wherein, The method further comprises: when the first thread receives a shooting instruction and there is no second thread in an idle state in the electronic device, establishing a new second thread, and sending, by the first thread, a raw image obtained by shooting to the new second thread. The method further comprises: when the first thread receives a shooting instruction and there is no second thread in an idle state in the electronic device, establishing a new second thread, and sending, by the first thread, a raw image obtained by shooting to the new second thread. The method further comprises:

5. The method according to any one of claims 1 to 4, characterized in that, when the first thread receives a shooting instruction and there is no second thread in an idle state in the electronic device, establishing a new second thread, and sending, by the first thread, a raw image obtained by shooting to the new second thread. The method further comprises: when the first thread receives a shooting instruction and there is no second thread in an idle state in the electronic device, establishing a new second thread, and sending, by the first thread, a raw image obtained by shooting to the new second thread. The method further comprises: performing, by the first thread, first processing on the raw image to obtain a first target image; storing the first target image; 6. The method of claim 5, wherein, The method further comprises: performing, by the second thread, second processing on the raw image; wherein a time length consumed by the first processing is less than a time length consumed by the second processing; 7. The method of claim 5, wherein, when it is detected that the second processing is completed, replacing the first target image stored according to the second target image obtained according to the second processing. The method further comprises: performing compression processing on the first target image to generate a corresponding thumbnail, and displaying the thumbnail in an interface of the electronic device. The method further comprises: obtaining, by the first thread, a first light effect model, and performing first processing on the raw image according to the first light effect model to obtain a first target image; The second processing of the original image by the second thread comprises: The second thread acquires a second light effect model, and performs second processing on the original image according to the second light effect model; wherein the first light effect model and the second light effect model are models simulating light changes, and the resource occupancy rate of the first light effect model is less than that of the second light effect model.

8. An image processing apparatus characterized by comprising: Comprise: The image sending module, when the first thread receives a shooting instruction, acquires a shooting mode corresponding to the shooting instruction; when the shooting mode is a first shooting mode, and when there is a second thread in an idle state in the electronic device, the first thread sends an original image obtained by shooting to the second thread in the idle state; wherein the first thread is a thread that is allowed to access interface controls of the electronic device, and the second thread is a thread that is prohibited to access the interface controls of the electronic device. The image processing module is configured to perform second processing on the original image by the second thread to obtain a second target image; the second processing comprises one or more of light effect processing, blurring processing, or beautifying processing. 9.An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to perform the steps of the image processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the image processing method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for controlling image display

    CN102376291A

  • Medical image processing method and device, storage medium and medical image device

    CN108022203A