CN116308992A - Image processing method and device, electronic equipment and computer readable storage medium - Google Patents

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

Info

Publication number
CN116308992A
CN116308992A CN202310251966.1A CN202310251966A CN116308992A CN 116308992 A CN116308992 A CN 116308992A CN 202310251966 A CN202310251966 A CN 202310251966A CN 116308992 A CN116308992 A CN 116308992A
Authority
CN
China
Prior art keywords
thread
image
processing
original image
electronic equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310251966.1A
Other languages
Chinese (zh)
Inventor
张弓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202310251966.1A priority Critical patent/CN116308992A/en
Publication of CN116308992A publication Critical patent/CN116308992A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

The application relates to an image processing method and device, an electronic device 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; the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment; and performing second processing on the original image through the second thread to obtain a second target image. By adopting the method, the operation efficiency of the electronic equipment can be improved.

Description

Image processing method and device, electronic equipment and computer readable storage medium
The present application is a divisional application filed by the chinese patent office at 10/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
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, an electronic device, and a computer readable storage medium.
Background
The image processing modes are various, and images with different effects can be obtained by adopting different image processing modes. To obtain a personalized image, the user may select an image processing mode in the electronic device to process the image. For example, the electronic device may store a plurality of light effect processing modes such as a natural light effect mode, a studio light effect mode, a contour light effect mode, and a stage light effect mode. When the user selects the stage light effect mode, the electronic equipment can process and obtain an image simulating the stage light effect.
Disclosure of Invention
The embodiment of the application provides an image processing method and device, electronic equipment and a computer readable storage medium, which can improve the operation efficiency of the electronic equipment.
An image processing method, comprising:
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; the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment;
And performing second processing on the original image through the second thread to obtain a second target image.
An image processing apparatus comprising:
the image sending module is used for sending the original image obtained by shooting to the second thread in the idle state through the first thread when the first thread receives a shooting instruction and the second thread in the idle state exists in the electronic equipment; the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment;
and the image processing module is used for carrying out second processing on the original image through the second thread to obtain a second target image.
An electronic device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
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; the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment;
And performing second processing on the original image through the second thread to obtain a second target image.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
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; the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment;
and performing second processing on the original image through the second thread to obtain a second target image.
When the first thread receives a shooting instruction and a second thread in an idle state exists in the electronic equipment, the original image obtained through shooting is sent to the second thread in the idle state through the first thread; the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment; and performing second processing on the original image through a second thread to obtain a second target image. The first thread sends the shot original image to a second thread in an idle state, and the second thread carries out second processing, and because the first thread is a thread allowing access to the interface control of the electronic equipment and the second thread is a thread prohibiting access to the interface control of the electronic equipment, the second processing of the image through the second thread can not be displayed in the interface of the electronic equipment, and when the second thread processes the image, a user can continue to carry out other operations on the electronic equipment, so that the operation efficiency of the electronic equipment is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a diagram of an application environment for an image processing method in one embodiment;
FIG. 2 is a flow chart of an image processing method in one embodiment;
FIG. 3 is a flow diagram of a method of sending an original image to a second thread in one embodiment;
FIG. 4 is a flowchart of a method for sending an original image to a second thread in another embodiment;
FIG. 5 is a flow chart of a method of processing an original image in one embodiment;
FIG. 6 is a flow diagram of a method of storing a target image in one embodiment;
FIG. 7 is a block diagram showing the structure of an image processing apparatus in one embodiment;
FIG. 8 is a schematic diagram of the internal structure of an electronic device in one embodiment;
fig. 9 is a schematic diagram of an image processing circuit in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It will be understood that the terms "first," "second," and the like, as used herein, may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, the first thread Cheng Chenwei may be a second thread, and similarly, the second thread may be referred to as a first thread, without departing from the scope of the present application. The first thread and the second thread are both threads, but they are not the same thread.
Fig. 1 is a schematic view of an application environment of an image processing method in an embodiment. As shown in fig. 1, the application environment includes an electronic device 110. When the first thread receives the photographing instruction, the electronic device 110 may photograph an original image through the camera, and send the photographed original image to the second thread through the first thread. Wherein the first thread is a thread that allows access to an interface control of the electronic device 110; the second thread is a thread that prohibits access to the interface control of the electronic device 110. The electronic device 110 may perform a second process on the original image through a second thread to obtain a second target image. It is to be understood that the electronic device 110 may be a mobile phone, a computer, a tablet computer, a wearable device, etc., which is not limited herein.
In one embodiment, an image processing method is provided for application to the electronic device described above for illustration, and as shown in fig. 2, the information processing method includes steps 202 to 204. Wherein:
step 202, when a first thread receives a shooting instruction, sending an original image obtained by shooting to a second thread through the first thread; the first thread is a thread allowing access to the interface control of the electronic device, and the second thread is a thread prohibiting access to the interface control of the electronic device.
A thread is a single sequential control flow through which an electronic device can run a program. There may be multiple threads in an electronic device, running different programs, respectively. Wherein multiple threads may run simultaneously. The photographing instruction may be an instruction for instructing the electronic device to photograph an image. For example, when a user clicks a shooting control in a display screen of the electronic device, the electronic device may generate a shooting instruction; when a user presses a photographing button in the electronic device, the electronic device may generate a photographing instruction.
The first thread is a thread that allows access to an Interface control of the electronic device, for example, the first thread may be a UI (User Interface) thread, and may be another thread that allows access to an Interface control of the electronic device, which is not limited herein. The second thread is a thread that prohibits access to an interface control of the electronic device. The original image refers to an unprocessed image acquired by the camera.
When the first thread receives the shooting instruction, the electronic device can shoot an original image on the first thread. The electronic device may send the captured original image to the second thread via the first thread.
And 204, performing second processing on the original image through a second thread to obtain a second target image.
The second process may be image processing of the original image, for example, light effect processing, blurring processing, beautifying processing, or the like. After the electronic device sends the original image to the second thread through the first thread, the electronic device can perform second processing on the original image through the second thread to obtain a second target image. For example, the electronic device performs light effect processing on the original image through the second thread, and the obtained second target image may be a light effect image.
When the first thread receives a shooting instruction, the original image obtained through shooting is sent to a second thread through the first thread, wherein the first thread is a thread allowing access to the interface control of the electronic equipment, the second thread is a thread prohibiting access to the interface control of the electronic equipment, and the second thread carries out second processing on the original image to obtain a second target image. The first thread sends the shot original image to the second thread, and the second thread carries out second processing, because the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment, the second processing of the image through the second thread can not be displayed in the interface of the electronic equipment, and when the second thread processes the image, a user can continue to carry out other operations on the electronic equipment, so that the operation efficiency of the electronic equipment is improved.
As shown in fig. 3, in one embodiment, the provided image processing method may further include a process of sending the original image to the second thread, and the specific steps include:
in step 302, when the first thread receives the shooting instruction, a shooting mode corresponding to the shooting instruction is obtained.
The shooting mode may be a mode for capturing an image in the electronic device. For example, the shooting mode may be a time-lapse shooting mode, a slow motion mode, a video mode, a photo mode, a panoramic mode, or the like. The shooting mode corresponding to the shooting instruction can be a shooting mode selected by a user when an image is acquired, or can be a shooting mode switched by the electronic equipment when the image is acquired. When the first thread receives the shooting instruction, the electronic device can acquire a shooting mode corresponding to the shooting instruction. For example, when the shooting mode selected by the user is a video mode and the user clicks a control on the display screen of the electronic device to generate a shooting instruction, the first thread can receive the shooting instruction, and the electronic device can acquire the shooting mode corresponding to the shooting instruction as the video mode.
In step 304, when the shooting mode is the first shooting mode, the original image obtained by shooting is sent to the second thread through the first thread.
After the electronic device obtains the shooting mode corresponding to the shooting instruction, whether the obtained shooting mode is the first shooting mode or not can be judged. The first shooting mode may be set by a user through the electronic device, or may be divided by the electronic device according to the stored shooting modes. For example, the first photographing mode may be a photograph mode, a panorama mode, or the like.
When the acquired shooting mode is the first shooting mode, the electronic device can send the original image obtained through shooting to the second thread through the first thread. For example, the shooting mode acquired by the electronic device is a photo mode, and the first shooting mode in the electronic device is a photo mode or a panoramic mode, so that the electronic device can send the original image obtained by shooting to the second thread through the first thread.
And 306, when the shooting mode is the second shooting mode, performing second processing on the shot original image through the first thread to obtain a second target image.
The second photographing mode may be set by the user through the electronic device, or may be divided by the electronic device according to photographing modes already stored. For example, the second photographing mode may be a time-lapse photographing mode, a slow motion mode, a video mode, or the like. When the shooting mode acquired by the electronic equipment is the second shooting mode, the electronic equipment can perform second processing on the original image obtained through shooting through the first thread, and a second target image is obtained.
In this embodiment, when the first thread receives the shooting instruction, a shooting mode corresponding to the shooting instruction is acquired, when the shooting mode is the first shooting mode, the first thread sends the original image obtained by shooting to the second thread, and when the shooting mode is the second shooting mode, the first thread performs second processing on the original image obtained by shooting to obtain the second target image. After the electronic equipment acquires the shooting mode, different threads can be selected according to the shooting mode to perform second processing on the original image, so that the operation efficiency of the electronic equipment is improved, and meanwhile, the processing efficiency of the image can also be improved.
In another embodiment, as shown in fig. 4, the provided image processing method may further include a process of sending the original image to the second thread, and the specific steps include;
step 402, it is detected whether a second thread in an idle state is present in the electronic device.
Threads in electronic devices can be in different states, and the threads have three basic states of idle, blocking and running. The idle state of the thread refers to all conditions of the thread with running, and the thread can logically execute when waiting to run; the blocked state of a thread means that the thread is logically non-executable while waiting for an event; the running state of a thread refers to the thread running a program.
The electronic device may detect a state of the second thread. In particular, the electronic device may detect whether there is a second thread in an idle state.
Step 404, when there is a second thread in an idle state in the electronic device, sending, by the first thread, the captured original image to the second thread in the idle state.
And when the second thread in the idle state exists as a result of detection of the electronic equipment, the second thread with all running conditions exists in the electronic equipment, and the electronic equipment waits for running. The electronic device can send the photographed original image to a second thread in an idle state through the first thread, and the second thread in the idle state carries out second processing on the original image to obtain a second target image.
In step 406, when there is no second thread in idle state in the electronic device, a new second thread is established, and the captured original image is sent to the new second thread through the first thread.
And when the detected result of the electronic equipment is that the second thread in the idle state does not exist, the electronic equipment indicates that the second thread capable of running does not exist in the electronic equipment, and the electronic equipment can establish a new second thread. After the new second thread is established, the electronic device can send the original image obtained through shooting to the new second thread through the first thread, and the second processing is carried out on the original image through the new second thread to obtain a second target image.
In this embodiment, by detecting whether a second thread in an idle state exists in the electronic device, when the second thread in the idle state exists in the electronic device, the first thread sends the captured original image to the second thread in the idle state, and when the second thread in the idle state does not exist in the electronic device, a new second thread is established, and the first thread sends the captured original image to the new second thread. The electronic equipment detects whether the second thread is in the idle state or not, and when the second thread in the idle state does not exist in the electronic equipment, a new second thread is built, the second thread in the idle state in the electronic equipment is fully utilized, and the resource utilization rate of the electronic equipment is improved.
As shown in fig. 5, in one embodiment, the provided image processing method may further include a process of processing an original image, including the following specific steps:
step 502, counting the number of threads of the second thread in the electronic device when the second thread in the idle state does not exist in the electronic device.
There may be a plurality of second threads in the electronic device. When there is no second thread in the idle state in the electronic device, the electronic device may count the number of threads of the second thread.
And step 504, when the number of threads is smaller than the number threshold, a new second thread is established, and the photographed original image is sent to the new second thread through the first thread.
The number threshold may be set by a user, or may be set by the electronic device according to the operation condition of the system thereof. The quantity threshold is a specific value, for example, the quantity threshold may be a value of 3, 5, 6, etc.
After the electronic device counts the number of threads of the second thread, the counted number of threads of the second thread may be compared with a number threshold, and when the number of threads of the second thread is smaller than the number threshold, the electronic device may establish a new second thread. For example, the electronic device may acquire the number of threads of the second thread as 3, the number threshold as 4, and the number of threads of the second thread is less than the number threshold, and the electronic device may establish a new second thread. After the new second thread is established, the electronic device can send the photographed original image to the new second thread through the first thread, and the original image is processed through the new second thread.
And step 506, when the number of threads is greater than or equal to the number threshold, performing second processing on the photographed original image by the first thread to obtain a second target image.
When the electronic device compares the number of threads of the second threads with the number threshold value to obtain a result that the number of threads is larger than or equal to the number threshold value, the electronic device indicates that more second threads exist in the electronic device and can perform second processing on the photographed original image through the second threads to obtain a second target image.
In this embodiment, when there is no second thread in an idle state in the electronic device, counting the number of threads of the second thread in the electronic device, when the number of threads is smaller than a number threshold, establishing a new second thread, sending the original image obtained by shooting to the new second thread through the first thread, and when the number of threads is greater than or equal to the number threshold, performing a second process on the original image obtained by shooting through the first thread, so as to obtain a second target image. When the second thread in the idle state does not exist in the electronic equipment, whether a new second thread is established or not is determined according to the number of threads of the second thread, and the processing of the original image is determined by which thread, so that the burden of the electronic equipment is reduced.
In one embodiment, as shown in fig. 6, the provided image processing method may further include a process of storing the target image, and the specific steps include:
In step 602, a first process is performed on an original image by a first thread, so as to obtain a first target image.
The first process may be a simplified process of the original image by the electronic device through the first thread. After the first thread receives the shooting instruction, the electronic device can perform first processing on the original image obtained through shooting through the first thread, and a first target image is obtained.
Step 604, the first target image is stored.
After obtaining the first target image, the electronic device may store the first target image. Specifically, the electronic device may store the first target image in an image library, e.g., the electronic device may store the first target image in an album.
And step 606, performing second processing on the original image through a second thread, wherein the duration consumed by the first processing is smaller than the duration consumed by the second processing.
The second process may be a refinement process of the original image by the electronic device through the second thread. The electronic device performs first processing on the original image through the first thread, and the time consumed by the electronic device for performing second processing on the original image through the second thread is smaller than the time consumed by the electronic device for performing first processing on the original image through the second thread.
And 608, when the second processing is detected to be completed, replacing the first target image with the second target image obtained according to the second processing and storing the second target image.
The electronic device may detect a processing progress of the first process and the second process. When the electronic device detects that the second process is completed, the electronic device may obtain a second target image. The electronic device may store the second target image in place of the first target image. For example, the electronic device may store a first target image obtained by performing a first process on an original image by the first thread in the album, and when the electronic device detects that the second process is completed, the electronic device may store the obtained second target image in the album instead of the first target image, that is, the electronic device may delete the first target image from the album and store the second target image in the album.
In this embodiment, a first process is performed on an original image through a first thread to obtain a first target image, the first target image is stored, a second process is performed on the original image through a second thread, wherein the duration consumed by the first process is smaller than the duration consumed by the second process, and when the second process is detected to be completed, the second target image obtained according to the second process is stored in place of the first target image. The electronic device performs first processing on the original image through the first thread and performs second processing on the original image through the second thread, and as the two threads process the original image at the same time, the time consumed by the second processing is longer than that consumed by the first processing, the image obtained by the second processing is more accurate, the more accurate image is stored in the electronic device, and the accuracy of image processing is embodied. Because the second processing consumes longer time, the electronic device can store the first target image obtained by the first processing in the electronic device, when the electronic device acquires the original image and the user needs to immediately check the image, the electronic device can display the stored first target image to the user, and the waiting time when the user needs to immediately check the image is reduced.
In one embodiment, the image processing method provided may further include a process of displaying the thumbnail, and specifically includes: and compressing the first target image to generate a corresponding thumbnail, and displaying the thumbnail in an interface of the electronic equipment.
After the electronic device acquires the first target image, the electronic device may perform compression processing on the first target image and generate a corresponding thumbnail. The electronic device may display the generated thumbnail in an interface. Specifically, the position of the electronic device for displaying the thumbnail in the interface may be set by the user, or may be a default position of the electronic device.
In one embodiment, the image processing method provided may further include a process of performing a first process on the original image by the first thread and performing a second process on the original image by the second thread, and specifically includes: performing first processing on the original image according to a first light effect template through a first line Cheng Huoqu first light effect model to obtain a first target image; and acquiring a second light effect model through a second thread, and performing second processing on the original image according to the second light effect model.
The first light effect model and the second light effect model are models simulating light changes. For example, the first and second light effect models may be natural light effect models, contour light effect models, stage light effect models, background blurring models, and the like. The first light effect model is a natural light effect model, and the second light effect model is a natural light effect model, and the first light effect model is a natural light effect model, and the resource occupancy rate of the first light effect model is smaller than the resource occupancy rate of the second light effect model. The resource occupancy refers to the size of the resources occupied by the program at runtime, for example, the resource occupancy may be 40%, 43%, 65%, etc. The resource occupancy rate may be a CPU occupancy rate, a memory occupancy rate, a storage space occupancy rate, or the like, which is not limited herein.
The electronic device may perform a first process on the original image using the acquired first light effect model to obtain a first target image through the first line Cheng Huoqu first light effect model. The electronic device can acquire a second light effect model through the second thread, and the electronic device can use the second light effect model to perform first processing on the original image to obtain a second target image.
In this embodiment, the electronic device performs a first process on the original image according to the first light effect template through the first line Cheng Huoqu first light effect model to obtain a first target image; and acquiring a second light effect model through a second thread, and performing second processing on the original image according to the second light effect model, wherein the resource occupancy rate of the first light effect model is smaller than that of the second light effect model. The electronic device can process the images to different degrees by using different light effect models in different threads to process the images.
In one embodiment, an image processing method is provided, and specific steps for implementing the method are as follows:
(1) When the first thread receives the shooting instruction, a shooting mode corresponding to the shooting instruction is obtained.
(2) And when the shooting mode is a second shooting mode, performing second processing on the original image obtained through shooting through the first thread to obtain a second target image.
(3) When the shooting mode is the first shooting mode, whether a second thread in an idle state exists in the electronic equipment is detected.
(4) When a second thread in an idle state exists in the electronic equipment, performing first processing on the original image through the first thread to obtain a first target image; compressing the first target image to generate a corresponding thumbnail, and displaying the thumbnail in an interface of the electronic equipment; storing the first target image; sending the photographed original image to a second thread in an idle state through the first thread, acquiring a second light effect model through the second thread in the idle state, and performing second processing on the original image according to the second light effect model; when the completion of the second processing is detected, the second target image obtained according to the second processing is stored in place of the first target image.
(5) And when the second thread in the idle state does not exist in the electronic equipment, counting the number of threads of the second thread in the electronic equipment.
(6) When the number of threads is smaller than a number threshold value, performing first processing on the original image through a first thread to obtain a first target image; compressing the first target image to generate a corresponding thumbnail, and displaying the thumbnail in an interface of the electronic equipment; establishing a new second thread, sending the photographed original image to the new second thread through the first thread, acquiring a second light effect model through the new second thread, and performing second processing on the original image according to the second light effect model; when the completion of the second processing is detected, the second target image obtained according to the second processing is stored in place of the first target image.
(7) And when the number of threads is greater than or equal to the number threshold, performing second processing on the original image through the first line Cheng Huoqu and the second light effect model according to the second light effect model to obtain a second target image.
It should be understood that, although the steps in the respective flowcharts described above are sequentially shown as indicated by arrows, the steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the various flowcharts described above may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, and the order of execution of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with at least some of the other steps or sub-steps of other steps.
In one embodiment, as shown in fig. 7, there is provided an image processing apparatus 700 including: an image transmission module 710 and an image processing module 720, wherein:
The image sending module 710 is configured to send, when the first thread receives the shooting instruction, an original image obtained by shooting to the second thread through the first thread; the first thread is a thread allowing access to the interface control of the electronic device, and the second thread is a thread prohibiting access to the interface control of the electronic device.
The image processing module 720 is configured to perform a second process on the original image through a second thread, so as to obtain a second target image.
According to the image processing device provided by the embodiment of the invention, when the first thread receives the shooting instruction, the shooting original image is sent to the second thread through the first thread, wherein the first thread is a thread allowing access to the interface control of the electronic equipment, the second thread is a thread prohibiting access to the interface control of the electronic equipment, and the second thread performs second processing on the original image to obtain the second target image. The first thread sends the shot original image to the second thread, and the second thread carries out second processing, because the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment, the second processing of the image through the second thread can not be displayed in the interface of the electronic equipment, and when the second thread processes the image, a user can continue to carry out other operations on the electronic equipment, so that the operation efficiency of the electronic equipment is improved.
In one embodiment, the image sending module 702 is further configured to obtain, when the first thread receives the shooting instruction, a shooting mode corresponding to the shooting instruction; when the shooting mode is the first shooting mode, the original image obtained through shooting is sent to the second thread through the first thread.
In one embodiment, the image sending module 702 is further configured to detect whether a second thread in an idle state exists in the electronic device; when a second thread in an idle state exists in the electronic equipment, the first thread sends the photographed original image to the second thread in the idle state; when the second thread in the idle state does not exist in the electronic equipment, a new second thread is established, and the original image obtained through shooting is sent to the new second thread through the first thread.
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 the second thread in the idle state does not exist in the electronic device; when the number of threads is smaller than the number threshold, a new second thread is established, and the photographed original image is sent to the new second thread through the first thread.
In one embodiment, the image processing module 704 is further configured to perform, when the shooting mode is the second shooting mode, a second process on the original image obtained by shooting by the first thread, so as to obtain a second target image.
In one embodiment, the image processing module 704 is further configured to perform, when the number of threads is greater than or equal to the number threshold, a second process on the captured original image by the first thread to obtain a second target image.
In one embodiment, the image processing module 704 is further configured to perform a first process on the original image by using a first thread to obtain a first target image; storing the first target image; performing second processing on the original image through a second thread; wherein the duration consumed by the first process is less than the duration consumed by the second process; when the completion of the second processing is detected, the second target image obtained according to the second processing is stored in place of the first target image.
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 an interface of the electronic device.
In one embodiment, the image processing module 704 is further configured to perform a first process on the original image through the first line Cheng Huoqu and according to the first light effect model, to obtain a first target image; acquiring a second light effect model through a second thread, and performing second processing on the original image according to the second light effect model; the first light effect model and the second light effect model are models for simulating light change, and the resource occupancy rate of the first light effect model is smaller than that of the second light effect model.
The above-described division of the respective modules in the image processing apparatus is merely for illustration, and in other embodiments, the image processing apparatus may be divided into different modules as needed to accomplish all or part of the functions of the above-described image processing apparatus.
For specific limitations of the image processing apparatus, reference may be made to the above limitations of the image processing method, and no further description is given here. The respective modules in the above-described image processing apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
The implementation of each module in the image processing apparatus provided in the embodiments of the present application may be in the form of a computer program. The computer program may run on a terminal or a server. Program modules of the computer program may be stored in the memory of the terminal or server. Which when executed by a processor, performs the steps of the methods described in the embodiments of the present application.
In one embodiment, as shown in FIG. 8, a schematic diagram of the internal structure of an electronic device is provided. The electronic device includes a processor, a memory, a display, and a network interface connected by a system bus. Wherein the processor is configured to provide computing and control capabilities to support operation of the entire electronic device. The memory is used for storing data, programs, instruction codes and the like, and at least one computer program is stored on the memory and can be executed by the processor to realize the image processing method suitable for the electronic device provided in the embodiment of the application. The Memory may include a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random-Access Memory (RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. The nonvolatile storage medium stores an operating system, a database, and a computer program. The computer program is executable by a processor for implementing an image processing method provided by various embodiments of the present application. The internal memory provides a cached operating environment for the operating system, databases, and computer programs in the non-volatile storage medium. The display may be used to display an upload interface, etc. The network interface may be an ethernet card or a wireless network card, etc. for communicating with external electronic devices, such as may be used for communicating with a server or other electronic device.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the electronic device to which the present application is applied, and that a particular electronic device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
The embodiment of the application also provides electronic equipment. The electronic device includes image processing circuitry, which may be implemented using hardware and/or software components, and may include various processing units defining an ISP (Image Signal Processing ) pipeline. Fig. 9 is a schematic diagram of an image processing circuit in one embodiment. As shown in fig. 9, for convenience of explanation, only aspects of the image processing technology related to the embodiments of the present application are shown.
As shown in fig. 9, the image processing circuit includes an ISP processor 940 and a control logic 950. Image data captured by imaging device 910 is first processed by ISP processor 940, where ISP processor 940 analyzes the image data to capture image statistics that may be used to determine and/or one or more control parameters of 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 (e.g., bayer filters), and the image sensor 914 may obtain light intensity and wavelength information captured with each imaging pixel of the image sensor 914 and provide a set of raw image data that may be processed by the ISP processor 940. The sensor 920 (e.g., gyroscope) may provide parameters of the captured image processing (e.g., anti-shake parameters) to the ISP processor 940 based on the type of sensor 920 interface. 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.
In addition, the image sensor 914 may also send raw image data to the sensor 920, the sensor 920 may provide raw image data to the ISP processor 940 based on the type of interface of the sensor 920, or the sensor 920 may store raw image data in the image memory 930.
The ISP processor 940 processes the raw image data on a pixel-by-pixel basis in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and ISP processor 940 may perform one or more image processing operations on the raw image data, collecting statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision.
ISP processor 940 may also receive image data from image memory 930. For example, the sensor 920 interface sends the raw image data to the image memory 930, where the raw image data in the image memory 930 is provided to the ISP processor 940 for processing. 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.
Upon receiving raw image data from the image sensor 914 interface or from the sensor 920 interface or from 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 image memory 930 for additional processing before being displayed. ISP processor 940 receives the processed data from image memory 930 and processes the processed data for image data in the original domain and in the RGB and YCbCr color spaces. The image data processed by ISP processor 940 may be output to display 970 for viewing by a user and/or further processing by a graphics engine or GPU (Graphics Processing Unit, graphics processor). Further, the output of ISP processor 940 may also be sent to image memory 930, and display 970 may read image data from image memory 930. In one embodiment, the image memory 930 may be configured to implement one or more frame buffers. In addition, the output of ISP processor 940 may be sent to encoder/decoder 960 in order to encode/decode image data. The encoded image data may be saved and decompressed prior to display on the display 970 device. Encoder/decoder 960 may be implemented by a CPU or GPU or co-processor.
The statistics determined by ISP processor 940 may be sent to control logic 950 unit. For example, the statistics may include image sensor 914 statistics for auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 912 shading correction, and the like. Control logic 950 may include a processor and/or microcontroller that executes one or more routines (e.g., firmware) that determine control parameters of imaging device 910 and ISP processor 940 based on the received statistics. For example, control parameters of the imaging device 910 may include sensor 920 control parameters (e.g., gain, integration time for exposure control, anti-shake parameters, etc.), camera flash control parameters, lens 912 control parameters (e.g., focal length for focusing or zooming), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balancing and color adjustment (e.g., during RGB processing), as well as lens 912 shading correction parameters.
Embodiments of the present application also provide a computer-readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform steps of an image processing method.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform an image processing method.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts 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), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. An image processing method, comprising:
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; the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment;
and performing second processing on the original image through the second thread to obtain a second target image.
2. The method according to claim 1, wherein when the first thread receives the photographing instruction and there is a second thread in an idle state in the electronic device, sending, by the first thread, the photographed original image to the second thread in the idle state, includes:
when a first thread receives a shooting instruction, acquiring a shooting mode corresponding to the shooting instruction;
when the shooting mode is a first shooting mode and a second thread in an idle state exists in the electronic equipment, sending an original image obtained through shooting to the second thread in the idle state through the first thread;
The method further comprises the steps of:
and when the shooting mode is a second shooting mode, performing second processing on the shot original image through the first thread to obtain a second target image.
3. The method according to claim 1, wherein the method further comprises:
when the first thread receives a shooting instruction and a second thread in an idle state does not exist in the electronic equipment, a new second thread is established, and an original image obtained through shooting is sent to the new second thread through the first thread.
4. The method according to claim 3, wherein when the first thread receives the shooting command and there is no second thread in an idle state in the electronic device, establishing a new second thread, and sending the shot original image to the new second thread through the first thread, including:
when a first thread receives a shooting instruction and a second thread in an idle state does not exist in electronic equipment, counting the number of threads of the second thread in the electronic equipment;
when the number of threads is smaller than a number threshold, a new second thread is established, and the original image obtained through shooting is sent to the new second thread through the first thread;
The method further comprises the steps of:
and when the number of threads is greater than or equal to a number threshold, performing second processing on the photographed original image through the first thread to obtain a second target image.
5. The method according to any one of claims 1 to 4, wherein before the second processing, by the second thread, the original image is performed to obtain a second target image, further comprising:
performing first processing on the original image through the first thread to obtain a first target image;
storing the first target image;
and performing second processing on the original image through the second thread to obtain a second target image, wherein the second target image comprises:
performing second processing on the original image through the second thread; wherein the first processing consumes less time than the second processing consumes;
and when the second processing is detected to be completed, replacing the first target image with the second target image obtained according to the second processing and storing the second target image.
6. The method of claim 5, wherein after storing the first target image, further comprising:
And compressing the first target image to generate a corresponding thumbnail, and displaying the thumbnail in an interface of the electronic equipment.
7. The method of claim 5, wherein the performing, by the first thread, the first processing on the original image to obtain a first target image comprises:
a first light effect model is passed through the first line Cheng Huoqu, and the original image is subjected to first processing according to the first light effect model, so as to obtain a first target image;
the second processing, by the second thread, the original image includes:
acquiring a second light effect model through the second thread, and performing second processing on the original image according to the second light effect model; the first light effect model and the second light effect model are models for simulating light change, and the resource occupancy rate of the first light effect model is smaller than that of the second light effect model.
8. An image processing apparatus, comprising:
the image sending module is used for sending the original image obtained by shooting to the second thread in the idle state through the first thread when the first thread receives a shooting instruction and the second thread in the idle state exists in the electronic equipment; the first thread is a thread allowing access to the interface control of the electronic equipment, and the second thread is a thread prohibiting access to the interface control of the electronic equipment;
And the image processing module is used for carrying out second processing on the original image through the second thread to obtain a second target image.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the image processing method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the image processing method according to any one of claims 1 to 7.
CN202310251966.1A 2018-10-31 2018-10-31 Image processing method and device, electronic equipment and computer readable storage medium Pending CN116308992A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310251966.1A CN116308992A (en) 2018-10-31 2018-10-31 Image processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811291755.6A CN109523456B (en) 2018-10-31 2018-10-31 Image processing method and device, electronic equipment and computer readable storage medium
CN202310251966.1A CN116308992A (en) 2018-10-31 2018-10-31 Image processing method and device, electronic equipment and computer readable storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201811291755.6A Division CN109523456B (en) 2018-10-31 2018-10-31 Image processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116308992A true CN116308992A (en) 2023-06-23

Family

ID=65774079

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201811291755.6A Active CN109523456B (en) 2018-10-31 2018-10-31 Image processing method and device, electronic equipment and computer readable storage medium
CN202310251966.1A Pending CN116308992A (en) 2018-10-31 2018-10-31 Image processing method and device, electronic equipment and computer readable storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201811291755.6A Active CN109523456B (en) 2018-10-31 2018-10-31 Image processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (2) CN109523456B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110913127B (en) * 2019-11-09 2021-09-21 深圳市瑞沃德生命科技有限公司 Focus search method and system thereof
CN113127659B (en) * 2019-12-31 2024-09-27 深圳云天励飞技术有限公司 Image data input method and device, electronic equipment and storage medium
CN111399730A (en) * 2020-03-12 2020-07-10 北京字节跳动网络技术有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516423A (en) * 2015-12-24 2016-04-20 努比亚技术有限公司 Mobile terminal, data transmission system and mobile terminal shoot method
CN105915793A (en) * 2016-05-10 2016-08-31 北京奇虎科技有限公司 Intelligent watch shooting processing method and device
AU2017100879B4 (en) * 2016-07-29 2017-09-28 Apple Inc. Systems, devices, and methods for dynamically providing user interface controls at touch-sensitive secondary display
CN108156369B (en) * 2017-12-06 2020-03-13 Oppo广东移动通信有限公司 Image processing method and device

Also Published As

Publication number Publication date
CN109523456B (en) 2023-04-07
CN109523456A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
US11228720B2 (en) Method for imaging controlling, electronic device, and non-transitory computer-readable storage medium
KR102293443B1 (en) Image processing method and mobile terminal using dual camera
CN110225248B (en) Image acquisition method and device, electronic equipment and computer readable storage medium
CN109672819B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN109068058B (en) Shooting control method and device in super night scene mode and electronic equipment
CN106412214B (en) Terminal and terminal shooting method
CN107509044B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
CN112087580B (en) Image acquisition method and device, electronic equipment and computer readable storage medium
CN108198152B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN110636216B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN107481186B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107704798B (en) Image blurring method and device, computer readable storage medium and computer device
CN110475067B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN110213498B (en) Image generation method and device, electronic equipment and computer readable storage medium
CN110177212B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN110290320B (en) Video preview generation method and device, electronic equipment and computer-readable storage medium
CN110266966A (en) Image generating method and device, electronic equipment, computer readable storage medium
US20150195482A1 (en) Method, system and smartphone that chooses optimal image to reduce shutter shake
CN110049237B (en) Camera anti-shake method and device, electronic equipment and computer storage medium
CN108401110B (en) Image acquisition method and device, storage medium and electronic equipment
CN109523456B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN105812670B (en) A kind of method and terminal taken pictures
US11601600B2 (en) Control method and electronic device
CN107454322A (en) Photographic method, device, computer can storage medium and mobile terminals
CN109559352B (en) Camera calibration method, device, electronic equipment and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination