Data processing method and device, electronic equipment and readable storage medium

Through the pre-trained focus model processing real-time image data, the focus oscillation and collision problems in hardware-driven focus mode are solved, and more efficient and stable software-driven focus technology is achieved, reducing hardware cost and structural complexity.

CN119155547APending Publication Date: 2024-12-17VIVO MOBILE COMM CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411193560.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the existing automatic focus technology, the hardware driving method leads to problems such as focus oscillation and collision, resulting in poor focus effect and slow speed, increasing hardware cost and structural complexity.

Method used

Using a pre-trained focus model, the target diffraction distance is determined by acquiring real-time image data and performing focus processing, software-driven focus operation is realized, hardware dependence is reduced, and focus oscillation and collision are avoided.

Benefits of technology

Improves focus effect and stability, reduces hardware cost and structural complexity, and achieves a faster and more accurate focus process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155547A_ABST
    Figure CN119155547A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, electronic equipment and a readable storage medium. The method comprises the following steps: acquiring real-time image data acquired by an image acquisition assembly; the real-time image data is unfocused image data; based on a pre-trained focusing model, determining a target diffraction distance corresponding to the real-time image data, and based on the target diffraction distance, performing focusing processing operation on the real-time image data to obtain target image data; the target image data is focusing image data corresponding to the real-time image data; and performing image display based on the target image data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of focusing technology, and in particular to a data processing method, device, electronic equipment and readable storage medium. Background Art

[0002] With the rapid development of science and technology, camera focus technology has also undergone a significant evolution from its initial form to highly intelligent. There are two main types of autofocus technology. The first type is active autofocus, mainly TOF autofocus (Time of Flight AF), which uses the body to emit infrared, ultrasonic or laser to the subject, and then receives the reflected echo to measure the distance, and finally drives the motor to focus; the second type is passive autofocus, mainly including phase detection autofocus (Phase Detection AF) and contrast autofocus (Contrast AF). Phase detection autofocus is mainly based on projecting the light entering the lens onto the phase detection sensor, which compares the received light and finally drives the motor to focus.

[0003] However, the above two autofocus methods often require a driving motor to achieve focusing. The existence of the motor not only increases the hardware structure and increases the cost, but the hardware-driven focusing method also brings problems such as focus oscillation or edge collision, resulting in poor focusing effect and slow focusing speed. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present invention provides a data processing method, device, electronic device and readable storage medium.

[0005] In a first aspect, the present invention provides a data processing method, the method comprising:

[0006] Acquire real-time image data collected by the image collection component; the real-time image data is unfocused image data;

[0007] Based on a pre-trained focus model, a target diffraction distance corresponding to the real-time image data is determined, and based on the target diffraction distance, a focus processing operation is performed on the real-time image data to obtain target image data; the target image data is in-focus image data corresponding to the real-time image data;

[0008] An image is displayed based on the target image data.

[0009] Optionally, before determining a target diffraction distance corresponding to the real-time image data based on a pre-trained focus model, and performing a focus processing operation on the real-time image data based on the target diffraction distance to obtain the target image data, the method further includes:

[0010] Performing a target image processing operation on the real-time image data;

[0011] The method of determining a target diffraction distance corresponding to the real-time image data based on a pre-trained focus model, and performing a focus processing operation on the real-time image data based on the target diffraction distance to obtain target image data includes:

[0012] Using the real-time image data after the target image processing operation as the first image to be processed;

[0013] Based on a pre-trained focus model, a target diffraction distance corresponding to the first image to be processed is determined, and based on the target diffraction distance, a focus processing operation is performed on the first image to be processed to obtain target image data.

[0014] Optionally, after determining a target diffraction distance corresponding to the real-time image data based on a pre-trained focus model, and performing a focus processing operation on the real-time image data based on the target diffraction distance to obtain the target image data, the method further includes:

[0015] performing a target image processing operation on the target image data;

[0016] The performing image display based on the target image data comprises:

[0017] Image display is performed based on the target image data after the target image processing operation.

[0018] Optionally, the target image processing operation includes a format conversion operation, and the image format of the first image to be processed is a YUV format;

[0019] After determining the target diffraction distance corresponding to the real-time image data based on the pre-trained focus model, and performing a focus processing operation on the real-time image data based on the target diffraction distance to obtain the target image data, the method further includes:

[0020] performing a first image processing operation on the target image data; the first image processing operation and the target image processing operation have different processing contents;

[0021] The performing image display based on the target image data comprises:

[0022] Image display is performed based on the target image data after the first image processing operation.

[0023] Optionally, the focus model is trained based on the following method:

[0024] Acquire multiple groups of target image groups; any of the target image groups includes multiple in-focus images and multiple out-of-focus images corresponding to each of the multiple in-focus images, and the diffraction distances of the multiple out-of-focus images in any of the target image groups are the same;

[0025] For any target image group, multiple out-of-focus images in the target image group are input into a focus model to be trained, and multiple predicted images output by the focus model to be trained are obtained;

[0026] Based on the multiple predicted images and the multiple in-focus images in the target image group, adjusting parameters of the focus model to be trained;

[0027] When the focus model to be trained meets a preset condition, the focus model to be trained is determined as the target focus model.

[0028] Optionally, acquiring multiple groups of target image groups includes:

[0029] Acquire multiple in-focus images in advance and preset multiple different diffraction distances;

[0030] Performing Fourier transformation on each of the in-focus images to obtain a first spectrum diagram;

[0031] For any diffraction distance among the multiple diffraction distances, based on a preset wave vector, a preset imaginary number, the diffraction distance and the first frequency spectrum, determining a second frequency spectrum corresponding to each of the in-focus images;

[0032] The second frequency spectrum corresponding to each of the in-focus images is Fourier transformed to obtain a defocused image corresponding to each of the in-focus images.

[0033] In a second aspect, the present invention provides a data processing device, the device comprising:

[0034] A first acquisition module is used to acquire real-time image data acquired by the image acquisition component; the real-time image data is unfocused image data;

[0035] A first processing module, configured to determine a target diffraction distance corresponding to the real-time image data based on a pre-trained focus model, and perform a focus processing operation on the real-time image data based on the target diffraction distance to obtain target image data; the target image data is in-focus image data corresponding to the real-time image data;

[0036] The first display module is used to display an image based on the target image data.

[0037] Optionally, the device may further include:

[0038] A second processing module, used for performing a target image processing operation on the real-time image data;

[0039] The first processing module comprises:

[0040] A first determining module, configured to use the real-time image data after the target image processing operation as a first image to be processed;

[0041] The first focusing module is used to determine the target diffraction distance corresponding to the first image to be processed based on a pre-trained focusing model, and perform a focusing processing operation on the first image to be processed based on the target diffraction distance to obtain target image data.

[0042] Optionally, the device may further include:

[0043] The third processing module is used to perform target image processing operations on the target focused image.

[0044] The first display module comprises:

[0045] The first display submodule is used to display an image based on the target image data after the target image processing operation.

[0046] Optionally, the device may further specifically include: the target image processing operation includes a format conversion operation, and the image format of the first image to be processed is a YUV format;

[0047] The device may further include:

[0048] a fourth processing module, configured to perform a first image processing operation on the target image data; the first image processing operation and the target image processing operation have different processing contents;

[0049] The first display module comprises:

[0050] The second display module is used to display an image based on the target image data after the first image processing operation.

[0051] Optionally, the device may further include:

[0052] A second acquisition module is used to acquire multiple groups of target image groups; any of the target image groups includes multiple in-focus images and multiple out-of-focus images corresponding to the multiple in-focus images, and the diffraction distances of the multiple out-of-focus images in any of the target image groups are the same;

[0053] A third acquisition module is used for inputting a plurality of out-of-focus images in any target image group into a focus model to be trained, and acquiring a plurality of predicted images output by the focus model to be trained;

[0054] A first adjustment module, configured to adjust parameters of the focus model to be trained based on the multiple predicted images and the multiple in-focus images in the target image group;

[0055] The third determination module is used to determine the focus model to be trained as the target focus model when the focus model to be trained meets a preset condition.

[0056] Optionally, the second acquisition module includes:

[0057] A first acquisition submodule, used for pre-acquiring a plurality of in-focus images and presetting a plurality of different diffraction distances;

[0058] A first transformation module, used for performing Fourier transformation on each of the in-focus images to obtain a first spectrum diagram;

[0059] a fourth determination module, configured to determine, for any diffraction distance among the plurality of diffraction distances, a second frequency spectrum corresponding to each of the in-focus images based on a preset wave vector, a preset imaginary number, the diffraction distance, and the first frequency spectrum;

[0060] The second transformation module is used to perform Fourier transformation on the second spectrum graph corresponding to each of the in-focus images to obtain a defocused image corresponding to each of the in-focus images.

[0061] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0062] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0063] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0064] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0065] In an embodiment of the present invention, real-time image data collected by an image acquisition component is obtained; the real-time image data is unfocused image data; based on a pre-trained focus model, a target diffraction distance corresponding to the real-time image data is determined, and based on the target diffraction distance, a focus processing operation is performed on the real-time image data to obtain target image data; the target image data is quasi-focus image data corresponding to the real-time image data; and an image is displayed based on the target image data. In this way, by performing focus processing on the real-time image data, image focus can be achieved in a software-driven manner. Compared with achieving image focus in a hardware-driven manner, the setting space of the hardware in the device is reduced, the device structure is reduced, and the hardware cost is reduced. At the same time, there is no need for hardware to drive the lens to adjust the focal length, thereby avoiding the problem of repeated defocusing due to focus oscillation or motor collision. By performing focus processing on the real-time image data through a pre-trained focus model, the focus processing effect of the real-time image data can be achieved, and the focus effect and image focus stability are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0067] Figure 1 is a flow chart of steps of a data processing method provided by an embodiment of the present invention;

[0068] Figure 2 is a schematic diagram of an image processing architecture provided by an embodiment of the present invention;

[0069] Figure 3 is a schematic diagram of an image change process provided by an embodiment of the present invention;

[0070] Figure 4 is a schematic diagram of another image processing architecture provided by an embodiment of the present invention;

[0071] Figure 5 is a schematic diagram of another image change process provided by an embodiment of the present invention;

[0072] Figure 6 is a schematic diagram of another image processing architecture provided by an embodiment of the present invention;

[0073] Figure 7 is a schematic diagram of another image change process provided by an embodiment of the present invention;

[0074] Figure 8is a schematic diagram of a method for acquiring an out-of-focus image provided by an embodiment of the present invention;

[0075] Fig. 9 is a structural diagram of a data processing device provided by an embodiment of the present invention;

[0076] Fig.10 is a block diagram of an electronic device provided in an embodiment of the present application;

[0077] Fig.11 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0079] Figure 1 1 is a flowchart of a data processing method provided by an embodiment of the present invention, which is applied to electronic devices provided with image acquisition components, such as mobile communication devices, cameras, etc. Figure 1 As shown, the method may include:

[0080] Step 101: Acquire real-time image data acquired by an image acquisition component; the real-time image data is unfocused image data.

[0081] In an embodiment of the present invention, real-time image data collected by an image acquisition component is obtained. Among them, real-time image data is image data (realtime data) obtained by the image acquisition component in real-time viewing, and real-time image data is unfocused image data collected by the image acquisition component. The format of real-time image data can be image data in RAW format, such as uncompressed raw data (raw image file) directly output from the camera mipi standard port. Exemplarily, when light enters the image acquisition component through a lens, it is first captured by an image sensor. Each pixel on the sensor corresponds to a photosensitive element, and these photosensitive elements convert light signals into electrical signals. The electrical signal captured by the sensor is converted into a digital signal by an analog-to-digital converter (ADC) to obtain RAW data, that is, real-time image data.

[0082] Step 102: determine the target diffraction distance corresponding to the real-time image data based on a pre-trained focus model, and perform a focus processing operation on the real-time image data based on the target diffraction distance to obtain target image data; the target image data is the in-focus image data corresponding to the real-time image data.

[0083] In an embodiment of the present invention, after acquiring real-time image data, an image processor (graphics processing unit, GPU) or a data processor (data processing unit, DPU) calls a focus model pre-trained and stored in the image processor or the data processor to perform a focus processing operation on the real-time image data. Wherein, the diffraction of the physical world is from clear to blurred, and the image is reversely reconstructed by the focus model, that is, the image reconstruction from blurred to clear is realized by the focus model. Based on the pre-trained focus model, the target diffraction distance corresponding to the real-time image data is determined, and the target diffraction distance is the distance from the image focus to the non-focus corresponding to the real-time image data. After determining the target diffraction distance, based on the target diffraction distance, the real-time image data is subjected to a focus processing operation to obtain the target image data. Wherein, the target image data is a focused image corresponding to the real-time image data. Exemplarily, the real-time image data can be used as the input of the model, and the recognition layer in the model can identify the target diffraction distance based on the image features of the real-time image data, adjust the clarity of the image data based on the target diffraction distance, and finally output the target image data with the focus completed.

[0084] Furthermore, a target image processing operation may be performed on the real-time image data, and the target image processing operation may be an image signal processing operation, that is, image signal processing (ISP) is performed on the real-time image data. The target image processing operation may include multiple image processing links, such as dark current deduction, lens shading correction, basic raw domain noise reduction, white balance correction spatial / temporal domain noise reduction, sharpening, dynamic range adjustment, color restoration, etc. One or more image processing links may be selected for the real-time image data to implement the target image processing operation. The target image processing operation is used to improve image quality and enhance the display authenticity of the image.

[0085] In this way, the target image data can be obtained after the focus processing operation and the target image processing operation are performed on the real-time image data. The processing order of the focus processing operation and the target image processing operation can be set according to the needs. For example, the focus processing operation can be performed on the real-time image data first and then the target image processing operation can be performed, or the target image processing operation can be performed on the real-time image data first and then the focus processing operation can be performed. There is no specific limitation.

[0086] Step 103: Display an image based on the target image data.

[0087] In an embodiment of the present invention, after obtaining the target image data, the target image data can be displayed on a display screen to achieve an automatic focusing effect on the image data collected in real time by the image acquisition component. Exemplarily, the target image data can be displayed on a display screen of a camera.

[0088] In summary, in an embodiment of the present invention, real-time image data collected by an image acquisition component is obtained; the real-time image data is unfocused image data; based on a pre-trained focus model, the target diffraction distance corresponding to the real-time image data is determined, and based on the target diffraction distance, a focus processing operation is performed on the real-time image data to obtain target image data; the target image data is quasi-focus image data corresponding to the real-time image data; and an image is displayed based on the target image data. In this way, by performing focus processing on the real-time image data, image focus can be achieved in a software-driven manner. Compared with achieving image focus in a hardware-driven manner, the setting space of the hardware in the device is reduced, the device structure is reduced, and the hardware cost is reduced. At the same time, there is no need for hardware to drive the lens to adjust the focal length, thereby avoiding the problem of repeated defocusing due to focus oscillation or motor collision. By performing focus processing on the real-time image data through a pre-trained focus model, the focus processing effect of the real-time image data can be achieved, and the focus effect and image focus stability are improved.

[0089] Furthermore, for the fixed focus module, the fixed focus module relies on a large depth of field to achieve clear focus at a long distance. Compared with the hardware-driven focusing method, which will bring about a significant attenuation of clarity within the depth of field, resulting in poor image clarity, the data processing method provided in the embodiment of the present invention can achieve the focusing effect of the image in the fixed focus module in a software-driven focusing method, and can increase the image depth of field and improve the clarity of the film.

[0090] Optionally, before step 102, the embodiment of the present invention may include the following steps:

[0091] Step 201: Perform target image processing operations on the real-time image data.

[0092] In an embodiment of the present invention, the target image processing operation can be completed on the image to obtain an image that is normal to the human eye, and then the image is input into the focusing model, and the focusing model performs reverse image reconstruction to improve its clarity and obtain target image data.

[0093] Performing a target image processing operation on the real-time image data to obtain a first image to be processed, wherein the target image processing operation may include image processing steps such as dark current deduction, lens shading correction, basic raw domain noise reduction, white balance correction, spatial / temporal domain noise reduction, sharpening, dynamic range adjustment, and color restoration.

[0094] Accordingly, step 102 may include:

[0095] Step 202: Use the real-time image data after the target image processing operation as the first image to be processed.

[0096] Step 203: determine the target diffraction distance corresponding to the first image to be processed based on the pre-trained focus model, and perform a focus processing operation on the first image to be processed based on the target diffraction distance to obtain target image data.

[0097] In an embodiment of the present invention, the real-time image data after the target image processing operation is used as the first image to be processed. Based on the pre-trained focus model, the target diffraction distance corresponding to the first image to be processed after image processing is determined, and the focus processing operation is performed on the first image to be processed based on the target diffraction distance to obtain the target image data. Specifically, the first image to be processed can be input into the focus model to obtain the output image of the focus model as the target image data. Then, the display can be directly based on the target image data.

[0098] For example, Figure 2 As shown, the real-time image data is first processed as a target image, and then the focus model is used to perform focus processing. Figure 3 As shown, based on Figure 2 The image change process of the architecture for image focus processing is to obtain real-time image data in RAW format, perform target image processing (ISP), and then perform focus processing (OD) through the focus model to obtain target image data.

[0099] In an embodiment of the present invention, by first performing target image processing on real-time image data, the noise of the image can be removed first, and the image quality is improved, so that when the focusing model processes the first image to be processed, the image scene recognized by the model is more accurate, thereby improving the focusing effect.

[0100] Optionally, after step 102, the embodiment of the present invention may include the following steps:

[0101] Step 301: Perform a target image processing operation on the target image data.

[0102] In the embodiment of the present invention, the underlying real-time image data may be firstly subjected to image reverse reconstruction, and then the reversely reconstructed image may be subjected to target image processing to obtain target image data that meets the perception of the human eye.

[0103] The target image data is subjected to target image processing operations, wherein the target image processing operations may include dark current deduction, lens shading correction, basic RAW domain noise reduction, white balance correction, spatial / temporal domain noise reduction, sharpening, dynamic range adjustment, and color restoration.

[0104] Accordingly, step 103 may include the following steps:

[0105] Step 302: Display an image based on the target image data after the target image processing operation.

[0106] In the embodiment of the present invention, the target image data after the target image processing operation is displayed as an image.

[0107] For example, Figure 4 As shown, the real-time image data is first processed by the focus model for focus processing, and then the target image processing is performed. Figure 5 As shown, based on Figure 4 The image change process of the architecture for image focus processing is to obtain real-time image data in RAW format, perform focus processing (OD) through the focus model to obtain target image data, and then perform target image processing (ISP) on the target image data for display.

[0108] In an embodiment of the present invention, by first using a focus model to reversely reconstruct real-time image data, the detail information of the original image can be effectively retained, and then the first image to be processed is subjected to target image processing, thereby improving the image focusing effect and the clarity of the target image data.

[0109] Optionally, in an embodiment of the present invention, the image processing operation can be divided into a target image processing operation and a first image processing operation. The processing contents in the first image processing operation and the target image processing operation are different, that is, the image processing links included in the first image processing operation and the target image processing operation are different. The first image processing operation and the target image processing operation are respectively set at different processing orders in the entire processing process, that is, an image processing operation is performed before the focus model performs the focus processing, and an image processing operation is performed after the focus model performs the focus processing.

[0110] Optionally, step 201 may include the following steps:

[0111] Step 401: Perform a target image processing operation on the real-time camera data; the target image processing operation includes a format conversion operation.

[0112] In an embodiment of the present invention, a target image processing operation is performed on the real-time image data. The target image processing operation may include basic image processing steps, such as black level correction, shadow correction, basic raw domain noise reduction, etc. The target image processing operation is used to process the real-time image data into an image that conforms to the human eye's senses. Furthermore, in order to improve the image focusing speed, the target image processing operation may include a format conversion operation, wherein the format conversion operation is used to convert an image in RAW format into an image in YUV format. In this way, after the target image processing operation is performed on the real-time image data, image data in YUV format is obtained.

[0113] Accordingly, step 202 may include the following steps:

[0114] Step 402: Use the real-time image data after the target image processing operation as a first image to be processed; the image format of the first image to be processed is a YUV format.

[0115] Step 403: determine the target diffraction distance corresponding to the first image to be processed based on the pre-trained focus model, and perform a focus processing operation on the first image to be processed based on the target diffraction distance to obtain target image data.

[0116] In an embodiment of the present invention, the real-time image data after the target image processing operation is used as the first image to be processed, and the image format of the first image to be processed is the YUV format. Based on the pre-trained focus model, the target diffraction distance corresponding to the first image to be processed is determined, and the focus processing operation is performed on the first image to be processed based on the target diffraction distance to obtain the target image data. Specifically, the first image to be processed is input into the focus model in the YUV domain, and the output image of the focus model is obtained as the target image data. Among them, the target image data is the in-focus image corresponding to the real-time image data after the target image processing operation. Exemplarily, the focus model is used in the YUV domain to perform data back-propagation on the first image to be processed to obtain a clear image after back propagation, that is, the target image data.

[0117] Accordingly, after step 102, the embodiment of the present invention may include the following steps:

[0118] Step 404: perform a first image processing operation on the target image data; the first image processing operation and the target image processing operation have different processing contents.

[0119] In the embodiment of the present invention, the first image processing operation may include image processing steps such as sharpening, spatial noise reduction, color gamut mapping, etc. After acquiring the target image data, the first image processing operation is performed on the target image data.

[0120] Accordingly, step 103 may include the following steps:

[0121] Step 405: Display an image based on the target image data after the first image processing operation.

[0122] In the embodiment of the present invention, the target image data after the first image processing operation is displayed.

[0123] For example, Figure 6 As shown, the real-time image data is first subjected to target image processing, then subjected to focus processing through a focus model, and finally subjected to first image processing. Figure 7 As shown, based on Figure 6 The image change process of the architecture for image focus processing is to obtain real-time image data in RAW format, first perform target image processing (ISP1), then perform focus processing (OD) through the focus model to obtain target image data, and then perform the first image processing (ISP2) on the target image data before displaying it.

[0124] In an embodiment of the present invention, by format conversion of real-time image data, the image format of the first image to be processed is in YUV format, thereby improving the signal-to-noise ratio, reducing noise while retaining most of the details, and since a large amount of bandwidth data will be used when processing an image in RAW format, the amount of bandwidth data can be effectively reduced by converting the format into YUV format, so that the focus model has a faster calculation and recognition speed when processing the first image to be processed, thereby improving the image focusing effect and focusing speed.

[0125] Optionally, the focus model in the embodiment of the present invention can be trained based on the following steps:

[0126] Step 501, obtaining a plurality of target image groups; any of the target image groups comprises a plurality of in-focus images and a plurality of out-of-focus images corresponding to each of the plurality of in-focus images, and the diffraction distances of the plurality of out-of-focus images in any of the target image groups are the same.

[0127] In an embodiment of the present invention, a plurality of in-focus images are acquired in advance, and for any in-focus image, a diffraction optical simulation is performed on the in-focus image based on different diffraction distances (propagation distances) through a diffraction optical algorithm to obtain a defocused image corresponding to the in-focus image. That is to say, based on any diffraction distance, a plurality of in-focus images are simulated by diffraction optical simulation to obtain a plurality of defocused images corresponding to the plurality of in-focus images at the diffraction distance. The plurality of in-focus images and the plurality of defocused images corresponding to the diffraction distance are determined as a target image group. For different diffraction distances, defocused images at different diffraction distances corresponding to the plurality of in-focus images are acquired respectively to obtain a plurality of target image groups. Specifically, an image label can be set for the defocused image in the target image group.

[0128] Step 502: for any target image group, input a plurality of out-of-focus images in the target image group into a focus model to be trained, and obtain a plurality of predicted images output by the focus model to be trained.

[0129] In the embodiment of the present invention, the focus model to be trained is constructed in advance using the deep learning framework Pytorch, wherein the focus model to be trained may be a convolutional neural network. For any target image group, the target image group is input into the focus model to be trained, and multiple predicted images output by the focus model to be trained based on multiple out-of-focus images are obtained.

[0130] Step 503: Based on the multiple predicted images and the multiple in-focus images in the target image group, adjust the parameters of the focus model to be trained.

[0131] In an embodiment of the present invention, based on the image label corresponding to the out-of-focus image, the in-focus image corresponding to the out-of-focus image is determined. Based on the predicted image and the in-focus image in the target image group, the parameters of the focus model to be trained are adjusted. In order to make the similarity between the image predicted by the focus model to be trained and the in-focus image as high as possible, based on the predicted image and the in-focus image corresponding to the out-of-focus image in the target image group, the parameters of the focus model to be trained are adjusted, and by continuously adjusting the parameters of the focus model to be trained, the similarity between the predicted image output by the focus model to be trained and the in-focus image corresponding to the out-of-focus image in the target image group is greater than the first similarity threshold. Exemplarily, optimization algorithms such as stochastic gradient descent (SGD) and batch gradient descent (BGD) can be used to adjust the parameters of the focus model to be trained. Exemplarily, when adjusting the parameters of the focus model to be trained, a combination of binary cross entropy and Dice can be selected as the loss function, Adam can be used as the optimizer, and the learning rate can be set to 1e-4, while using a 3x3 convolution kernel. It can be understood that the embodiment of the present invention does not limit the parameter adjustment method.

[0132] Step 504: When the focus model to be trained meets a preset condition, determine the focus model to be trained as the target focus model.

[0133] In an embodiment of the present invention, the stop condition may include conditions such as a loss value of the focus model to be trained reaches a preset threshold, the number of training rounds of the focus model to be trained reaches a preset round number threshold, and the like.

[0134] In one possible implementation, the target image processing process corresponding to the target image processing operation can be integrated into the focus model. By training the image processing capability of the model to be trained, the real-time image data can be directly input into the focus model, and the target image data that has undergone focus processing by the focus model and target image processing can be directly obtained.

[0135] In an embodiment of the present invention, by training the focus model to be trained, the focus model to be trained can learn the general focusing capabilities under different diffraction distances (propagation distances) during the training process, so as to better focus on the out-of-focus image.

[0136] Optionally, step 501 may include the following steps:

[0137] Step 601: Acquire a plurality of in-focus images in advance and preset a plurality of different diffraction distances.

[0138] In the embodiment of the present invention, a plurality of in-focus images may be acquired in advance, and illustratively, the plurality of in-focus images may be acquired by an image acquisition component, and a plurality of different diffraction distances may be preset, such as 1 mm, 0.5 mm, and the like.

[0139] Step 602: Perform Fourier transform on each of the in-focus images to obtain a first spectrum diagram.

[0140] In the embodiment of the present invention, taking angular spectrum diffraction as an example, for any in-focus image, the acquired in-focus image S1(x, y) is subjected to a fast Fourier transform FFT to obtain a first spectrum graph F1(f x , f y ), as follows:

[0141] F1(f x , f y ) = FFT[S1(x,y)]

[0142] Step 604: for any diffraction distance among the multiple diffraction distances, based on a preset wave vector, a preset imaginary number, the diffraction distance and the first frequency spectrum, determine a second frequency spectrum corresponding to each of the in-focus images.

[0143] In the embodiment of the present invention, for any diffraction distance (propagation distance) among the multiple diffraction distances, based on the preset wave vector, the preset imaginary number, the diffraction distance and the first spectrum diagram, the second spectrum diagram corresponding to each in-focus image is determined by the first formula. The second spectrum diagram is a spectrum diagram after diffraction based on the diffraction distance (propagation distance).

[0144] The first formula may include:

[0145]

[0146] Among them, F2(f x , f y ) is used to represent the second spectrum diagram; F1(f x , f y ) is used to represent the first spectrum diagram; kIt is used to represent the wave vector, which can be determined based on the actual measurement situation; d is used to represent the diffraction distance (propagation distance); j is used to represent an imaginary number.

[0147] Step 605: Perform Fourier transform on the second frequency spectrum corresponding to each of the in-focus images to obtain a defocused image corresponding to each of the in-focus images.

[0148] In the embodiment of the present invention, for any second spectrum graph of the in-focus image, the second spectrum graph F2 (f x , f y ) is subjected to a fast Fourier transform to obtain a defocused image S2 (x, y) corresponding to the in-focus image, as follows:

[0149] S2(x, y) = IFFT[F2(f x , f y )]

[0150] For any in-focus image, by using Fourier transform and the first formula, multiple out-of-focus images corresponding to different diffraction distances can be determined by changing the diffraction distance d. Figure 8 As shown, for in-focus image 1, in-focus image 2, and in-focus image 3, based on the diffraction distance of 1 mm, out-of-focus image 1, out-of-focus image 2, and out-of-focus image 3 are obtained, and in-focus image 1, in-focus image 2, in-focus image 3, out-of-focus image 1, out-of-focus image 2, and out-of-focus image 3 are determined as a target image group. Based on the diffraction distance of 0.5 mm, out-of-focus image 4, out-of-focus image 5, and out-of-focus image 6 are obtained, and in-focus image 1, in-focus image 2, in-focus image 3, out-of-focus image 4, out-of-focus image 5, and out-of-focus image 6 are determined as a target image group. Among them, for the same in-focus image, there are differences in the image details of the out-of-focus images obtained based on different diffraction distances, for example, there will be differences in details such as image clarity and contrast.

[0151] In the embodiment of the present invention, by processing the in-focus image, a defocused image corresponding to the in-focus image can be obtained. In this way, when training the focus model to be trained, image prediction can be performed based on the defocused model, and then the predicted image can be compared with the in-focus model to adjust the model parameters and improve the training efficiency of the model. Furthermore, since in-focus images and defocused images corresponding to different diffraction distances are obtained during the model training process, by training the model based on in-focus images and defocused images with different diffraction distances, the focus model can learn the ability to identify the target diffraction distance based on the defocused image, and the ability to reversely reconstruct the defocused image based on the target diffraction distance to obtain the target image data.

[0152] In a possible implementation, the image corresponding to the real-time image data can be divided into regions, and the regional images can be reversely reconstructed based on different diffraction distances to meet the requirements of different regional images corresponding to different depth of field effects, thereby presenting the depth of field effect of a single image.

[0153] In another possible implementation, for multiple images with similar contents in the same scene, after focusing processing and target image processing are performed using a focus model, the multiple images can be spliced ​​to achieve an image expansion effect.

[0154] Fig. 9 is a structural diagram of a data processing device provided by an embodiment of the present invention, such as Fig. 9 As shown, the device may specifically include:

[0155] The first acquisition module 701 is used to acquire real-time image data acquired by the image acquisition component; the real-time image data is unfocused image data;

[0156] The first processing module 702 is used to determine the target diffraction distance corresponding to the real-time image data based on a pre-trained focus model, and perform a focus processing operation on the real-time image data based on the target diffraction distance to obtain target image data; the target image data is the in-focus image data corresponding to the real-time image data;

[0157] The first display module 703 is used to display an image based on the target image data.

[0158] The embodiment of the present invention provides a data processing device, which obtains real-time image data collected by an image acquisition component; the real-time image data is unfocused image data; based on a pre-trained focus model, the target diffraction distance corresponding to the real-time image data is determined, and based on the target diffraction distance, the real-time image data is subjected to a focus processing operation to obtain target image data; the target image data is the quasi-focus image data corresponding to the real-time image data; and the image is displayed based on the target image data. In this way, by performing a focus processing on the real-time image data, image focus can be achieved in a software-driven manner. Compared with achieving image focus in a hardware-driven manner, the hardware setting space in the device is reduced, the device structure is reduced, and the hardware cost is reduced. At the same time, there is no need for hardware to drive the lens to adjust the focal length, thereby avoiding the problem of repeated defocusing due to focus oscillation or motor collision. By performing a focus processing on the real-time image data through a pre-trained focus model, the focus processing effect of the real-time image data can be achieved, and the focus effect and image focus stability are improved.

[0159] Optionally, the device may further include:

[0160] A second processing module, used for performing a target image processing operation on the real-time image data;

[0161] The first processing module 702 includes:

[0162] A first determining module, configured to use the real-time image data after the target image processing operation as a first image to be processed;

[0163] The first focusing module is used to determine the target diffraction distance corresponding to the first image to be processed based on a pre-trained focusing model, and perform a focusing processing operation on the first image to be processed based on the target diffraction distance to obtain target image data.

[0164] Optionally, the device may further include:

[0165] The third processing module is used to perform target image processing operations on the target focused image.

[0166] The first display module 703 includes:

[0167] The first display submodule is used to display an image based on the target image data after the target image processing operation.

[0168] Optionally, the target image processing operation includes a format conversion operation, and the image format of the first image to be processed is a YUV format; the device may further specifically include:

[0169] a fourth processing module, configured to perform a first image processing operation on the target image data; the first image processing operation and the target image processing operation have different processing contents;

[0170] The first display module 703 includes:

[0171] The second display module is used to display an image based on the target image data after the first image processing operation.

[0172] Optionally, the device may further include:

[0173] A second acquisition module is used to acquire multiple groups of target image groups; any of the target image groups includes multiple in-focus images and multiple out-of-focus images corresponding to the multiple in-focus images, and the diffraction distances of the multiple out-of-focus images in any of the target image groups are the same;

[0174] A third acquisition module is used for inputting a plurality of out-of-focus images in any target image group into a focus model to be trained, and acquiring a plurality of predicted images output by the focus model to be trained;

[0175] A first adjustment module, configured to adjust parameters of the focus model to be trained based on the multiple predicted images and the multiple in-focus images in the target image group;

[0176] The third determination module is used to determine the focus model to be trained as the target focus model when the focus model to be trained meets a preset condition.

[0177] Optionally, the second acquisition module includes:

[0178] A first acquisition submodule, used for pre-acquiring a plurality of in-focus images and presetting a plurality of different diffraction distances;

[0179] A first transformation module, used for performing Fourier transformation on each of the in-focus images to obtain a first spectrum diagram;

[0180] a fourth determination module, configured to determine, for any diffraction distance among the plurality of diffraction distances, a second frequency spectrum corresponding to each of the in-focus images based on a preset wave vector, a preset imaginary number, the diffraction distance, and the first frequency spectrum;

[0181] The second transformation module is used to perform Fourier transformation on the second spectrum graph corresponding to each of the in-focus images to obtain a defocused image corresponding to each of the in-focus images.

[0182] The data processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0183] The data processing device of the embodiment of the present application may be a device having an action system. The action system may be an Android action system, an iOS action system, or other possible action systems, which are not specifically limited in the embodiment of the present application.

[0184] The data processing device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0185] Alternatively, if Fig.10 As shown, an embodiment of the present application also provides an electronic device 80, including a processor 801, a memory 802, and a program or instruction stored in the memory 802 and executable on the processor 801. When the program or instruction is executed by the processor 801, each step of any of the above-mentioned data processing method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0186] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0187] Fig.11 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0188] The electronic device 900 includes but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, and a processor 910 and other components.

[0189] Those skilled in the art will appreciate that the electronic device 900 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 910 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.11 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0190] Among them, the processor 910 is used to obtain real-time image data collected by the image acquisition component; the real-time image data is unfocused image data; based on a pre-trained focus model, the target diffraction distance corresponding to the real-time image data is determined, and based on the target diffraction distance, the real-time image data is focused. Processing operation is performed to obtain target image data; the target image data is in-focus image data corresponding to the real-time image data; and the display unit 906 is controlled to display an image based on the target image data.

[0191] Thus, in an embodiment of the present application, real-time image data collected by an image acquisition component is obtained; the real-time image data is unfocused image data; based on a pre-trained focus model, the target diffraction distance corresponding to the real-time image data is determined, and based on the target diffraction distance, a focus processing operation is performed on the real-time image data to obtain target image data; the target image data is the quasi-focus image data corresponding to the real-time image data; and an image is displayed based on the target image data. Thus, by performing a focus processing on the real-time image data, image focus can be achieved in a software-driven manner. Compared with achieving image focus in a hardware-driven manner, the setting space of the hardware in the device is reduced, the device structure is reduced, and the hardware cost is reduced. At the same time, there is no need for hardware to drive the lens to adjust the focal length, thereby avoiding the problem of repeated defocusing due to focus oscillation or motor collision. By performing a focus processing on the real-time image data through a pre-trained focus model, the focus processing effect of the real-time image data can be achieved, and the focus effect and image focus stability are improved.

[0192] Optionally, the processor 910 is also used to perform a target image processing operation on the real-time image data; use the real-time image data after the target image processing operation as the first image to be processed; based on a pre-trained focus model, determine the target diffraction distance corresponding to the first image to be processed, and based on the target diffraction distance, perform a focus processing operation on the first image to be processed to obtain target image data.

[0193] Optionally, the processor 910 is further configured to perform a target image processing operation on the target image data; and control the display unit 906 to display an image based on the target image data after the target image processing operation.

[0194] Optionally, the processor 910 is also used to perform a first image processing operation on the target image data; the first image processing operation has a different processing content from the target image processing operation; and the display unit 906 is controlled to display an image based on the target image data after the first image processing operation.

[0195] Optionally, the processor 910 is also used to obtain multiple groups of target image groups; any of the target image groups includes multiple in-focus images and multiple out-of-focus images corresponding to each of the multiple in-focus images, and the diffraction distances of the multiple out-of-focus images in any of the target image groups are the same; for any target image group, the multiple out-of-focus images in the target image group are input into the focus model to be trained, and multiple predicted images output by the focus model to be trained are obtained; based on the multiple predicted images and the multiple in-focus images in the target image group, parameters of the focus model to be trained are adjusted; when the focus model to be trained meets a preset condition, the focus model to be trained is determined as the target focus model.

[0196] Optionally, the processor 910 is also used to pre-acquire multiple in-focus images and preset multiple different diffraction distances; perform Fourier transform on each of the in-focus images to obtain a first spectrum diagram; for any diffraction distance among the multiple diffraction distances, determine a second spectrum diagram corresponding to each of the in-focus images based on a preset wave vector, a preset imaginary number, the diffraction distance and the first spectrum diagram; perform Fourier transform on the second spectrum diagram corresponding to each of the in-focus images to obtain a defocused image corresponding to each of the in-focus images.

[0197] It should be understood that in the embodiment of the present application, the input unit 904 may include a graphics processor (Graphics Processing Unit, GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of the static picture or video image obtained by the image capture device (such as a camera) in the video image capture mode or the image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 907 includes a touch panel 9071 and at least one of other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. Other input devices 9072 may include, but are not limited to, a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and an action rod, which will not be repeated here. The memory 909 can be used to store software programs and various data, including but not limited to applications and action systems. The processor 910 may integrate an application processor and a modem processor, wherein the application processor mainly processes the action system, user pages and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 910.

[0198] The memory 909 can be used to store software programs and various data. The memory 909 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 909 may include a volatile memory or a non-volatile memory, or the memory 909 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 909 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0199] The processor 910 may include one or more processing units; optionally, the processor 910 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 910.

[0200] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0201] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0202] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned data processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0203] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0204] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned data processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0205] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0206] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0207] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A data processing method, characterized in that: The method comprises: Acquire real-time image data collected by the image collection component; the real-time image data is unfocused image data; Based on a pre-trained focus model, a target diffraction distance corresponding to the real-time image data is determined, and based on the target diffraction distance, a focus processing operation is performed on the real-time image data to obtain target image data; the target image data is in-focus image data corresponding to the real-time image data; An image is displayed based on the target image data.

2. The method according to claim 1, characterized in that Before determining the target diffraction distance corresponding to the real-time image data based on the pre-trained focus model and performing a focus processing operation on the real-time image data based on the target diffraction distance to obtain the target image data, the method further includes: Performing a target image processing operation on the real-time image data; The method of determining a target diffraction distance corresponding to the real-time image data based on a pre-trained focus model, and performing a focus processing operation on the real-time image data based on the target diffraction distance to obtain target image data includes: Using the real-time image data after the target image processing operation as the first image to be processed; Based on a pre-trained focus model, a target diffraction distance corresponding to the first image to be processed is determined, and based on the target diffraction distance, a focus processing operation is performed on the first image to be processed to obtain target image data.

3. The method according to claim 1, characterized in that After determining the target diffraction distance corresponding to the real-time image data based on the pre-trained focus model, and performing a focus processing operation on the real-time image data based on the target diffraction distance to obtain the target image data, the method further includes: performing a target image processing operation on the target image data; The performing image display based on the target image data comprises: Image display is performed based on the target image data after the target image processing operation.

4. The method according to claim 2, characterized in that: The target image processing operation includes a format conversion operation, and the image format of the first image to be processed is a YUV format; After determining the target diffraction distance corresponding to the real-time image data based on the pre-trained focus model, and performing a focus processing operation on the real-time image data based on the target diffraction distance to obtain the target image data, the method further includes: performing a first image processing operation on the target image data; the first image processing operation and the target image processing operation have different processing contents; The performing image display based on the target image data comprises: Image display is performed based on the target image data after the first image processing operation.

5. The method according to claim 1, characterized in that The focus model is trained based on the following method: Acquire multiple groups of target image groups; any of the target image groups includes multiple in-focus images and multiple out-of-focus images corresponding to the multiple in-focus images, and the diffraction distances of the multiple out-of-focus images in any of the target image groups are the same; For any target image group, multiple out-of-focus images in the target image group are input into a focus model to be trained, and multiple predicted images output by the focus model to be trained are obtained; Based on the multiple predicted images and the multiple in-focus images in the target image group, adjusting parameters of the focus model to be trained; When the focus model to be trained meets a preset condition, the focus model to be trained is determined as the target focus model.

6. The method according to claim 5, characterized in that The obtaining of multiple target image groups comprises: Acquire multiple in-focus images in advance and preset multiple different diffraction distances; Performing Fourier transformation on each of the in-focus images to obtain a first spectrum diagram; For any diffraction distance among the multiple diffraction distances, based on a preset wave vector, a preset imaginary number, the diffraction distance and the first frequency spectrum, determining a second frequency spectrum corresponding to each of the in-focus images; The second frequency spectrum corresponding to each of the in-focus images is Fourier transformed to obtain a defocused image corresponding to each of the in-focus images.

7. A data processing device, characterized in that: The device comprises: A first acquisition module is used to acquire real-time image data acquired by the image acquisition component; the real-time image data is unfocused image data; A first processing module is used to determine a target diffraction distance corresponding to the real-time image data based on a pre-trained focus model, and perform a focus processing operation on the real-time image data based on the target diffraction distance to obtain target image data; the target image data is in-focus image data corresponding to the real-time image data; The first display module is used to display an image based on the target image data.

8. The device according to claim 7, characterized in that The device also includes: A second processing module, used for performing a target image processing operation on the real-time image data; The first processing module comprises: A first determining module, configured to use the real-time image data after the target image processing operation as a first image to be processed; The first focusing module is used to determine the target diffraction distance corresponding to the first image to be processed based on a pre-trained focusing model, and perform a focusing processing operation on the first image to be processed based on the target diffraction distance to obtain target image data.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data processing method according to any one of claims 1 to 6 when executing the program.

10. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Low depth of field image segmentation method based on frequency domain

    CN102663748A

  • Method for automatically extracting center of out-of-focus blurred centering image of aspheric optical element

    CN110428463A

  • Quick refocusing method and system for fuzzy region of full-slice digital pathological image

    CN111462075A

  • Determination method of image definition and image focusing method and device

    CN112351196A

  • Automatic focusing method of optical imaging system for estimating defocusing amount of single image

    CN117528238A