Image processing method and device, shooting equipment and storage medium

By automatically determining the number of targets and controlling lens adjustment, it solves the problem of low image acquisition efficiency when the camera has a small depth of field range and large depth changes, achieving efficient and stable imaging effects.

CN118741291AInactive Publication Date: 2024-10-01SHENZHEN SENSETIME TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410710679.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the depth of field range of the camera lens is small, if the measured object has a large depth variation range, it is difficult to quickly obtain the appropriate number of images through traditional methods, resulting in low imaging efficiency and poor stability and reliability of the number of images. It is difficult to respond to sudden imaging needs in a timely manner.

Method used

By obtaining the first and second distances of the target object relative to the device, as well as the depth direction change amplitude, the number of targets is automatically determined, and the lens adjustment and image shooting are controlled based on these parameters to obtain the target number of target object images without manual testing and verification. , improve imaging efficiency and ensure the stability of image quantity.

Benefits of technology

It achieves rapid acquisition of the appropriate number of images, improves imaging efficiency, can respond to sudden imaging needs in a timely manner, and improves the stability and reliability of the number of images to meet the clear imaging needs of different objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118741291A_ABST
    Figure CN118741291A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method and device, shooting equipment and a storage medium. The method comprises the steps that the first distance and the second distance of a target object relative to the equipment and the depth direction variation amplitude of the target object are acquired; determining a target number according to the depth direction variation amplitude of the target object and the lens depth of field of the equipment; and based on the first distance, the second distance and the target number, controlling the equipment to carry out lens adjustment and image shooting to obtain the target number of target object images. By adopting the embodiment of the invention, the number of images needing to be shot by the shooting equipment can be quickly obtained, and then the imaging efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision and smart camera technology, and in particular to an image processing method, apparatus, shooting device and storage medium. Background Art

[0002] When the depth of field of the camera lens is small, if the object under test has a large depth variation range, it is difficult to capture all of the object under test clearly by taking one image. In order to meet the demand for obtaining a clear image of the object under test, the lens can be moved to different focus planes to capture a certain number of images of the object under test, and then these images are fused to obtain a clear image of the object under test. The number of images taken by the camera is an important factor affecting the efficiency and quality of subsequent fusion, so it is necessary to determine an appropriate number of images.

[0003] In traditional solutions, a large number of tests and verifications are performed manually to obtain the appropriate number of images to guide the camera to take the corresponding number of images. However, traditional solutions take a long time, resulting in low efficiency in obtaining the number of images, making it difficult to respond to sudden imaging needs in a timely manner, which in turn affects imaging efficiency. Summary of the invention

[0004] The present application provides an image processing method, device, shooting equipment and storage medium, which can quickly obtain the number of images required to be shot by the shooting equipment, thereby improving imaging efficiency.

[0005] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:

[0006] Acquire a first distance and a second distance of a target object relative to a device, and a depth direction variation amplitude of the target object;

[0007] Determining the number of targets according to the depth direction variation of the target object and the depth of field of the lens of the device;

[0008] Based on the first distance, the second distance, and the target quantity, the device is controlled to perform lens adjustment and image capture to obtain images of the target object quantity.

[0009] In the above embodiment, the device automatically determines the number of targets based on the first distance and the second distance of the target object relative to the device, the depth direction variation of the target object and the depth of field of the lens of the device, and captures the target number of target object images, without the need for a large number of manual tests and verifications to obtain the target number, which reduces time consumption and is conducive to improving the efficiency of obtaining the target number, thereby improving the imaging efficiency and being able to respond to sudden imaging needs in a timely manner. In addition, the above embodiment does not need to rely on manual experience, and the stability and reliability of the number of images obtained thereby are good, and can meet the clear imaging needs of different objects.

[0010] In some possible implementations, determining the number of targets according to the depth direction variation amplitude of the target object and the depth of field of a lens of the device includes:

[0011] Obtaining a predetermined depth of field coefficient and a deviation value;

[0012] A first value is obtained according to the product of the depth of field of the lens of the device and the depth of field coefficient, a second value is obtained according to the ratio of the depth direction change amplitude of the target object to the first value, and the target quantity is determined according to the sum of the second value and the deviation value.

[0013] In the above implementation, the target number is obtained based on the depth direction change amplitude of the target object, the lens depth of field of the device, and a predetermined depth of field coefficient and deviation value, and the target number obtained is used to guide image capture, which is beneficial to balancing image quality and operating efficiency.

[0014] In some possible implementations, the method for determining the depth of field coefficient and the deviation value includes:

[0015] Acquire depth direction variation sample values ​​and lens depth of field sample values, and determine sample value combinations, each of the sample value combinations including one depth direction variation sample value and one lens depth of field sample value;

[0016] The optimal number of shots corresponding to each of the sample value combinations is determined, and data fitting is performed based on each of the sample value combinations and their corresponding optimal number of shots to obtain the depth of field coefficient and the deviation value.

[0017] In the above implementation, data fitting is performed on each sample value combination and its corresponding optimal shooting quantity to obtain a depth of field coefficient and a deviation value. The depth of field coefficient and deviation value determined thereby are used to assist in determining the number of targets, which is conducive to quickly obtaining the optimal number of targets.

[0018] In some possible implementations, obtaining the depth direction variation amplitude sample value and the lens depth of field sample value and determining the sample value combination includes:

[0019] determining at least two sample objects and at least two sample devices;

[0020] For each of the sample objects and each of the sample devices, a first sample distance and a second sample distance are obtained, a depth direction variation amplitude sample value is obtained according to a difference between the first sample distance and the second sample distance, a lens depth of field sample value is obtained according to the lens depth of field of the sample device, and a sample value combination is determined based on one of the depth direction variation amplitude sample values ​​and one of the lens depth of field sample values, wherein the first sample distance and the second sample distance respectively represent a first distance and a second distance of the sample object relative to the sample device.

[0021] In the above implementation, different depth direction variation amplitude sample values ​​and different lens depth of field sample values ​​are obtained through at least two sample objects and at least two sample devices, which are convenient for testing the influence of the depth direction variation amplitude and the lens depth of field on the optimal number of shots, and then obtaining the relationship between the optimal number of shots and the depth direction variation amplitude and the lens depth of field.

[0022] In some possible implementations, determining the optimal number of shots corresponding to each sample value combination includes:

[0023] For each of the sample value combinations, based on the first sample distance, the second sample distance and the number of samples to be tested, controlling the sample device to adjust the lens and capture images to obtain images of the sample objects of the number of samples to be tested;

[0024] According to the test data corresponding to each of the quantities to be tested, the optimal number of shots corresponding to the sample value combination is determined from each of the quantities to be tested, wherein the test data includes: the efficiency of fusing the sample object images of the quantity to be tested to obtain a fused image, and the quality of the fused image.

[0025] In the above implementation, the optimal number of shots is determined according to the fusion efficiency corresponding to each number to be tested and the quality of the fused image, and the image shooting is guided by the optimal number of shots determined thereby, which is beneficial to obtaining clear imaging while minimizing the number of shots.

[0026] In some possible implementations, controlling the device to adjust the lens and capture images based on the first distance, the second distance, and the number of targets to obtain images of the target objects of the target number includes:

[0027] Determine the number of lens adjustments and lens parameter data corresponding to each lens adjustment based on the first distance, the second distance, and the number of targets;

[0028] According to the lens adjustment times and the lens parameter data corresponding to each lens adjustment, the shooting device is controlled to perform lens adjustment, and an image is captured after each lens adjustment is completed to obtain the target number of target object images.

[0029] In the above implementation, the device is controlled to perform lens adjustment and image capture according to the number of lens adjustments and lens parameter data corresponding to each lens adjustment, which is conducive to accurate control of lens parameter adjustment and obtaining an image that meets the clarity requirements.

[0030] In some possible implementations, the lens parameter data includes diopter data; and determining the number of lens adjustments and the lens parameter data corresponding to each lens adjustment based on the first distance, the second distance, and the number of targets includes:

[0031] determining a lens adjustment number based on the target number, determining a first diopter based on the first distance, and determining a second diopter based on the second distance;

[0032] An adjustment interval is determined according to the first refractive power, the second refractive power, and the number of lens adjustments, and refractive power data corresponding to each lens adjustment is determined according to the first refractive power, the second refractive power, and the adjustment interval.

[0033] In the above implementation, the number of lens adjustments and the adjustment interval are determined according to the number of targets, the first distance, and the second distance, and then the refractive power data corresponding to each lens adjustment is determined. Accordingly, by adjusting the refractive power of the lens, uniform shooting can be achieved within the depth direction variation range of the target object, which is conducive to obtaining clear imaging.

[0034] In a second aspect, an embodiment of the present application provides an image processing device, the device comprising:

[0035] an acquisition unit, configured to acquire a first distance and a second distance of a target object relative to a device, and a depth direction variation amplitude of the target object;

[0036] A first determining unit, configured to determine the number of targets according to a depth direction variation amplitude of the target object and a depth of field of a lens of the device;

[0037] An imaging unit is used to control the device to adjust the lens and capture images based on the first distance, the second distance and the target number, so as to obtain images of the target objects of the target number.

[0038] In some possible implementations, the first determining unit is specifically configured to:

[0039] Obtaining a predetermined depth of field coefficient and a deviation value;

[0040] A first value is obtained according to the product of the depth of field of the lens of the device and the depth of field coefficient, a second value is obtained according to the ratio of the depth direction change amplitude of the target object to the first value, and the target quantity is determined according to the sum of the second value and the deviation value.

[0041] In some possible implementations, the device further includes a second determination unit, configured to determine the depth of field coefficient and the deviation value; the second determination unit is specifically configured to:

[0042] Acquire depth direction variation sample values ​​and lens depth of field sample values, and determine sample value combinations, each of the sample value combinations including one depth direction variation sample value and one lens depth of field sample value;

[0043] The optimal number of shots corresponding to each of the sample value combinations is determined, and data fitting is performed based on each of the sample value combinations and their corresponding optimal number of shots to obtain the depth of field coefficient and the deviation value.

[0044] In some possible implementations, when the second determination unit obtains the depth direction variation amplitude sample value and the lens depth of field sample value and determines the sample value combination, it is specifically used to:

[0045] determining at least two sample objects and at least two sample devices;

[0046] For each of the sample objects and each of the sample devices, a first sample distance and a second sample distance are obtained, a depth direction variation amplitude sample value is obtained according to a difference between the first sample distance and the second sample distance, a lens depth of field sample value is obtained according to the lens depth of field of the sample device, and a sample value combination is determined based on one of the depth direction variation amplitude sample values ​​and one of the lens depth of field sample values, wherein the first sample distance and the second sample distance respectively represent a first distance and a second distance of the sample object relative to the sample device.

[0047] In some possible implementations, when determining the optimal number of shots corresponding to each of the sample value combinations, the second determination unit is specifically configured to:

[0048] For each of the sample value combinations, based on the first sample distance, the second sample distance and the number of samples to be tested, controlling the sample device to adjust the lens and capture images to obtain images of the sample objects of the number of samples to be tested;

[0049] According to the test data corresponding to each of the quantities to be tested, the optimal number of shots corresponding to the sample value combination is determined from each of the quantities to be tested, wherein the test data includes: the efficiency of fusing the sample object images of the quantity to be tested to obtain a fused image, and the quality of the fused image.

[0050] In some possible implementations, the imaging unit is specifically used for:

[0051] Determine the number of lens adjustments and lens parameter data corresponding to each lens adjustment based on the first distance, the second distance, and the number of targets;

[0052] According to the lens adjustment times and the lens parameter data corresponding to each lens adjustment, the device is controlled to perform lens adjustment, and an image is captured after each lens adjustment is completed to obtain the target number of target object images.

[0053] In some possible implementations, the lens parameter data includes diopter data; when the imaging unit determines the number of lens adjustments and the lens parameter data corresponding to each lens adjustment based on the first distance, the second distance, and the number of targets, the imaging unit is specifically configured to:

[0054] determining a lens adjustment number based on the target number, determining a first diopter based on the first distance, and determining a second diopter based on the second distance;

[0055] An adjustment interval is determined according to the first refractive power, the second refractive power, and the number of lens adjustments, and refractive power data corresponding to each lens adjustment is determined according to the first refractive power, the second refractive power, and the adjustment interval.

[0056] In a third aspect, an embodiment of the present application provides a shooting device, comprising: a processor and a memory, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor executes the computer instructions, the shooting device executes the method as described in the first aspect above and any possible implementation method thereof.

[0057] In a fourth aspect, an embodiment of the present application provides a shooting device, comprising: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the shooting device executes the method as described in the first aspect above and any possible implementation method thereof.

[0058] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method as described in the first aspect above and any possible implementation thereof.

[0059] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are run on a computer, the computer executes the method as described in the first aspect above and any possible implementation thereof.

[0060] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0062] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0063] Figure 1 It is a flowchart of an image processing method provided in an embodiment of the present application;

[0064] Figure 2 is a schematic diagram of a target object shooting scene provided in an embodiment of the present application;

[0065] Figure 3 is a schematic diagram of the distance between a target object and a shooting device provided in an embodiment of the present application;

[0066] Figure 4 This is a schematic diagram of the depth direction variation range of a target object provided by an embodiment of the present application;

[0067] Figure 5 This is a schematic diagram of a target object image fusion effect provided in an embodiment of the present application;

[0068] Figure 6 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;

[0069] Figure 7 It is a schematic diagram of the hardware structure of an image processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0070] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0071] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0072] It should be understood that in the present application, "at least one (item)" means one or more, "more than one" means two or more, and "at least two (items)" means two or three and more than three. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " can indicate that the previous and next associated objects are in an "or" relationship, which refers to any combination of these items, including any combination of single items (items) or plural items (items). For example, at least one item (item) of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0073] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0074] When the depth of field of the camera lens is small, if the object under test has a large depth variation range, it is difficult to capture all of the object under test clearly in one image. In order to meet the demand for obtaining a clear image of the object under test, the lens can be moved to different focus planes to capture a certain number of images of the object under test, and then these images are fused to obtain a clear image of the object under test. The number of images taken by the camera is an important factor affecting the subsequent fusion efficiency and quality. For example, too many images can easily lead to low fusion efficiency, and too few images can easily lead to poor fusion quality. Therefore, it is necessary to select an appropriate number of images.

[0075] In traditional solutions, a large number of tests and verifications are performed manually to obtain the appropriate number of images to guide the camera to take the corresponding number of images. However, traditional solutions take a long time, resulting in low efficiency in obtaining the number of images, making it difficult to respond to sudden imaging needs in a timely manner, which in turn affects imaging efficiency. In addition, traditional solutions are highly dependent on manual experience, resulting in poor stability and reliability of the number of images.

[0076] Based on this, an embodiment of the present application provides an image processing method to solve the problem of low efficiency in acquiring the number of images, and can also solve the problem of poor stability and reliability of the number of images.

[0077] The image processing method may be executed by an image processing device, for example, the image processing method may be executed by a photographing device (such as a smart camera). In some possible implementations, the image processing method may be implemented by a processor calling computer-readable instructions stored in a memory.

[0078] See also Figure 1 , Figure 1 It is a flowchart of an image processing method provided in an embodiment of the present application. The image processing method can be applied to a device with a shooting function (hereinafter referred to as a device or a shooting device), and includes the following steps S101 to S103.

[0079] S101, obtaining a first distance and a second distance of a target object relative to a device, and a depth-direction variation amplitude of the target object.

[0080] The target object refers to the object being photographed. The target object may have surfaces of different heights within the shooting range, so that different surfaces of the target object are at different distances relative to the shooting device. The first distance of the target object relative to the shooting device can be understood as the distance between the surface of the target object closest to the shooting device and the shooting device, or the minimum distance of the target object relative to the shooting device. The second distance of the target object relative to the shooting device can be understood as the distance between the surface of the target object farthest from the shooting device and the shooting device, or the maximum distance of the target object relative to the shooting device. The depth variation amplitude of the target object can be understood as the height difference between the surface of the target object closest to the shooting device and the surface farthest from the shooting device, which can be specifically determined by the difference between the above-mentioned maximum distance and the above-mentioned minimum distance.

[0081] Optionally, the user inputs the minimum distance and maximum distance of the target object relative to the shooting device, as well as the depth direction change amplitude of the target object into the shooting device, and triggers an imaging instruction. After receiving the imaging instruction, the shooting device obtains the minimum distance, maximum distance, and depth direction change amplitude input by the user. In other embodiments, the user may also only input the minimum distance and maximum distance of the target object relative to the shooting device. After the shooting device obtains the minimum distance and maximum distance input by the user, it calculates the difference between the maximum distance and the minimum distance to obtain the depth direction change amplitude of the target object.

[0082] For example, see Figure 2 , Figure 2 : is a schematic diagram of a target object shooting scene provided by an embodiment of the present application, wherein C represents a shooting device, B represents a target object, and the target object B includes four parts, which are represented by B1, B2, B3 and B4 respectively, and the surface heights of B1, B2, B3 and B4 are different. Figure 3 , Figure 3 d1, d2, d3 and d4 respectively represent the distances of B1, B2, B3 and B4 relative to the shooting device. By comparing the distances, it can be seen that d3 is the smallest and d2 is the largest. Figure 4 , Figure 4 It is a schematic diagram of the depth variation amplitude of a target object provided in an embodiment of the present application, wherein D represents the depth variation amplitude of the target object, that is, the surface height difference between B2 and B3 is equal to the difference between d2 and d3.

[0083] S102, determining the number of targets according to the depth direction variation of the target objects and the depth of field of the lens of the device.

[0084] The depth of field of the lens is an inherent parameter of the camera device and can be directly obtained from the configuration information of the camera device. The number of targets refers to the number of images of the target object that the camera device needs to capture. After obtaining the depth change amplitude of the target object and the depth of field of the lens, the camera device automatically calculates the number of targets based on the depth change amplitude of the target object and the depth of field of the lens, without the need for the user to determine the number of targets by themselves.

[0085] S103, based on the first distance, the second distance and the number of targets, controlling the device to adjust the lens and capture images to obtain images of a target number of target objects.

[0086] The clarity of the target object image is related to the distance of the target object relative to the shooting device (referred to as the shooting distance), and is also related to the lens parameters of the shooting device. A correspondence between the shooting distance and the lens parameters can be established in advance. When the shooting distance is known, the lens parameter data corresponding to the shooting distance can be obtained according to the correspondence; wherein the lens parameter data corresponding to the shooting distance can be understood as the lens parameter data required for obtaining a clear image of the target object at the position corresponding to the shooting distance.

[0087] After obtaining the minimum distance of the target object relative to the shooting device (i.e., the minimum shooting distance) and the maximum distance of the target object relative to the shooting device (i.e., the maximum shooting distance), the adjustment range of the lens parameter data can be determined according to the minimum shooting distance and the maximum shooting distance. By adjusting the lens parameter data accordingly within the adjustment range in combination with the number of targets, the focus range of the lens can be changed so that all positions of the target object within its depth direction variation range can be clearly imaged.

[0088] For example, see Figure 5 , Figure 5 This is a schematic diagram of the target object image fusion effect provided by an embodiment of the present application. The target object images of the target number obtained in the above embodiment are fused, and the fusion effect is shown in Figure (a). Each position of the target object obtains a clear image, which is shown as consistent in size in the figure. In addition, a control group is set, and a control number is used in the control group. The control number is smaller than the target number in the above embodiment. The target object images of the control number are fused, and the fusion effect is shown in Figure (b). Too small a number will cause some positions of the target object to be out of focus, which will lead to blurred imaging, which is shown as inconsistent in size in the figure.

[0089] In the above embodiment, the shooting device automatically determines the number of targets based on the minimum distance and maximum distance of the target object relative to the shooting device, the depth variation of the target object and the depth of field of the lens of the shooting device, and shoots the target number of target object images, without the need for a large number of manual tests and verifications to obtain the target number, which reduces time consumption and is conducive to improving the efficiency of obtaining the target number, thereby improving the imaging efficiency and being able to respond to sudden imaging needs in a timely manner. In addition, the above embodiment does not need to rely on manual experience, and the stability and reliability of the number of images obtained thereby are good, which can meet the clear imaging needs of different objects.

[0090] In a possible implementation, the number of targets is determined based on the depth-direction change amplitude of the target object and the lens depth of field of the device, which may specifically include: obtaining a predetermined depth of field coefficient and a deviation value; obtaining a first value based on the product of the lens depth of field of the device and the depth of field coefficient, obtaining a second value based on the ratio of the depth-direction change amplitude of the target object to the first value, and determining the number of targets based on the sum of the second value and the deviation value.

[0091] The depth of field coefficient and the deviation value are fixed parameters required in the process of calculating the number of targets. For example, the variation law between the number of targets and the depth direction variation amplitude and the lens depth of field can be obtained in advance through experimental data, and the depth of field coefficient and the deviation value are obtained based on the variation law. Among them, the experimental data may include image data obtained under different depth direction variation amplitudes, different lens depths of field, and different numbers of shots. The number of targets can be understood as the optimal number of shots, under which image quality and operating efficiency can be optimized simultaneously.

[0092] For example, the target quantity can be calculated by the following formula:

[0093]

[0094] Wherein, N represents the number of targets, D represents the depth variation of the target object, L represents the depth of field of the camera lens, k represents the depth of field coefficient, and ΔL represents the deviation value. It should be noted that if N calculated by the above formula is a decimal, it is rounded up to obtain the number of targets.

[0095] In the above implementation, the target number is obtained based on the depth direction change amplitude of the target object, the lens depth of field of the shooting equipment, and the predetermined depth of field coefficient and deviation value, and the target number obtained is used to guide image shooting, which is beneficial to balance image quality and operating efficiency.

[0096] In a possible implementation, a method for determining a depth of field coefficient and a deviation value may include: obtaining depth direction variation amplitude sample values ​​and lens depth of field sample values, and determining sample value combinations, each sample value combination including a depth direction variation amplitude sample value and a lens depth of field sample value; determining an optimal number of shots corresponding to each sample value combination, performing data fitting based on each sample value combination and its corresponding optimal number of shots, and obtaining a depth of field coefficient and a deviation value.

[0097] There can be multiple depth direction variation sample values, and there can also be multiple lens depth of field sample values, wherein any depth direction variation sample value and any lens depth of field sample value can form a sample value combination. For example, assuming there are two depth direction variation sample values, namely D1 and D2, and two lens depth of field sample values, namely L1 and L2, four sample value combinations can be formed, namely (D1, L1), (D1, L2), (D2, L1) and (D2, L2).

[0098] For each sample value combination, the corresponding optimal number of shots refers to the number of shots that can achieve both good image quality and high operating efficiency. Specifically, based on the optimal number of shots, images are shot to obtain a corresponding number of images, and these images are fused to obtain a fused image. The quality of the fused image and the fusion efficiency are comprehensively evaluated to obtain a comprehensive evaluation result corresponding to the optimal number of shots. Compared with other numbers of shots, the comprehensive evaluation result corresponding to the optimal number of shots is better.

[0099] Each sample value combination and its corresponding optimal number of shots constitute a set of data to be fitted. For example, for the sample value combination (D1, L1), assuming that its corresponding optimal number of shots is N1, then the sample value combination and its corresponding optimal number of shots constitute a set of data to be fitted (N1, (D1, L1)).

[0100] According to each sample value combination and its corresponding optimal number of shots, multiple sets of data to be fitted can be obtained. Optionally, based on multiple sets of data to be fitted, the sample value combination therein is used as an independent variable, the optimal number of shots therein is used as a dependent variable, and data fitting is performed to obtain a fitting equation between the optimal number of shots and the sample value combination, and the depth of field coefficient and the deviation value are obtained from the fitting equation.

[0101] In the above implementation, data fitting is performed on each sample value combination and its corresponding optimal shooting quantity to obtain a depth of field coefficient and a deviation value. The depth of field coefficient and deviation value determined thereby are used to assist in determining the number of targets, which is conducive to quickly obtaining the optimal number of targets.

[0102] In a possible implementation, obtaining depth direction variation amplitude sample values ​​and lens depth of field sample values, and determining a sample value combination may specifically include: determining at least two sample objects and at least two sample devices; for each sample object and each sample device, obtaining a first sample distance and a second sample distance, obtaining a depth direction variation amplitude sample value according to a difference between the first sample distance and the second sample distance, obtaining a lens depth of field sample value according to the lens depth of field of the sample device, and determining a sample value combination based on a depth direction variation amplitude sample value and a lens depth of field sample value, wherein the first sample distance and the second sample distance respectively represent a first distance and a second distance of the sample object relative to the sample device.

[0103] Different sample objects have different depth direction variation amplitudes, and different sample shooting devices have different lens depths of field. Different sample objects and different sample shooting devices can be used to obtain different depth direction variation amplitude sample values ​​and different lens depth of field sample values. Specifically, the depth direction variation amplitude of each sample object is used as a depth direction variation amplitude sample value, and the lens depth of field of each sample shooting device is used as a lens depth of field sample value. Any depth direction variation amplitude sample value and any lens depth of field sample value can form a sample value combination.

[0104] For example, for a sample object and a sample shooting device used to shoot the sample object, the depth direction variation of the sample object and the depth of field of the lens of the sample shooting device form a sample value combination. The depth direction variation of the sample object can be determined by the minimum distance and maximum distance of the sample object relative to the sample shooting device.

[0105] The first distance of the sample object relative to the sample shooting device can be understood as the distance between the surface of the sample object closest to the sample shooting device and the sample shooting device, or referred to as the sample minimum distance. The second distance of the sample object relative to the sample shooting device can be understood as the distance between the surface of the sample object farthest from the sample shooting device and the sample shooting device, or referred to as the sample maximum distance. The depth direction variation amplitude of the sample object can be understood as the height difference between the surface of the sample object closest to the sample shooting device and the surface farthest from the sample shooting device, which can be specifically determined by the difference between the above-mentioned sample maximum distance and the above-mentioned sample minimum distance.

[0106] In the above implementation, different depth direction change amplitude sample values ​​and different lens depth of field sample values ​​are obtained through at least two sample objects and at least two sample shooting devices, which are convenient for testing the influence of the depth direction change amplitude and the lens depth of field on the optimal number of shots, and then the relationship between the optimal number of shots and the depth direction change amplitude and the lens depth of field is obtained.

[0107] In a possible implementation, determining the optimal number of shots corresponding to each sample value combination may specifically include: for each sample value combination, based on the first sample distance, the second sample distance, and each number to be tested, controlling the sample device to perform lens adjustment and image capture to obtain sample object images of each number to be tested; and determining the optimal number of shots corresponding to the sample value combination from each number to be tested according to test data corresponding to each number to be tested, wherein the test data includes: the efficiency of fusing the sample object images of the number to be tested to obtain a fused image, and the quality of the fused image.

[0108] The number to be tested refers to the preset number of shots for testing, which can be set according to actual needs. For example, the value range of the number to be tested is all integers in [2,20]. For each sample value combination, tests are performed under each number to be tested to obtain test data corresponding to each number to be tested. Specifically, for each number to be tested, based on the minimum sample distance, the maximum sample distance and the number to be tested, the sample shooting device is controlled to adjust the lens and shoot the image to obtain the sample object image of the number to be tested, and the sample object images of the number to be tested are fused to obtain a fused image, and the fusion efficiency and fusion effect are determined. Among them, the fusion efficiency is used to indicate the speed of obtaining the fused image, and the fusion effect is used to indicate the quality (such as clarity) of the fused image.

[0109] Optionally, a comprehensive evaluation is performed on the test data corresponding to each number to be tested, that is, a comprehensive evaluation is performed on the fusion efficiency and the fusion effect, to obtain an evaluation score corresponding to each number to be tested. The evaluation score is used to characterize the comprehensive evaluation result. The higher the evaluation score corresponding to the number to be tested, the better the comprehensive evaluation result, and the higher the possibility that the number to be tested is the best shooting number; the lower the evaluation score corresponding to the number to be tested, the worse the comprehensive evaluation result, and the lower the possibility that the number to be tested is the best shooting number. Exemplarily, based on the evaluation score corresponding to each number to be tested, the best shooting number is determined from each number to be tested. Specifically, the number to be tested corresponding to the highest evaluation score is used as the best shooting number.

[0110] In the above implementation, the optimal number of shots is determined according to the fusion efficiency corresponding to each number to be tested and the quality of the fused image, and the image shooting is guided by the optimal number of shots determined thereby, which is beneficial to obtaining clear imaging while minimizing the number of shots.

[0111] In a possible implementation, based on the first distance, the second distance, and the number of targets, the control device performs lens adjustment and image capture to obtain a target number of target object images, which may specifically include: determining the number of lens adjustments and lens parameter data corresponding to each lens adjustment based on the first distance, the second distance, and the number of targets; controlling the device to perform lens adjustment according to the number of lens adjustments and the lens parameter data corresponding to each lens adjustment, and capturing an image after each lens adjustment is completed to obtain a target number of target object images.

[0112] The number of lens adjustments refers to the number of times the lens parameters need to be adjusted. The lens parameters here can be understood as lens parameters that will affect the clarity of the captured image, such as diopter. The lens parameter data corresponding to each lens adjustment refers to the target value that the lens parameters need to reach after each lens adjustment. Taking diopter as an example, each lens adjustment corresponds to one diopter, and different lens adjustments correspond to different diopters.

[0113] Exemplarily, after the photographing device determines the lens adjustment times and the lens parameter data corresponding to each lens adjustment, the lens parameters are adjusted to the corresponding data in sequence according to a preset order, and an image is taken under each lens parameter data to obtain a target number of target object images. The preset order may be an order from small to large for the lens parameter data, an order from large to small for the lens parameter data, or a random order.

[0114] In the above implementation, according to the number of lens adjustments and the lens parameter data corresponding to each lens adjustment, the shooting device is controlled to perform lens adjustment and image shooting, which is conducive to accurate control of lens parameter adjustment and obtaining an image that meets the clarity requirements.

[0115] In a possible implementation, the lens parameter data includes refractive power data; based on the first distance, the second distance, and the target number, determining the number of lens adjustments and the lens parameter data corresponding to each lens adjustment, specifically may include: determining the number of lens adjustments based on the target number, determining the first refractive power according to the first distance, and determining the second refractive power according to the second distance; determining the adjustment interval according to the first refractive power, the second refractive power, and the number of lens adjustments, and determining the refractive power data corresponding to each lens adjustment according to the first refractive power, the second refractive power, and the adjustment interval.

[0116] The number of lens adjustments is determined based on the number of targets, specifically, the number of targets is determined as the number of lens adjustments. For example, if the number of targets (i.e., the number of target object images that the shooting device needs to shoot) is 5, the number of lens adjustments is 5, and one target object image is shot after each lens adjustment.

[0117] The first diopter refers to the diopter required for obtaining a clear image of the target object at the position corresponding to the minimum distance (i.e., the surface of the target object closest to the camera), or the minimum diopter. The second diopter refers to the diopter required for obtaining a clear image of the target object at the position corresponding to the maximum distance (i.e., the surface of the target object farthest from the camera), or the maximum diopter.

[0118] Specifically, a correspondence between shooting distance and diopter can be established in advance. When the shooting distance is known, diopter data corresponding to the shooting distance can be obtained according to the correspondence; wherein the diopter data corresponding to the shooting distance refers to the diopter data required for obtaining a clear image of the target object at the position corresponding to the shooting distance. Accordingly, after obtaining the minimum distance and the maximum distance, the minimum diopter can be obtained according to the minimum distance and the above correspondence, and the maximum diopter can be obtained according to the maximum distance and the above correspondence.

[0119] The adjustment interval refers to the difference between the diopter data corresponding to two adjacent lens adjustments, which can be calculated as follows: Q = (Q 2 -Q 1 ) / (N-1), where Q represents the adjustment interval, Q 2 Indicates the maximum diopter, Q 1 Represents the minimum diopter, and N represents the number of lens adjustments (i.e., the target number). After obtaining the adjustment interval, starting from the minimum diopter, each time the adjustment interval is added, a diopter data is obtained until the maximum diopter is reached, thereby obtaining the diopter data corresponding to each lens adjustment. For example, assuming that the minimum diopter is 1, the maximum diopter is 5, and the number of lens adjustments is 5, the adjustment interval is 1, and the diopter data corresponding to each lens adjustment are in the order from small to large: 1, 2, 3, 4, 5.

[0120] In the above implementation, the number of lens adjustments and the adjustment interval are determined according to the number of targets, the minimum distance and the maximum distance, and then the refractive power data corresponding to each lens adjustment is determined. Accordingly, by adjusting the refractive power of the lens, uniform shooting can be achieved within the depth direction variation range of the target object, which is conducive to obtaining clear imaging.

[0121] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0122] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0123] See also Figure 6 , Figure 6 6 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. The image processing device 600 includes: an acquisition unit 601, a first determination unit 602 and an imaging unit 603, wherein:

[0124] An acquisition unit 601 is used to acquire a first distance and a second distance of a target object relative to a device, and a depth direction variation amplitude of the target object;

[0125] A first determining unit 602 is used to determine the number of targets according to the depth direction variation of the target object and the depth of field of the lens of the device;

[0126] The imaging unit 603 is used to control the device to adjust the lens and capture images based on the first distance, the second distance and the number of targets, so as to obtain images of the target objects of the target number.

[0127] In some possible implementations, the first determining unit 602 is specifically configured to:

[0128] Obtaining a predetermined depth of field coefficient and a deviation value;

[0129] A first value is obtained by multiplying the depth of field of the lens of the device by a depth coefficient, a second value is obtained by the ratio of the depth direction variation amplitude of the target object to the first value, and the target quantity is determined by the sum of the second value and the deviation value.

[0130] In some possible implementations, the device 600 further includes a second determination unit, configured to determine a depth of field coefficient and a deviation value; the second determination unit is specifically configured to:

[0131] Obtaining depth direction variation sample values ​​and lens depth of field sample values, and determining sample value combinations, each sample value combination including a depth direction variation sample value and a lens depth of field sample value;

[0132] The optimal number of shots corresponding to each sample value combination is determined, and data fitting is performed based on each sample value combination and its corresponding optimal number of shots to obtain a depth of field coefficient and a deviation value.

[0133] In some possible implementations, when the second determination unit obtains the depth direction variation amplitude sample value and the lens depth of field sample value and determines the sample value combination, it is specifically used to:

[0134] determining at least two sample objects and at least two sample devices;

[0135] For each sample object and each sample device, a first sample distance and a second sample distance are obtained, a depth direction variation sample value is obtained according to the difference between the first sample distance and the second sample distance, a lens depth of field sample value is obtained according to the lens depth of field of the sample device, and a sample value combination is determined based on a depth direction variation sample value and a lens depth of field sample value, wherein the first sample distance and the second sample distance respectively represent a first distance and a second distance of the sample object relative to the sample device.

[0136] In some possible implementations, when determining the optimal number of shots corresponding to each sample value combination, the second determination unit is specifically configured to:

[0137] For each sample value combination, based on the first sample distance, the second sample distance and the number of samples to be tested, the sample device is controlled to adjust the lens and capture the image to obtain the sample object image of the number of samples to be tested;

[0138] According to the test data corresponding to each number to be tested, the optimal number of shots corresponding to the sample value combination is determined from each number to be tested, wherein the test data includes: the efficiency of fusing the sample object images of the number to be tested to obtain a fused image, and the quality of the fused image.

[0139] In some possible implementations, the imaging unit 603 is specifically used for:

[0140] Determine the number of lens adjustments and lens parameter data corresponding to each lens adjustment based on the first distance, the second distance, and the number of targets;

[0141] According to the number of lens adjustments and the lens parameter data corresponding to each lens adjustment, the control device performs lens adjustment, and an image is captured after each lens adjustment is completed to obtain a target number of target object images.

[0142] In some possible implementations, the lens parameter data includes diopter data; when the imaging unit 603 determines the number of lens adjustments and the lens parameter data corresponding to each lens adjustment based on the first distance, the second distance, and the number of targets, it is specifically configured to:

[0143] determining a number of lens adjustments based on the target number, determining a first diopter based on the first distance, and determining a second diopter based on the second distance;

[0144] An adjustment interval is determined according to the first diopter, the second diopter and the number of lens adjustments, and diopter data corresponding to each lens adjustment is determined according to the first diopter, the second diopter and the adjustment interval.

[0145] For the specific definition of the image processing device, please refer to the definition of the image processing method above, which will not be repeated here. Each unit in the above image processing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above units can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above units.

[0146] See also Figure 7 , Figure 7 : is a schematic diagram of the hardware structure of an image processing device provided in an embodiment of the present application, which may include:

[0147] Processor 701, memory 702 and transceiver 703. The processor 701, memory 702 and transceiver 703 are connected via a bus 704. The memory 702 is used to store instructions, and the processor 701 is used to execute the instructions stored in the memory 702 to implement the steps in the above method.

[0148] The processor 701 is used to execute the instructions stored in the memory 702 to control the transceiver 703 to receive and send signals and complete the steps in the above method. The memory 702 can be integrated in the processor 701 or can be set separately from the processor 701.

[0149] As an implementation, the function of the transceiver 703 may be implemented by a transceiver circuit or a dedicated transceiver chip. The processor 701 may be implemented by a dedicated processing chip, a processing circuit, a processor or a general-purpose chip.

[0150] As another implementation method, it is possible to use a general-purpose computer to implement the image processing device provided in the embodiment of the present application. That is, the program code for implementing the functions of the processor 701 and the transceiver 703 is stored in the memory 702, and the general-purpose processor implements the functions of the processor 701 and the transceiver 703 by executing the code in the memory 702.

[0151] For the concepts, explanations, detailed descriptions and other steps involved in the device and related to the technical solutions provided in the embodiments of the present application, please refer to the description of the method steps performed by the device in the aforementioned method or other embodiments, which will not be repeated here.

[0152] An embodiment of the present application also provides a shooting device, including: a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the shooting device executes the method in the above method embodiment.

[0153] An embodiment of the present application also provides a shooting device, including: a processor, a sending device, an input device, an output device and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the shooting device executes the method in the above method embodiment.

[0154] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the method in the above method embodiment.

[0155] An embodiment of the present application further provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer is enabled to execute a method as described in the above method embodiment.

[0156] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0157] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

[0158] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0159] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire a first distance and a second distance of a target object relative to a device, and a depth direction variation amplitude of the target object; Determining the number of targets according to the depth direction variation of the target object and the depth of field of the lens of the device; Based on the first distance, the second distance, and the target quantity, the device is controlled to perform lens adjustment and image capture to obtain images of the target object quantity.

2. The method according to claim 1, characterized in that The determining the number of targets according to the depth direction variation amplitude of the target object and the depth of field of the lens of the device includes: Obtaining a predetermined depth of field coefficient and a deviation value; A first value is obtained according to the product of the depth of field of the lens of the device and the depth of field coefficient, a second value is obtained according to the ratio of the depth direction change amplitude of the target object to the first value, and the target quantity is determined according to the sum of the second value and the deviation value.

3. The method according to claim 2, characterized in that The method for determining the depth of field coefficient and the deviation value comprises: Acquire depth direction variation sample values ​​and lens depth of field sample values, and determine sample value combinations, each of the sample value combinations including one depth direction variation sample value and one lens depth of field sample value; The optimal number of shots corresponding to each of the sample value combinations is determined, and data fitting is performed based on each of the sample value combinations and their corresponding optimal number of shots to obtain the depth of field coefficient and the deviation value.

4. The method according to claim 3, characterized in that The obtaining of the depth direction variation amplitude sample value and the lens depth of field sample value and determining the sample value combination includes: determining at least two sample objects and at least two sample devices; For each of the sample objects and each of the sample devices, a first sample distance and a second sample distance are obtained, a depth direction variation amplitude sample value is obtained according to a difference between the first sample distance and the second sample distance, a lens depth of field sample value is obtained according to the lens depth of field of the sample device, and a sample value combination is determined based on one of the depth direction variation amplitude sample values ​​and one of the lens depth of field sample values, wherein the first sample distance and the second sample distance respectively represent a first distance and a second distance of the sample object relative to the sample device.

5. The method according to claim 4, characterized in that The determining the optimal number of shots corresponding to each sample value combination includes: For each of the sample value combinations, based on the first sample distance, the second sample distance and the number of samples to be tested, controlling the sample device to adjust the lens and capture images to obtain images of the sample objects of the number of samples to be tested; According to the test data corresponding to each of the quantities to be tested, the optimal number of shots corresponding to the sample value combination is determined from each of the quantities to be tested, wherein the test data includes: the efficiency of fusing the sample object images of the quantity to be tested to obtain a fused image, and the quality of the fused image.

6. The method according to any one of claims 1 to 5, characterized in that The controlling the device to adjust the lens and capture images based on the first distance, the second distance, and the number of targets to obtain the target number of target object images includes: Determine the number of lens adjustments and lens parameter data corresponding to each lens adjustment based on the first distance, the second distance, and the number of targets; According to the lens adjustment times and the lens parameter data corresponding to each lens adjustment, the device is controlled to perform lens adjustment, and an image is captured after each lens adjustment is completed to obtain the target number of target object images.

7. The method according to claim 6, characterized in that The lens parameter data includes diopter data; the determining the number of lens adjustments and the lens parameter data corresponding to each lens adjustment based on the first distance, the second distance and the target quantity includes: determining a lens adjustment number based on the target number, determining a first diopter based on the first distance, and determining a second diopter based on the second distance; An adjustment interval is determined according to the first refractive power, the second refractive power, and the number of lens adjustments, and refractive power data corresponding to each lens adjustment is determined according to the first refractive power, the second refractive power, and the adjustment interval.

8. An image processing device, characterized in that: The device comprises: an acquisition unit, configured to acquire a first distance and a second distance of a target object relative to a device, and a depth direction variation amplitude of the target object; A quantity determination unit, used to determine the number of targets according to the depth direction variation amplitude of the target object and the depth of field of the lens of the device; An imaging unit is used to control the device to adjust the lens and capture images based on the first distance, the second distance and the target number, so as to obtain images of the target objects of the target number.

9. A photographing device, characterized in that: It includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the method as claimed in any one of claims 1 to 7 by executing the instructions stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 7.