Image processing method and device, electronic equipment and storage medium
By obtaining images of different exposure time, using optical flow information and fuzzy core processing, combined with multi-camera and neural network technology, the blur problem of smartphones when shooting mobile objects is solved, and the clarity of the target object is improved.
Patent Information
- Application Number
- CN202411018419.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, smartphones are prone to problems such as unclear capture and smearing when shooting moving objects, and it is difficult to effectively improve the clarity of the image.
By acquiring images with different exposure time, the area of the target object in the short-exposure image is determined, and the optical flow information and blurred core processing is used to remove the blurred area of the target object in the long-exposure image, combining multi-camera shooting and neural network to adjust the global image parameters to improve image clarity.
The clarity of the target object is improved, especially the clarity of moving objects. Through image processing technology with multiple exposure time, the area of the target object in different exposed images is accurately determined and blurred, thereby improving image quality.
Smart Images

Figure CN120378753A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, electronic device, and storage medium. Background Art
[0002] With the development of smart phones, the clarity of camera shooting and the capture ability of cameras have become one of the important factors for users to choose and purchase smart phones. Currently, when a mobile phone takes pictures of moving objects, it often fails to capture the desired object, and the captured object often has problems such as blurring and trailing. Summary of the Invention
[0003] The present disclosure aims to solve at least one of the technical problems in the related art to some extent.
[0004] A first aspect embodiment of the present disclosure provides an image processing method, including:
[0005] Obtaining a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration, where the second exposure duration is greater than the first exposure duration;
[0006] Determining a first region of the target object in the first image;
[0007] Determining a second region of the target object in the second image according to the first region, the first image, and the second image;
[0008] Deblurring the second region in the second image to obtain a first target image.
[0009] A second aspect embodiment of the present disclosure provides an image processing apparatus, including:
[0010] An acquisition module, configured to obtain a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration, where the second exposure duration is greater than the first exposure duration;
[0011] A first determination module, configured to determine a first region of the target object in the first image;
[0012] A second determination module, configured to determine a second region of the target object in the second image according to the first region, the first image, and the second image;
[0013] A deblurring module, configured to deblur the second region in the second image to obtain a first target image.
[0014] A third aspect embodiment of the present disclosure provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the image processing method proposed in the first aspect embodiment of the present disclosure.
[0015] A fourth aspect embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements the image processing method proposed in the first aspect embodiment of the present disclosure.
[0016] The image processing method, device, electronic device, and storage medium provided by the present disclosure have the following beneficial effects:
[0017] In the embodiments of the present disclosure, first, a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration are obtained, where the second exposure duration is greater than the first exposure duration. Then, a first region of the target object in the first image is determined, and based on the first region, the first image, and the second image, a second region of the target object in the second image is determined; finally, the second region in the second image is deblurred to obtain a first target image. Thus, the characteristics that the main region where the target object is located in the short-exposure image is clearer and the background region is clearer as the exposure time increases can be utilized. Based on the first region of the target object in the first image, the second region of the target object in the second image can be accurately determined, and then the second region in the second image can be deblurred, thereby improving the clarity of the captured target object.
[0018] The additional aspects and advantages of the present disclosure will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and / or additional aspects and advantages of the present disclosure will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:
[0020] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of an image processing method provided by another embodiment of the present disclosure;
[0022] Figure 3 is a structural schematic diagram of an image processing device provided by another embodiment of the present disclosure;
[0023] Figure 4 shows a block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure. Detailed implementation manners
[0024] The embodiments of the present disclosure will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present disclosure, but should not be construed as limiting the present disclosure.
[0025] The image processing method, apparatus, electronic device, and storage medium according to the embodiments of the present disclosure will be described below with reference to the accompanying drawings.
[0026] Figure 1 It is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
[0027] In the embodiments of the present disclosure, it is exemplified that the image processing method is configured in an image processing apparatus, and the image processing apparatus can be applied to any electronic device so that the electronic device can perform image processing functions.
[0028] As Figure 1 shown, the image processing method may include the following steps:
[0029] Step 101, obtain a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration, where the second exposure duration is greater than the first exposure duration.
[0030] Among them, the target object may be a moving object, such as a running animal, a moving car, etc. The present disclosure does not make any limitations in this regard.
[0031] Among them, the first exposure duration may also be referred to as short exposure, such as a few milliseconds, etc. The second exposure duration may also be referred to as normal exposure, such as 1 second, 2 seconds, etc. The present disclosure does not make any limitations in this regard. The first image may also be referred to as a short exposure image, and the second image may also be referred to as a medium exposure image. The present disclosure does not make any limitations in this regard.
[0032] In some embodiments, the first image and the second image may be images captured by a single camera successively based on different exposure durations. For example, the camera first captures the target object based on the first exposure duration to obtain the first image, and then captures the target object based on the second exposure duration to obtain the second image.
[0033] In some embodiments, the first image and the second image may be images captured by two cameras simultaneously based on different exposure durations. For example, the first camera first captures the target object based on the first exposure duration to obtain the first image, and then the second camera captures the target object based on the second exposure duration to obtain the second image.
[0034] In some embodiments, the first image and the second image can be respectively acquired by two cameras in a device. Optionally, when the target device receives a shooting instruction, the first image corresponding to the target object captured by the first camera in the target device based on the first exposure duration and the second image corresponding to the target object captured by the second camera in the target device based on the second exposure duration are acquired. Thus, multiple cameras in the same device are used to simultaneously shoot the target object, and then the images captured by different cameras are processed, so as to reduce the latency of acquiring the first target image.
[0035] Among them, the target device can be a mobile phone, a computer, etc. The first camera can be the secondary camera of the mobile phone, and the second camera can be the main camera of the mobile phone. The present disclosure does not make any limitations in this regard.
[0036] In some embodiments, at least one of the operations of distortion correction, low-light enhancement, and noise reduction can be performed on the first image, so as to further improve the quality of the first image.
[0037] In some embodiments, distortion correction can also be performed on the second image, so as to reduce the distortion and deformation in the image, and further improve the quality of the second image.
[0038] Step 102, determine the first region of the target object in the first image.
[0039] In some embodiments, target detection can be performed on the first image to determine the position information of each object in the first image. According to the position information of each object, the area of each object in the first image is determined, and the object with the largest area is determined as the target object. And according to the position information of the target object in the first image, the first region of the target object in the first image is determined.
[0040] In some embodiments, the first region can be a rectangle.
[0041] In some embodiments, the moving object can be determined according to the previous frame image and the first image captured by the first camera; the moving object is determined as the target object.
[0042] Step 103, determine the second region of the target object in the second image according to the first region, the first image, and the second image.
[0043] In some embodiments, the optical flow information between the first image and the second image is determined, and then based on the optical flow information, the first region in the first image is distorted to obtain the second region of the target object in the second image.
[0044] Among them, the optical flow information can include the motion vectors of each pixel point between the first image and the second image, including the direction and speed of motion.
[0045] In some embodiments, the optical flow information between the first image and the second image can be determined based on the optical flow method. Among them, the optical flow method uses the changes of pixels in the first image and the second image in the time domain and the correlation between the first image and the second image to find the corresponding relationship existing between the first image and the second image, so as to calculate the optical flow information between the first image and the second image.
[0046] In some embodiments, the optical flow method may include a sparse optical flow algorithm and a dense optical flow algorithm. Among them, the sparse optical flow algorithm only calculates the motion of some feature points (such as corner points, edge points, etc.) in the first image and the second image, and the dense optical flow algorithm calculates the motion of all pixel points in the first image and the second image.
[0047] In some embodiments, interpolation can be performed on each pixel or sub-region in the first region based on the optical flow information to calculate their new positions that should appear in the second image, so as to obtain the second region of the target image in the second image.
[0048] In some embodiments, the first region can be divided into multiple grids (or triangles), and the shapes and positions of these grids can be moved and adjusted based on the optical flow information, so as to realize the distortion of the first region and obtain the second region of the target image in the second image.
[0049] Step 104, deblur the second region in the second image to obtain the first target image.
[0050] In some embodiments, the blur kernel corresponding to the second region can be obtained first, and then based on the blur kernel, the second region in the second image is deblurred to obtain the first target image.
[0051] In some embodiments, the image Hough transform can be used to process the second region in the second image to obtain the blur kernel.
[0052] In some embodiments, an edge detection algorithm can also be used to determine the blur kernel corresponding to the second region in the second image. Specifically, the edge information of the second region in the second image is extracted. Since blur will cause the edge to become wider and the intensity to decrease, the blur kernel can be estimated by analyzing the change of the edge information.
[0053] In some embodiments, the second image can be intercepted based on the second region to obtain a region image, the blur kernel corresponding to the region image is determined, and then based on the blur kernel, the second region in the second image is deblurred to obtain the first target image.
[0054] In some embodiments, a regional image may be input into a first neural network to obtain a blur kernel corresponding to the regional image. The first neural network is trained and generated using a large number of pairs of blurred and clear images as training data. Specifically, the neural network is trained to learn the mapping relationship between the blurred image and the clear image and estimate the blur kernel.
[0055] In the embodiments of the present disclosure, first, a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration are obtained, where the second exposure duration is greater than the first exposure duration. Then, a first region of the target object in the first image is determined, and based on the first region, the first image, and the second image, a second region of the target object in the second image is determined; finally, the second region in the second image is deblurred to obtain a first target image. Thus, the characteristics that the main region where the target object is located in the short-exposure image is clearer and the background region is clearer as the exposure time is longer can be utilized. Based on the first region of the target object in the first image, the second region of the target object in the second image can be accurately determined, and then the second region in the second image is deblurred, thereby improving the clarity of the captured target object.
[0056] Figure 2 As shown in Figure 2 the following is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
[0057] Step 201, obtain a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration, where the second exposure duration is greater than the first exposure duration.
[0058] Step 202, determine a first region of the target object in the first image.
[0059] Step 203, based on the first region, the first image, and the second image, determine a second region of the target object in the second image.
[0060] Step 204, deblur the second region in the second image to obtain a first target image.
[0061] Among them, the specific implementation forms of steps 201 to 204 may refer to the detailed descriptions in other embodiments of the present disclosure and will not be specifically elaborated here.
[0062] Step 205, obtain a third image corresponding to the target object captured based on a third exposure duration, where the third exposure duration is greater than the second exposure duration.
[0063] Among them, the third shooting duration can be 10 seconds, 5 seconds, 1 minute, etc. The third image can also be referred to as a long exposure image. The present disclosure does not limit this.
[0064] In some embodiments, three cameras in a device can be used to shoot a target object to obtain a first image, a second image, and a third image. For example, control the secondary camera of the mobile phone to shoot the target object based on the first shooting duration to obtain the second image; control the main camera of the mobile phone to shoot the target object based on the second shooting duration to obtain the second image; control the telephoto lens of the mobile phone to shoot the target object based on the third shooting duration to obtain the third image.
[0065] In some embodiments, when the target device receives a shooting instruction, obtain the first image corresponding to the target object shot by the first camera in the target device based on the first exposure duration, the second image corresponding to the target object shot by the second camera in the target device based on the second exposure duration, and the third image corresponding to the target object shot by the third camera in the target device based on the third exposure duration. Thus, multiple cameras in the same device are used to shoot the target object simultaneously, and then the images shot by different cameras are processed, so as to reduce the latency of obtaining the first target image.
[0066] In some embodiments, the third image can also be subjected to distortion correction, so as to reduce the distortion and deformation in the image, and then improve the quality of the third image.
[0067] Step 206, determine the global image parameters based on the second image and the third image.
[0068] In some embodiments, the global parameters may include at least one of the following: brightness, contrast, and saturation.
[0069] In some embodiments, the second image and the third image can be input into a target neural network to obtain the global image parameters.
[0070] Among them, the target neural network is generated by training according to a sample data set, and the sample data set includes a first sample image corresponding to a sample object shot based on the second exposure duration, a second sample image corresponding to the sample object shot based on the third exposure duration, and a global parameter label corresponding to the image after global parameter adjustment of the first sample image.
[0071] Among them, the global label parameter is the global parameter corresponding to the image with better quality obtained after artificially adjusting the global parameters of the first sample image, that is, the globally adjusted parameter is the global parameter label
[0072] Specifically, input the first sample image and the second sample image into the initial neural network to obtain the preset global parameters. Based on the difference between the predicted global parameters and the global parameter labels, determine the loss function, and based on the loss function, correct the initial neural network to obtain the target neural network.
[0073] In some embodiments, the initial neural network may be a deep convolutional neural network model (Visual Geometry Group 16, VGG16). The present disclosure does not limit the architecture of the initial neural network.
[0074] It should be noted that since the third image is taken based on the third exposure duration, the longer the exposure time, the richer the details of other background regions outside the moving object in the image. Therefore, the second sample image corresponding to the third exposure duration can be added during training, so that the neural network can learn the detail features of the background region in the second sample image and assist in predicting the global parameters. Thus, when the target neural network is applied, the detail information of the background region in the third image can be referred to obtain more accurate image global parameters and improve the quality of the obtained second target image.
[0075] It should be noted that the specific processes of steps 205 - 206 may be executed before steps 202 - 204, may be executed after them, or may be executed simultaneously. Steps 201 and 205 may also be executed simultaneously. The present disclosure does not limit this.
[0076] Step 207, process the first target image based on the image global parameters to obtain the second target image.
[0077] Specifically, based on the image global parameters, adjust the first target image so that the global parameters of the adjusted first target image are the image global parameters.
[0078] For example, if the contrast in the image global parameters is 50 and the brightness is 60, then adjust the contrast of the first target image to 50 and the brightness to 60 to obtain the second target image.
[0079] In an embodiment of the present disclosure, a first image corresponding to a target object captured based on a first exposure duration, a second image corresponding to the target object captured based on a second exposure duration, and a third image corresponding to the target object captured based on a third exposure duration are obtained, where the second exposure duration is greater than the first exposure duration, and the third exposure duration is greater than the second exposure duration; then a first region of the target object in the first image is determined, a second region of the target object in the second image is determined according to the first region, the first image, and the second image, and the second region in the second image is deblurred to obtain a first target image. Furthermore, image global parameters are determined based on the second image and the third image, and finally, the first target image is processed based on the image global parameters to obtain a second target image. Thus, after deblurring the second region of the target object in the second image, the image global parameters can be obtained by combining the second image and the third image, and the first target image can be adjusted, thereby further improving the quality of the first target image and making the captured moving target object clearer.
[0080] To implement the above embodiment, the present disclosure also proposes an image processing device.
[0081] Figure 3 It is a schematic structural diagram of the image processing device provided in the embodiment of the present disclosure.
[0082] As Figure 3 shown, the image processing device 300 may include:
[0083] An acquisition module 301, configured to acquire a first image corresponding to a target object captured based on a first exposure duration, and a second image corresponding to the target object captured based on a second exposure duration, where the second exposure duration is greater than the first exposure duration;
[0084] A first determination module 302, configured to determine a first region of the target object in the first image;
[0085] A second determination module 303, configured to determine a second region of the target object in the second image according to the first region, the first image, and the second image;
[0086] A deblurring module 304, configured to deblur the second region in the second image to obtain a first target image.
[0087] In some embodiments, it further includes a first processing module, configured to:
[0088] Acquire a third image corresponding to the target object captured based on a third exposure duration, where the third exposure duration is greater than the second exposure duration;
[0089] Determine image global parameters based on the second image and the third image;
[0090] Process the first target image based on the global parameters of the image to obtain a second target image.
[0091] In some embodiments, a first processing module is configured to:
[0092] Input a second image and a third image into a target neural network to obtain global parameters of the image;
[0093] Wherein, the target neural network is generated by training according to a sample data set, and the sample data set includes a first sample image corresponding to a sample object captured based on a second exposure duration, a second sample image corresponding to the sample object captured based on a third exposure duration, and a global parameter label corresponding to an image obtained by adjusting the global parameters of the first sample image.
[0094] In some embodiments, a first processing module is configured to:
[0095] The global parameters include at least one of the following:
[0096] Brightness, contrast, saturation.
[0097] In some embodiments, an acquisition module 301 is configured to:
[0098] When the target device receives a shooting instruction, obtain a first image corresponding to a target object captured by a first camera in the target device based on a first exposure duration, a second image corresponding to the target object captured by a second camera in the target device based on a second exposure duration, and a third image corresponding to the target object captured by a third camera in the target device based on a third exposure duration.
[0099] In some embodiments, a second determination module 303 is configured to:
[0100] Determine the optical flow information between the first image and the second image;
[0101] Based on the optical flow information, distort a first region in the first image to obtain a second region of the target object in the second image.
[0102] In some embodiments, a deblurring module is configured to:
[0103] Based on the second region, intercept the second image to obtain a region image;
[0104] Determine the blur kernel corresponding to the region image;
[0105] Based on the blur kernel, deblur the second region in the second image to obtain a first target image.
[0106] In some embodiments, it further includes a second processing module, configured to:
[0107] Perform at least one operation of distortion correction, low-light enhancement, and noise reduction on the first image.
[0108] In some embodiments, the acquisition module 301 is configured to:
[0109] When the target device receives a shooting instruction, obtain a first image corresponding to a target object captured by a first camera in the target device based on a first exposure duration, and a second image corresponding to the target object captured by a second camera in the target device based on a second exposure duration.
[0110] For the functions and specific implementation principles of the above-mentioned modules in the embodiments of the present disclosure, reference may be made to the above-mentioned method embodiments, and details are not described herein again.
[0111] The image processing device according to the embodiments of the present disclosure first obtains a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration, where the second exposure duration is greater than the first exposure duration. Then, it determines a first area of the target object in the first image, and determines a second area of the target object in the second image according to the first area, the first image, and the second image. Finally, it deblurs the second area in the second image to obtain a first target image. Thus, the characteristics that the main area where the target object is located in the short-exposure image is clearer and the background area is clearer as the exposure time is longer can be utilized. Based on the first area of the target object in the first image, the second area of the target object in the second image can be accurately determined, and then the second area in the second image can be deblurred, thereby improving the clarity of the captured target object.
[0112] To implement the above embodiments, the present disclosure also provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the image processing method as proposed in the foregoing embodiments of the present disclosure.
[0113] To implement the above embodiments, the present disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the image processing method as proposed in the foregoing embodiments of the present disclosure.
[0114] Figure 4 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure is shown. Figure 4 The illustrated electronic device 12 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0115] As Figure 4As shown, the electronic device 12 is presented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects different system components (including the system memory 28 and the processing unit 16).
[0116] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnection (PCI) bus.
[0117] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0118] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 34 can be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 4 not shown, commonly referred to as a "hard disk drive"). Although Figure 4Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (such as: Compact Disc Read Only Memory; hereinafter referred to as: CD-ROM), Digital Video Disc Read Only Memory; hereinafter referred to as: DVD-ROM) or other optical media) can be provided. In these cases, each drive can be connected to the bus 18 through one or more data medium interfaces. The memory 28 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.
[0119] A program / utility 40 having a set (at least one) of program modules 42 can be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 42 generally execute the functions and / or methods in the embodiments described in the present disclosure.
[0120] The electronic device 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 22. In addition, the electronic device 12 can also communicate with one or more networks (such as a Local Area Network; hereinafter referred to as: LAN), a Wide Area Network; hereinafter referred to as: WAN) and / or a public network, such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the electronic device 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0121] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the methods mentioned in the foregoing embodiments.
[0122] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0123] In addition, the terms "first" and "second" are used only for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description of the present disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0124] Any process or method description shown in a flowchart or described in other ways herein can be understood as representing a module, segment, or portion of code including one or more executable instructions for implementing a customized logic function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations, where the functions can be executed in a substantially simultaneous manner or in a reverse order according to the functions involved, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present disclosure pertain.
[0125] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber devices, and portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.
[0126] It should be understood that various parts of the present disclosure can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits with suitable combinational logic gate circuits, programmable gate arrays (PGA), field-programmable gate arrays (FPGA), etc.
[0127] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0128] In addition, each functional unit in various embodiments of the present disclosure may be integrated into one processing module, or each unit may exist physically alone, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0129] The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disc, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those of ordinary skill in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.
Claims
1. An image processing method, characterized in that, The method includes: Obtaining a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration, where the second exposure duration is greater than the first exposure duration; Determining a first region of the target object in the first image; Determining a second region of the target object in the second image according to the first region, the first image, and the second image; Deblurring the second region in the second image to obtain a first target image.
2. The method according to claim 1, wherein The method further includes: Obtaining a third image corresponding to the target object captured based on a third exposure duration, where the third exposure duration is greater than the second exposure duration; Determining image global parameters based on the second image and the third image; Processing the first target image based on the image global parameters to obtain a second target image.
3. The method according to claim 2, wherein The determining the image global parameters based on the second image and the third image includes: Inputting the second image and the third image into a target neural network to obtain the image global parameters; Wherein, the target neural network is generated by training according to a sample data set, and the sample data set includes a first sample image corresponding to a sample object captured based on the second exposure duration, a second sample image corresponding to the sample object captured based on the third exposure duration, and a global parameter label corresponding to an image obtained by globally adjusting the first sample image.
4. The method according to claim 2 or 3, characterized in that, The global parameters include at least one of the following: Brightness, contrast, saturation.
5. The method according to claim 2, wherein The method includes: When the target device receives a shooting instruction, obtaining the first image corresponding to the target object captured by the first camera in the target device based on the first exposure duration, the second image corresponding to the target object captured by the second camera in the target device based on the second exposure duration, and the third image corresponding to the target object captured by the third camera in the target device based on the third exposure duration.
6. The method according to claim 1, wherein The determining the second region of the target object in the second image according to the first region, the first image, and the second image includes: Determining the optical flow information between the first image and the second image; Distorting the first region in the first image based on the optical flow information to obtain the second region of the target object in the second image.
7. The method according to claim 6, wherein The deblurring the second region in the second image to obtain a first target image includes: Cropping the second image based on the second region to obtain a region image; Determining the blur kernel corresponding to the region image; Deblurring the second region in the second image based on the blur kernel to obtain a first target image.
8. The method according to claim 1, characterized in that, Before determining the first region of the target object in the first image, it further includes: Performing at least one operation of distortion correction, low-light enhancement, and noise reduction on the first image.
9. The method according to claim 1, wherein The obtaining of the first image corresponding to the target object captured based on the first exposure duration and the second image corresponding to the target object captured based on the second exposure duration includes: When the target device receives a shooting instruction, obtaining the first image corresponding to the target object captured by the first camera in the target device based on the first exposure duration, and the second image corresponding to the target object captured by the second camera in the target device based on the second exposure duration.
10. An image processing apparatus, characterized in that, The device includes: An obtaining module, configured to obtain a first image corresponding to a target object captured based on a first exposure duration and a second image corresponding to the target object captured based on a second exposure duration, where the second exposure duration is greater than the first exposure duration; A first determination module, configured to determine a first area of the target object in the first image; A second determination module, configured to determine a second area of the target object in the second image according to the first area, the first image, and the second image; A deblurring module, configured to deblur the second area in the second image to obtain a first target image.
11. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the image processing method according to any one of claims 1-9.
12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the image processing method according to any one of claims 1-9.