Camera calibration method, electronic equipment control method, device and equipment
Through the camera calibration method, the camera configuration parameters are determined and the captured images are obtained, which solves the problem of poor shooting effect after the camera is assembled, realizes the calibration of focus parameters, and improves the shooting effect and clarity of electronic equipment.
Patent Information
- Application Number
- CN202310193500.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2024-08-23
AI Technical Summary
In the existing technology, after the camera is assembled into the electronic device, the shooting effect is poor, resulting in poor shooting effect of the electronic device, and the autofocus parameters do not match the assembly state, affecting the clarity.
A camera calibration method is provided. By determining the camera configuration parameters, the camera is controlled to capture the target image, the captured image is obtained, the calibration parameters are determined, and used to calibrate the autofocus parameters to ensure the camera focusing ability in the complete machine state.
It improves the shooting effect of electronic equipment, enhances the focusing ability of the camera, ensures that the autofocus parameters of the camera in the electronic equipment match the status of the whole machine, and improves the shooting clarity.
Smart Images

Figure CN118540579A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of electronic equipment, and in particular to a camera calibration method, an electronic equipment control method, a device and equipment. Background Art
[0002] At present, module factories will test cameras after producing them to obtain shooting parameters. When the cameras are assembled into electronic devices, the electronic devices will directly call the shooting parameters to shoot, resulting in poor shooting effects of the electronic devices. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a camera calibration method, a control method, a device and a device for an electronic device.
[0004] According to a first aspect of an embodiment of the present disclosure, a camera calibration method is provided, the method comprising:
[0005] Determine camera configuration parameters;
[0006] According to the camera configuration parameters, a camera installed on the electronic device is controlled to shoot a target image to obtain a shot image;
[0007] Calibration parameters are determined according to the captured image, and the calibration parameters are used to calibrate the auto-focus parameters of the camera.
[0008] In some embodiments of the present disclosure, controlling a camera installed on an electronic device to capture a target image according to the camera configuration parameters to obtain a captured image includes:
[0009] Sending the camera configuration parameters to the electronic device to configure the camera;
[0010] A shooting instruction is sent to the electronic device to control the camera to shoot the target image at different distances from the target image to obtain the shot image.
[0011] In some embodiments of the present disclosure, determining calibration parameters according to the captured image includes:
[0012] Obtaining a motor step value of the camera corresponding to the captured image;
[0013] A motor step value of the camera is determined as the calibration parameter.
[0014] In some embodiments of the present disclosure, before determining the calibration parameters according to the captured image, the method further includes:
[0015] Determining a target area in the captured image;
[0016] determining a resolution of the target area;
[0017] According to the resolution of the target area, it is determined whether to determine the calibration parameter according to the captured image.
[0018] In some embodiments of the present disclosure, the target image is a black and white checkerboard, and determining the target area in the captured image includes:
[0019] Determining a target point in the captured image;
[0020] The target area is determined according to the target point.
[0021] In some embodiments of the present disclosure, determining the target point in the captured image includes:
[0022] Determining the center point and diagonal line of the captured image;
[0023] The center point and a point on the diagonal line at a preset distance from the center point are determined as the target point.
[0024] In some embodiments of the present disclosure, each of the target points corresponds to a plurality of the target areas, and determining whether to determine the calibration parameter according to the captured image according to the resolution of the target area includes:
[0025] Determine the weight value corresponding to each target area according to the distance between the boundary line of the black and white grid in each target area and the target point;
[0026] Determining the target point resolution corresponding to each target point according to the weight value corresponding to each target area and the resolution of each target area;
[0027] According to the target point resolution corresponding to each of the target points, it is determined whether to determine the calibration parameter according to the captured image.
[0028] In some embodiments of the present disclosure, there are multiple cameras, and the step of controlling the cameras installed on the electronic device to capture the target image according to the camera configuration parameters to obtain the captured image includes:
[0029] Sending the camera configuration parameters to the electronic device to configure each of the cameras;
[0030] Sending a shooting instruction to the electronic device to control each of the cameras to sequentially shoot the target image at different distances from the target image to obtain a plurality of the shot images;
[0031] The step of determining calibration parameters according to the captured image includes:
[0032] Obtaining a motor step value of each of the cameras corresponding to the captured image;
[0033] The motor step value of each of the cameras is determined as the calibration parameter.
[0034] In some embodiments of the present disclosure, controlling a camera installed on an electronic device to capture a target image according to the camera configuration parameters to obtain a captured image includes:
[0035] Sending the camera configuration parameters to the electronic device to configure the camera;
[0036] The angle of the target image is adjusted, and a shooting instruction is sent to the electronic device to control the camera to shoot the target image at different angles to obtain a shot image.
[0037] In some embodiments of the present disclosure, after determining the calibration parameters according to the captured image, the method further includes:
[0038] Obtaining a temperature value of the camera;
[0039] Comparing the calibration parameters with default auto-focus parameters of the electronic device to obtain a comparison result;
[0040] When the temperature value of the camera is less than a preset temperature value and the comparison result meets the preset requirements, the calibration parameters are written into the electronic device so that the electronic device can calibrate the autofocus parameters of the camera according to the calibration parameters, or, an identifier corresponding to the calibration parameters is determined, and the determined identifier and the calibration parameters are written into the electronic device, and the identifier is used to indicate whether the calibration parameters are valid.
[0041] In some embodiments of the present disclosure, before controlling a camera installed on an electronic device to capture a target image according to the camera configuration parameters to obtain the captured image, the method further includes:
[0042] Moving the electronic device to a calibration station;
[0043] Turn on the light source of the target image.
[0044] In some embodiments of the present disclosure, the camera includes a main camera, an ultra-telephoto camera and / or an ultra-wide-angle camera.
[0045] In some embodiments of the present disclosure, before controlling a camera installed on the electronic device to shoot a reference object according to the camera configuration parameters to obtain a shot image, the method further includes:
[0046] Get the gold label parameters;
[0047] The camera on the electronic device is initially calibrated according to the gold mark parameters.
[0048] According to a second aspect of an embodiment of the present disclosure, a camera calibration device is provided, the device comprising:
[0049] A first determination module is configured to determine camera configuration parameters;
[0050] A first control module is configured to control a camera installed on the electronic device to shoot a target image according to the camera configuration parameters to obtain a shot image;
[0051] The calibration module is configured to determine calibration parameters according to the captured image, wherein the calibration parameters are used to calibrate the autofocus parameters of the camera.
[0052] In some embodiments of the present disclosure, the device further comprises:
[0053] A second determination module is configured to determine a target area in the captured image;
[0054] A third determination module is configured to determine the resolution of the target area;
[0055] The fourth determination module is configured to determine whether to determine the calibration parameter according to the captured image according to the resolution of the target area.
[0056] In some embodiments of the present disclosure, the device further comprises:
[0057] A first acquisition module is configured to acquire a temperature value of the camera;
[0058] A comparison module, configured to compare the calibration parameters with default auto-focus parameters of the electronic device to obtain a comparison result;
[0059] A writing module is configured to write the calibration parameters into the electronic device when the temperature value of the camera is less than a preset temperature value and the comparison result meets the preset requirements, so that the electronic device can calibrate the autofocus parameters of the camera according to the calibration parameters, or to determine an identifier corresponding to the calibration parameters, and write the determined identifier and the calibration parameters into the electronic device, wherein the identifier is used to indicate whether the calibration parameters are valid.
[0060] In some embodiments of the present disclosure, the device further comprises:
[0061] A second control module is configured to move the electronic device to a calibration station;
[0062] The starting module is configured to start the light source of the target image.
[0063] According to a third aspect of an embodiment of the present disclosure, a camera calibration device is provided, the device comprising:
[0064] case;
[0065] A testing unit, the testing unit is disposed in the housing, the testing unit includes a target image, and the testing unit is used to test an autofocus function of a camera installed on the electronic device;
[0066] A control unit, wherein the control unit is arranged in the shell, the control unit is connected to the test unit, and the control unit is configured to determine camera configuration parameters; according to the camera configuration parameters, control a camera installed on the electronic device to shoot a target image to obtain a shot image; according to the shot image, determine calibration parameters, and the calibration parameters are used to calibrate the autofocus parameters of the camera.
[0067] In some embodiments of the present disclosure, the device further includes a display unit, which is disposed on the housing and is used to display the calibration parameters.
[0068] In some embodiments of the present disclosure, the testing unit further includes a calibration station and a light source disposed at the target image and connected to the control unit, the target image is disposed at the calibration station, and the device further includes:
[0069] A clamping portion, the clamping portion is used to clamp the electronic device;
[0070] A conveying part, the conveying part is connected to the housing, the control part and the clamping part, and the conveying part is used to convey the electronic device to the calibration station;
[0071] The control unit is further configured to control the conveying unit to convey the electronic device to the calibration station and turn on the light source of the target image.
[0072] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the method as described above.
[0073] According to a fifth aspect of an embodiment of the present disclosure, a control method of an electronic device is provided, the method comprising:
[0074] Get calibration parameters;
[0075] Determining target auto-focus parameters according to the calibration parameters;
[0076] A shooting action is performed according to the target auto-focus parameter.
[0077] In some embodiments of the present disclosure, determining the target auto-focus parameter according to the calibration parameter includes:
[0078] Comparing the calibration parameters with default auto-focus parameters of the electronic device to obtain a comparison result;
[0079] According to the comparison result, determining the calibration parameter or the default auto-focus parameter as the target auto-focus parameter; or,
[0080] Obtaining an identifier corresponding to the calibration parameter, where the identifier is used to indicate whether the calibration parameter is valid;
[0081] When it is determined according to the identifier that the calibration parameter is valid, determining the calibration parameter to be the target auto-focus parameter;
[0082] When it is determined according to the identifier that the calibration parameter is invalid, the default auto-focus parameter is determined as the target auto-focus parameter.
[0083] According to a sixth aspect of an embodiment of the present disclosure, a control device of an electronic device is provided, the device comprising:
[0084] A second acquisition module is configured to acquire calibration parameters;
[0085] a fifth determination module, configured to determine a target auto-focus parameter according to the calibration parameter;
[0086] The third control module is configured to execute a shooting action according to the target auto-focus parameter.
[0087] According to a seventh aspect of an embodiment of the present disclosure, an electronic device is provided, the electronic device comprising:
[0088] processor;
[0089] a memory for storing instructions executable by the processor;
[0090] The processor is configured to execute the method as described above.
[0091] According to an eighth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, and when instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the method as described above.
[0092] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0093] When calibrating the whole electronic device equipped with a camera, the camera is controlled to shoot the target image according to the camera configuration parameters to obtain a captured image containing the target image, and then the calibration parameters are determined according to the captured image, so as to calibrate the autofocus parameters of the camera in the electronic device. Since the captured image is taken after the camera is installed in the electronic device, the captured image can reflect the whole shooting effect of the electronic device, and the calibration parameters determined by the captured image can calibrate the autofocus parameters of the camera in the whole state. By calibrating the autofocus parameters of the camera, the clarity of the electronic device when shooting is enhanced, thereby improving the shooting effect of the electronic device.
[0094] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0096] Figure 1 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0097] Figure 2 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0098] Figure 3 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0099] Figure 4 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0100] Figure 5 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0101] Figure 6 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0102] Figure 7 is a schematic diagram of capturing an image according to an exemplary embodiment;
[0103] Figure 8 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0104] Fig. 9 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0105] Fig.10 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0106] Fig.11 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0107] Fig.12 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0108] Fig.13 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0109] Fig.14 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0110] Fig.15 is a flowchart of a camera calibration method according to an exemplary embodiment;
[0111] Figure 16-1 is a test result diagram of camera calibration in a whole device state according to an exemplary embodiment;
[0112] Figure 16-2 is a test result diagram of camera calibration in a single state according to an exemplary embodiment;
[0113] Figure 16-3 is a test result diagram showing the camera calibration difference between the whole device and the single device according to an exemplary embodiment;
[0114] Fig.17 is a block diagram of a camera calibration device according to an exemplary embodiment;
[0115] Figure 18-1 is a structural schematic diagram of a camera calibration device according to an exemplary embodiment;
[0116] Figure 18-2 is a structural schematic diagram of a camera calibration device according to an exemplary embodiment;
[0117] Fig.19 is a flowchart of a method for controlling an electronic device according to an exemplary embodiment;
[0118] Fig. 20 is a flowchart of a method for controlling an electronic device according to an exemplary embodiment;
[0119] Fig.21 is a flowchart of a method for controlling an electronic device according to an exemplary embodiment;
[0120] Fig. 22 is a block diagram of an electronic device according to an exemplary embodiment.
[0121] In the figure:
[0122] 1-shell; 2-test part; 3-control part; 4-clamping part; 5-transmission part; 6-display part; 7-rear camera 450*600 test light source assembly; 8-rear camera 320*600 test light source assembly; 9-rear camera macro test assembly; 10-rear camera ultra-wide-angle relay lens assembly; 11-reserved part; 12-front camera 750*570 test light source assembly; 21-carrying part; 22-calibration station; 100-first determination module; 110-first control module; 120-calibration module; 400-electronic device; 402-processing component; 404-memory; 406-power supply component; 408-multimedia component; 410-audio component; 412-input and output interface; 414-sensor component; 416-communication component; 420-processor. DETAILED DESCRIPTION
[0123] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0124] At present, after producing the camera, the module factory will test the camera to obtain the best shooting parameters. In the process of assembling the camera into the electronic device, the camera may be squeezed, resulting in the shooting parameters no longer being the best parameters for shooting. After assembling the camera into the electronic device, the factory will configure the electronic device and directly call the shooting parameters obtained by the module factory test during configuration. Since the shooting parameters are not the best parameters for shooting, and the electronic device still uses the shooting parameters for shooting, the shooting effect of the electronic device is poor.
[0125] In order to solve the above technical problems, the present disclosure provides a camera calibration method. After the factory assembles the camera into the electronic device, the electronic device is calibrated as a whole to improve the shooting effect of the electronic device. The camera in the electronic device is controlled to shoot the target image, and the captured image is obtained, and then the calibration parameters are determined. Since the calibration parameters can calibrate the autofocus parameters of the camera in the whole state, the problem of the camera not matching the autofocus parameters due to assembly is avoided, thereby improving the shooting effect of the electronic device. After the camera is calibrated, even for electronic devices of the same model, their calibration parameters may be different.
[0126] The present disclosure provides a camera calibration method. Figure 1 As shown, the method includes:
[0127] S100: Determine camera configuration parameters.
[0128] S200: According to the camera configuration parameters, control a camera installed on the electronic device to shoot a target image to obtain a shot image.
[0129] S300: Determine calibration parameters according to the captured image, where the calibration parameters are used to calibrate auto-focus parameters of the camera.
[0130] In this embodiment, when the whole-machine calibration is performed on an electronic device equipped with a camera, the camera is controlled to shoot a target image according to the camera configuration parameters to obtain a captured image containing the target image, and then the calibration parameters are determined according to the captured image, so as to calibrate the autofocus parameters of the camera in the electronic device. Since the captured image is taken after the camera is installed in the electronic device, the captured image can reflect the whole-machine shooting effect of the electronic device, and the calibration parameters determined by the captured image can calibrate the autofocus parameters of the camera in the whole-machine state. By calibrating the autofocus parameters of the camera, the clarity of the electronic device when shooting is enhanced, thereby improving the shooting effect of the electronic device.
[0131] Exemplarily, determining the camera configuration parameters in step S100 may be receiving currently input camera configuration parameters, or may be calling stored camera configuration parameters.
[0132] In one embodiment, the camera includes a main camera, an ultra-telephoto camera and / or an ultra-wide-angle camera.
[0133] In this embodiment, since the main camera, the super telephoto camera and / or the super wide-angle camera need to improve the clarity of the image by focusing for objects at different distances during use, the main camera, the super telephoto camera and / or the super wide-angle camera are calibrated in the whole device state, the focusing ability of the camera is enhanced to improve the clarity, thereby improving the shooting effect of the electronic device.
[0134] In one embodiment, if Figure 2 As shown, in step S200, according to the camera configuration parameters, the camera installed on the electronic device is controlled to shoot the target image, and the captured image is determined in the following manner:
[0135] S210: Send camera configuration parameters to the electronic device to configure the camera.
[0136] S220: Send a shooting instruction to the electronic device to control the camera to shoot the target image at different distances from the target image to obtain a shot image.
[0137] In this embodiment, the camera configuration parameters are sent to the electronic device, and the electronic device configures the camera according to the camera configuration parameters so that the calibration parameters after the test correspond to the camera configuration parameters. Since the camera improves the clarity of the image by focusing at different distances. When calibrating the autofocus parameters, a shooting instruction is sent to the electronic device, and the electronic device controls the camera to shoot at different distances from the target image according to the shooting instruction to obtain a shot image. By shooting the target image under the camera configuration parameters to obtain a shot image, the shot image can reflect the shooting effect of the entire electronic device, thereby improving the effectiveness of the calibration parameters.
[0138] Exemplarily, in step S220, the control camera and the target image are respectively photographed at different distances to obtain the captured image. According to the camera configuration parameters, the target image will fill the field of view of the camera and contain 20×15 grids.
[0139] In one embodiment, if Figure 3 As shown, in step S300, the calibration parameters are determined according to the captured image in the following manner:
[0140] S310, obtaining a motor step value of a camera corresponding to the captured image.
[0141] S320: Determine the motor step value of the camera as a calibration parameter.
[0142] In this embodiment, during the process of capturing an image, the motor in the camera controls the lens to move to achieve focus. The motor step value reflects the distance the lens moves, and the motor step value of the camera corresponding to the captured image is obtained and used as a calibration parameter to calibrate the autofocus parameters. By obtaining the motor step value and using it as a calibration parameter, the position of the lens at the current test distance is determined, thereby improving the reliability of the calibration parameters.
[0143] like Figure 4 As shown, before determining the calibration parameters according to the captured image in step S300, the camera calibration method provided by an embodiment of the present disclosure further includes the following steps:
[0144] S230: Determine a target area in the captured image.
[0145] S240: Determine the resolution of the target area.
[0146] S250: Determine whether to determine calibration parameters based on the captured image according to the resolution of the target area.
[0147] In this embodiment, before determining the calibration parameters, it is first determined based on the captured image whether the captured image can meet the requirements. The target area in the captured image is determined. The target area can effectively reflect the focusing ability of the camera, and is also called the region of interest (ROI). Since the resolution can reflect the clarity of the captured image, the resolution of the target area is determined to determine whether the clarity of the captured image can meet the requirements. Based on whether the resolution of the target area meets the requirements, it is determined whether to determine the calibration parameters based on the captured image to avoid determining the motor step values with poor focusing ability as calibration parameters. By determining whether to determine the calibration parameters in a resolution manner, it is avoided to calibrate the autofocus parameters with calibration parameters with low resolution, thereby improving the reliability of the autofocus parameter calibration.
[0148] In one embodiment, if Figure 5 As shown, the target image is a black and white checkerboard, and the target area in the captured image in step S230 is determined by:
[0149] S231: Determine a target point in the captured image.
[0150] S232: Determine the target area according to the target point.
[0151] In this embodiment, a target point in a captured image is determined, and the captured image is marked to determine a general range that can effectively reflect the focusing capability of the camera. A target area is determined based on the target point to determine a specific range that can effectively reflect the focusing capability of the camera. By determining the target area in the form of a target point, an area that effectively reflects the focusing capability of the camera is determined, thereby improving the effectiveness of the calibration parameters.
[0152] In one embodiment, if Figure 6 As shown, the target point in the captured image in step S231 is determined by:
[0153] S2310: Determine the center point and diagonal line of the captured image.
[0154] S2311. Determine the center point and the points on the diagonal line that are a preset distance from the center point as target points.
[0155] In this embodiment, since the area where the diagonal line in the captured image is located can effectively reflect the focusing ability of the camera, after determining the center point and the diagonal line of the captured image, the center point and the point on the diagonal line at a preset distance from the center point are determined as target points. By sampling the points on the diagonal line as target points, the number of target points to be determined is small, thereby reducing the amount of calculation of the resolution. At the same time, by using the points on the diagonal line as target points, the focusing ability of the camera can be effectively reflected, thereby improving the effectiveness of the calibration parameters.
[0156] Exemplarily, the preset distance in step S2311 may be, for example, 0.3 times, 0.5 times, and 0.8 times of the half diagonal.
[0157] For example, Figure 7 As shown, the target area is determined according to the target point in step S232, that is, the grid where the target point is located is determined according to the target point, and four grab frames are set based on the four sides of the grid, and the area where the grab frames are located is used as the target area. Among them, each grab frame is a rectangle, the length of the rectangle is 3 / 4 of the length of the grid side, and the width of the rectangle is 1 / 2 of the length of the grid side. Each rectangle contains one side of a grid, and is divided into two parts of equal area by the sides of the grid. When the distance between the target point and the center point of the grid is too large, the two sides of the grid closest to the target point are grabbed by the grab frame, and the area where the grab frame is located is included in the target area. It can be understood that in addition to determining the grab frame in the above manner, multiple sides of multiple grids closest to the target point can also be grabbed by the grab frame.
[0158] Exemplarily, the resolution of the target area determined in step S240 includes vertical resolution and horizontal resolution. When the angle between the side included in the target area and the horizontal line is less than 45°, the vertical resolution of the target area is calculated. When the angle between the side included in the target area and the horizontal line is greater than 45°, the horizontal resolution of the target area is calculated.
[0159] In one embodiment, if Figure 8 As shown, each target point corresponds to a plurality of target areas. In step S250, whether to determine the calibration parameters according to the captured image is determined according to the resolution of the target area by:
[0160] S251. Determine the weight value corresponding to each target area according to the distance between the boundary line of the black and white grids in each target area and the target point.
[0161] S252: Determine the target point resolution corresponding to each target point according to the weight value corresponding to each target area and the resolution of each target area.
[0162] S253: Determine whether to determine calibration parameters based on the captured image according to the target point resolution corresponding to each target point.
[0163] In this embodiment, since the effectiveness of the resolution of the target area close to the target point is high, while the effectiveness of the resolution of the target area close to the target point is low, the weight value of each target area is determined according to the distance from the target point. According to the weight value and resolution corresponding to each target area, the target point resolution of each target point is determined to determine the clarity of the range where the target point is located. According to the target point resolution, it is judged whether the clarity of the area where the target point is located meets the requirements, and it is determined whether to determine the calibration parameters according to the captured image. By determining the target point resolution in a weighted manner, the effectiveness of the resolution determination is improved, thereby improving the reliability of the calibration parameter determination.
[0164] Exemplarily, in step S251, the weight value corresponding to each target area is determined based on the distance between the dividing line of the black and white grid in each target area and the target point. The distance between the target point and each dividing line is first determined, and then each distance is ratioed with the side length of the grid, and the difference between 1 and the ratio is determined as the weight value of the target area where the corresponding dividing line is located.
[0165] Exemplarily, in step S252, the target point resolution corresponding to each target point is determined according to the weight value corresponding to each target area and the resolution of each target area, and the weight value corresponding to the target area and the resolution of each target area are multiplied, and the vertical resolutions of the target areas calculated are added as the vertical resolution of the corresponding target point, and the horizontal resolutions of the target areas calculated are added as the horizontal resolution of the corresponding target point. The target point resolution includes the vertical resolution of the target point and the horizontal resolution of the target point.
[0166] Exemplarily, in step S253, determining whether to determine the calibration parameters according to the captured image according to the target point resolution corresponding to each target point may be to compare the vertical resolution of the target point with a preset vertical resolution, and to compare the horizontal resolution of the target point with a preset horizontal resolution. When the vertical resolution of the target point is greater than the preset vertical resolution and the horizontal resolution of the target point is greater than the preset horizontal resolution, it is determined that the calibration parameters are determined according to the captured image. When the vertical resolution of the target point is less than or equal to the preset vertical resolution and / or the horizontal resolution of the target point is less than or equal to the preset horizontal resolution, it is determined not to determine the calibration parameters according to the captured image.
[0167] In one embodiment, if Fig. 9 and Fig.10 As shown, there are multiple cameras in the electronic device. In step S200, the camera installed on the electronic device is controlled to shoot the target image according to the camera configuration parameters, and the captured image is determined in the following manner:
[0168] S260: Send camera configuration parameters to the electronic device to configure each camera.
[0169] S270: Send a shooting instruction to the electronic device to control each camera to shoot the target image in sequence at different distances from the target image to obtain a plurality of shot images.
[0170] In step S300, the calibration parameters are determined according to the captured image in the following manner:
[0171] S330, obtaining the motor step value of each camera corresponding to the captured image.
[0172] S340, determining the motor step value of each camera as a calibration parameter.
[0173] In this embodiment, there are multiple cameras in the electronic device, and when shooting is performed by the electronic device, there is switching between the multiple cameras. If the electronic device only calibrates the autofocus parameters of one camera, the focusing effect of other cameras during shooting will be poor. In addition, when the camera is tested in a single state, the test environment may be different, resulting in different test standards for each camera. By testing each camera under the same test environment, the consistency of the camera focus is enhanced, thereby improving the shooting effect of the electronic device.
[0174] Exemplarily, sending a shooting instruction to the electronic device in step S270 to control each camera to sequentially shoot the target image at different distances from the target image is accomplished by sending a shooting instruction to the electronic device so that the electronic device switches different cameras to shoot the target image.
[0175] In one embodiment, if Fig.11 As shown, in step S200, according to the camera configuration parameters, the camera installed on the electronic device is controlled to shoot the target image, and the captured image is determined in the following manner:
[0176] S280: Send the camera configuration parameters to the electronic device to configure the camera.
[0177] S290: Adjust the angle of the target image, and send a shooting instruction to the electronic device to control the camera to shoot the target image at different angles to obtain a shot image.
[0178] In this embodiment, the camera configuration parameters are sent to the electronic device, and the electronic device configures the camera according to the camera configuration parameters so that the calibration parameters after the test correspond to the camera configuration parameters. Since the clarity determined by the image captured by the camera through focusing is different at different angles of the target image. When calibrating the automatic focus parameters, a shooting instruction is sent to the electronic device, and the electronic device controls the camera to capture the target image at different angles according to the shooting instruction to obtain the captured image. By capturing the target image under the camera configuration parameters to obtain the captured image, the captured image can reflect the shooting effect of the entire electronic device, thereby improving the effectiveness of the calibration parameters.
[0179] Exemplarily, adjusting the angle of the target image in step S290 refers to rotating the target image in the horizontal direction. When the target image is rotated in the horizontal direction, the target area will change and affect the calibration parameters, so as to improve the effectiveness of the calibration parameters.
[0180] like Fig.12As shown, after determining the calibration parameters according to the captured image in step S300, the camera calibration method provided by an embodiment of the present disclosure further includes the following steps:
[0181] S400: Obtain the temperature value of the camera.
[0182] S410: Compare the calibration parameters with the default auto-focus parameters of the electronic device to obtain a comparison result.
[0183] S420. When the temperature value of the camera is less than a preset temperature value and the comparison result meets the preset requirements, the calibration parameters are written into the electronic device so that the electronic device can calibrate the autofocus parameters of the camera according to the calibration parameters. Alternatively, an identifier corresponding to the calibration parameters is determined, and the determined identifier and the calibration parameters are written into the electronic device, where the identifier is used to indicate whether the calibration parameters are valid.
[0184] In this embodiment, during the process of automatic focusing, the temperature of the camera will rise, and the temperature value of the camera is obtained. During the process of camera calibration, there may be problems such as light source failure, electronic device failure or calibration parameter determination failure, resulting in unreliable calibration parameters. After determining the calibration parameters, the calibration parameters are compared with the default autofocus parameters of the electronic device to obtain a comparison result. If the temperature value of the camera is too high, it will affect the life and performance of the camera, and the temperature value of the camera needs to be less than the preset temperature value. If the comparison result does not meet the preset conditions, the difference between the calibration parameters of the camera in the whole machine state and the default autofocus parameters of the camera in the single state is large, and the calibration parameters are unreliable. When the temperature value of the camera is less than the preset temperature value and the comparison result meets the preset requirements, the requirements of the camera temperature and the reliability of the calibration parameters can be met, and the calibration parameters are written into the electronic device. By determining whether the temperature of the camera is too high and whether the calibration parameters are reliable according to the temperature value of the camera and the comparison result, it is determined whether to write the calibration parameters into the electronic device to improve the reliability of the camera calibration. Alternatively, according to the comparison result, an identifier corresponding to the calibration parameter is determined, and the determined identifier and calibration parameters are written into the electronic device. After receiving the identifier, the electronic device can determine whether the calibration parameters are valid according to the identifier, thereby avoiding affecting the shooting effect of the electronic device due to invalid calibration parameters and improving the reliability of camera calibration.
[0185] For example, the comparison of the calibration parameters and the auto-focus parameters in step S410 to obtain the comparison result may be to determine the difference between the calibration parameters and the auto-focus parameters and determine the difference as the comparison result, or to determine the ratio between the calibration parameters and the auto-focus parameters and determine the ratio as the comparison result.
[0186] Exemplarily, the preset temperature value in step S420 has a range of [45, 60]°C, for example, 50°C, 53°C or 57°C. When the comparison result is the difference between the calibration parameter and the autofocus parameter, the comparison result meets the preset requirement, which means that the difference between the calibration parameter and the autofocus parameter is within the preset step range. In the calibration parameter and the autofocus parameter, the step value of the motor is represented by the DAC value of the motor, and the preset step range can be, for example, [-80, 80]code.
[0187] Exemplarily, when the temperature value of the camera is greater than or equal to a preset temperature value and / or the comparison result does not meet the preset requirements, the calibration parameters are not written into the electronic device. Alternatively, an identifier corresponding to the calibration parameter is determined, and the determined identifier and the calibration parameter are written into the electronic device. When the temperature value of the camera is less than the preset temperature value and the comparison result meets the preset requirements, the identifier indicates that the calibration parameter is valid. When the temperature value of the camera is greater than or equal to the preset temperature value and / or the comparison result does not meet the preset requirements, the identifier indicates that the calibration parameter is invalid.
[0188] Exemplarily, after obtaining the temperature value of the camera and comparing the calibration parameters with the default autofocus parameters of the electronic device to obtain the comparison result, the calibration parameters may not be written into the electronic device, but the calibration parameters may be displayed to determine the calibration parameters after the camera is calibrated.
[0189] For example, in addition to writing the calibration parameters into the electronic device separately, the calibration parameters and the camera configuration parameters may also be written into the electronic device together by burning.
[0190] Exemplarily, after the calibration parameters are written into the electronic device, the electronic device includes the calibration parameters and the default autofocus parameters. Depending on the configuration, the electronic device can choose to call the calibration parameters or the default autofocus parameters when shooting. Alternatively, after the calibration parameters are written into the electronic device, the calibration parameters are not called, and only the calibration parameters are determined to test the camera.
[0191] like Fig.13 As shown, in step S200, according to the camera configuration parameters, the camera installed on the electronic device is controlled to shoot the target image. Before obtaining the shot image, the camera calibration method provided by an embodiment of the present disclosure further includes the following steps:
[0192] S110, moving the electronic device to a calibration station.
[0193] S120: Turn on the light source of the target image.
[0194] In this embodiment, before controlling the camera to shoot the target image, the electronic device is moved to the calibration station so that the camera is aimed at the target image, and the light source of the target image is turned on to illuminate the target image. By moving the electronic device and turning on the light source, the imaging quality of the captured image is improved, thereby improving the effectiveness of the calibration parameters.
[0195] like Fig.14 As shown, in step S200, according to the camera configuration parameters, the camera installed on the electronic device is controlled to shoot the target image. Before obtaining the shot image, the camera calibration method provided by an embodiment of the present disclosure further includes the following steps:
[0196] S130, obtaining gold label parameters.
[0197] S140: Perform initial calibration on the camera on the electronic device according to the gold standard parameters.
[0198] In this embodiment, the gold standard parameters used by the gold machine to automatically calibrate the electronic device are obtained, the parameters with the best shooting stability of the camera in the electronic device are determined, and the camera is initially calibrated. By initially calibrating the camera with the gold standard parameters, the invalidation of the calibration parameters due to poor stability of the camera during the calibration process is avoided, thereby improving the reliability of the camera calibration.
[0199] For example, the test environment parameters of the camera are as follows: Figure 7 As shown, the target image is a black and white chessboard with an aspect ratio of 4:3 or 16:9, a resolution greater than or equal to 16000 DPI, and a contrast requirement of a brightness difference between black and white grids greater than 80, a grayscale of white grids greater than 180, a grayscale of black grids less than 100, and a side length of black and white grids of 1 / 20 of the long side of the black and white chessboard. The target image is obtained by first obtaining a black and white chessboard that meets the above resolution, contrast, and side length conditions, then rotating the black and white chessboard clockwise by a certain angle as the initial angle (e.g., 8°±1°), and finally cropping the rotated black and white chessboard to form an icon image with an aspect ratio of 4:3 or 16:9. The distance between the camera and the target image is 10cm to 50cm, and the color temperature of the light source is 6000K to 7000K. The illumination of the light source is 800±100lux. The uniformity of the light source is greater than 90%. If the distance between the camera and the target image is adjusted, the illumination of the light source needs to be adaptively adjusted.
[0200] The present disclosure provides a camera calibration method. Fig.15 As shown, the method includes:
[0201] S500, moving the electronic device to a calibration station.
[0202] S510: Turn on the light source of the target image.
[0203] S520: Determine camera configuration parameters.
[0204] S530: Send the camera configuration parameters to the electronic device to configure the camera.
[0205] S540: Send a shooting instruction to the electronic device to control the camera to shoot the target image at different distances from the target image to obtain a shot image.
[0206] S550: Determine a target area in the captured image.
[0207] S560: Determine the resolution of the target area.
[0208] S570: Determine whether to determine calibration parameters based on the captured image according to the resolution of the target area.
[0209] S580: When the calibration parameters are determined according to the captured image, a motor step value of the camera corresponding to the captured image is obtained.
[0210] S590: Determine the motor step value of the camera as a calibration parameter.
[0211] S600: Obtain the temperature value of the camera.
[0212] S610: Compare the calibration parameters with the default auto-focus parameters of the electronic device to obtain a comparison result.
[0213] S620: When the temperature value of the camera is less than the preset temperature value and the comparison result meets the preset requirement, write the calibration parameters into the electronic device, so that the electronic device can calibrate the autofocus parameters of the camera according to the calibration parameters.
[0214] In this embodiment, the electronic device is moved to the calibration station, and the light source of the target image is turned on to provide a test environment for camera calibration. The camera configuration parameters are determined and sent to the electronic device to configure the camera so that the camera shoots the target image under the camera configuration parameters. A shooting instruction is sent to the electronic device to control the camera to shoot the target image at different distances to obtain the captured image under the camera configuration parameters. The target area in the captured image is determined, and the resolution in the target area is determined to determine whether to determine the calibration parameters based on the captured image. When the calibration parameters are determined based on the captured image, the motor step value of the camera is obtained and used as the calibration parameter to determine the position of the lens at the current test distance. The temperature value of the camera and the comparison result of the calibration parameters and the autofocus parameters are obtained. When both meet the conditions, the calibration data is valid and reliable, and the calibration parameters are written into the electronic device. By calibrating the camera in the electronic device in the whole machine state, the clarity of the electronic device when shooting is enhanced, thereby improving the shooting effect of the electronic device.
[0215] For example, Figure 16-1 , Figure 16-2 and Figure 16-3 As shown in the figure, the horizontal axis represents the DAC value of the motor, and the vertical axis represents the sample size of the tested camera. It can be seen from the figure that by calibrating the camera of the electronic device, the deviation of the DAC value of the motor in the whole state and the single state of the camera can be eliminated, and the eliminated deviation is between 50 and 85 codes. By eliminating the deviation, the picture taken by the camera in the whole state can be made clearer, thereby improving the shooting effect of the electronic device.
[0216] In an exemplary embodiment, a camera calibration device is provided, and the camera calibration device is used to implement the above method. Fig.17 As shown, the control device may include a first determination module 100, a first control module 110 and a calibration module 120, wherein, in the process of implementing the above method,
[0217] The first determination module 100 is configured to determine camera configuration parameters.
[0218] The first control module 110 is configured to control a camera installed on the electronic device to shoot a target image according to camera configuration parameters to obtain a shot image.
[0219] The calibration module 120 is configured to determine calibration parameters according to the captured images, and the calibration parameters are used to calibrate the auto-focus parameters of the camera.
[0220] In an exemplary embodiment, a camera calibration device is provided, in which a first control module 110 is configured to:
[0221] The camera configuration parameters are sent to the electronic device to configure the camera.
[0222] A shooting instruction is sent to the electronic device to control the camera to shoot the target image at different distances from the target image to obtain the shot image.
[0223] In an exemplary embodiment, a camera calibration device is provided, in which a calibration module 120 is configured to:
[0224] Gets the motor step value of the camera corresponding to the captured image.
[0225] The motor step value of the camera is determined as a calibration parameter.
[0226] In an exemplary embodiment, a camera calibration device is provided, the device further comprising:
[0227] The second determining module is configured to determine a target area in the captured image.
[0228] The third determination module is configured to determine the resolution of the target area.
[0229] The fourth determination module is configured to determine whether to determine the calibration parameters according to the captured image according to the resolution of the target area.
[0230] In an exemplary embodiment, a camera calibration device is provided, wherein the target image is a black and white checkerboard, and in the device, the second determination module is configured to:
[0231] Determine the target point in the captured image.
[0232] Based on the target point, determine the target area.
[0233] In an exemplary embodiment, a camera calibration device is provided, in which the second determination module is configured to:
[0234] Determine the center point and diagonal of the captured image.
[0235] The center point and the points on the diagonal line at a preset distance from the center point are determined as target points.
[0236] In an exemplary embodiment, a camera calibration device is provided, wherein each target point corresponds to a plurality of target areas. In the device, the second determination module is configured to:
[0237] The weight value corresponding to each target area is determined according to the distance between the boundary line of the black and white grids in each target area and the target point.
[0238] The target point resolution corresponding to each target point is determined according to the weight value corresponding to each target area and the resolution of each target area.
[0239] According to the target point resolution corresponding to each target point, it is determined whether to determine the calibration parameters according to the captured image.
[0240] In an exemplary embodiment, a camera calibration device is provided, the device further comprising:
[0241] The first acquisition module is configured to acquire a temperature value of the camera.
[0242] The comparison module is configured to compare the calibration parameters with the default auto-focus parameters of the electronic device to obtain a comparison result.
[0243] The writing module is configured to write the calibration parameters into the electronic device when the temperature value of the camera is less than the preset temperature value and the comparison result meets the preset requirements, so that the electronic device can calibrate the autofocus parameters of the camera according to the calibration parameters, or determine the identifier corresponding to the calibration parameter, and write the determined identifier and the calibration parameter into the electronic device, the identifier is used to indicate whether the calibration parameter is valid.
[0244] In an exemplary embodiment, a camera calibration device is provided, the device further comprising:
[0245] The second control module is configured to move the electronic device to a calibration station.
[0246] The starting module is configured to turn on the light source of the target image.
[0247] The present disclosure provides a camera calibration device, such as Figure 18-1 and Figure 18-2 As shown, the device includes a shell 1, a test unit 2 and a control unit 3. The test unit 2 is arranged in the shell 1, including a bearing unit 21, and a target image (not shown in the figure) is arranged on the bearing unit 21. The test unit 2 is used to test a camera installed on an electronic device. The control unit 3 is arranged in the shell 1, connected to the test unit 2, and is configured to determine the camera configuration parameters; according to the camera configuration parameters, control the camera installed on the electronic device to shoot the target image to obtain a captured image; and determine the calibration parameters according to the captured image. The calibration parameters are used to calibrate the autofocus parameters of the camera. The autofocus parameters of the camera that need to be calibrated refer to the autofocus parameters in the shooting parameters obtained by the module factory test (that is, the default autofocus parameters of the electronic device).
[0248] In one embodiment, the testing unit 2 further includes a calibration station 22 and a light source (not shown in the figure) arranged at the target image and connected to the control unit 3, and the target image is arranged on the carrying portion 21 in the calibration station 22. The camera calibration device also includes a clamping portion 4 and a conveying portion 5. The clamping portion 4 is used to clamp the electronic device, and the clamping portion 4 can be, for example, a pneumatic clamp. The conveying portion 5 is connected to the housing 1, the control unit 3 and the clamping portion 4, and is used to convey the electronic device to the calibration station 22, and the transmission portion 5 can be, for example, an electric guide rail. After the conveying portion 5 conveys the electronic device to the calibration station 22, the camera of the electronic device faces the target image. The control unit 3 is also configured to control the conveying portion 5 to convey the electronic device to the calibration station 22, and turn on the light source of the target image.
[0249] In one embodiment, the camera calibration device further includes a display unit 6. The display unit 6 is disposed on the housing 1 and is used to display calibration parameters.
[0250] In one embodiment, the camera calibration device further includes a component part. The component part is arranged in the housing 1, and includes a rear camera 450*600 test light source component 7, a rear camera 320*600 test light source component 8, a rear camera macro test component 9, a rear camera ultra-wide angle relay lens component 10, and a front camera 750*570 test light source component 12. The rear camera 450*600 test light source component 7, the rear camera 320*600 test light source component 8, the rear camera macro test component 9, and the rear camera ultra-wide angle relay lens component 10 are used to test the rear camera of the electronic device, and the front camera 750*570 test light source component 12 is used to test the rear camera of the electronic device.
[0251] In one embodiment, the camera calibration device further includes a reserved portion 11. The reserved portion 11 is located in the housing 1 and is used to reserve space for infrared dark box testing.
[0252] Exemplarily, the camera calibration device further includes a communication unit (not shown in the figure). The communication unit is arranged in the housing 1, connected to the control unit 3, and is used to transmit information with the electronic device. The information transmission method can be a wired connection method or a wireless connection method. The wired connection method can be, for example, connected through a data interface of the electronic device. The wireless connection method can be, for example, connected through wireless fidelity (Wi-Fi), Bluetooth, etc.
[0253] It is understandable that the camera calibration method in the above embodiments can be performed by the above camera calibration device or other devices with the same function. For example, the target image can be manually set, the target image can be photographed by an electronic device, and the calibration parameters can be calculated and written into the electronic device.
[0254] In an exemplary embodiment, a non-temporary computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a control unit of the camera calibration device to complete the above method. For example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, and an optical data storage terminal. When the instructions in the storage medium are executed by a processor of the terminal, the terminal is enabled to execute the method shown in the above embodiment.
[0255] The present disclosure provides a method for controlling an electronic device. Fig.19 As shown, the method includes:
[0256] S700: Obtain calibration parameters.
[0257] S800: Determine target auto-focus parameters according to calibration parameters.
[0258] S900: Execute a shooting action according to the target auto-focus parameter.
[0259] In this embodiment, when shooting through the electronic device, the calibration parameters after the whole device is calibrated are obtained, and the calibration parameters can be determined by the camera calibration method as described above. According to the calibration parameters, the target autofocus parameters required for shooting are determined, and the autofocus parameters that achieve the best shooting effect are determined. According to the target autofocus parameters, the shooting action is performed, thereby improving the shooting effect of the electronic device.
[0260] Exemplarily, determining the target auto-focus parameter according to the calibration parameter in step S800 refers to determining the motor step value in the target auto-focus parameter according to the motor step value in the calibration parameter.
[0261] In one embodiment, if Fig. 20 and Fig.21 As shown, in step S800, the target auto-focus parameters are determined according to the calibration parameters in the following manner:
[0262] S810: Compare the calibration parameters with the default auto-focus parameters of the electronic device to obtain a comparison result.
[0263] S820: According to the comparison result, determine the calibration parameter or the default auto-focus parameter as the target auto-focus parameter. Or,
[0264] S830: Obtain an identifier corresponding to the calibration parameter, where the identifier is used to indicate whether the calibration parameter is valid.
[0265] S840: When it is determined according to the identifier that the calibration parameter is valid, determine the calibration parameter as a target auto-focus parameter.
[0266] S850: When it is determined according to the identifier that the calibration parameter is invalid, determine the default auto-focus parameter as the target auto-focus parameter.
[0267] In this embodiment, during the camera calibration process, there may be problems such as light source failure, electronic device failure, or calibration parameter determination failure, resulting in unreliable calibration parameters. After receiving the calibration parameters, the electronic device compares the calibration parameters with the default autofocus parameters to obtain a comparison result. According to the comparison result, the difference between the calibration parameters of the camera in the whole machine state and the autofocus parameters of the camera in the single state can be determined to determine whether the calibration parameters are reliable. By determining whether the calibration parameters are reliable, it is determined that the calibration parameters or the default autofocus parameters are determined as the target autofocus parameters, thereby improving the shooting effect of the electronic device. Alternatively, an identifier corresponding to the calibration parameter is obtained to determine whether the calibration parameter is valid. When the calibration parameter is valid, the calibration parameter is determined to be the target autofocus parameter, and when the calibration parameter is invalid, the default autofocus parameter is determined to be the target autofocus parameter, thereby improving the shooting effect of the electronic device.
[0268] Exemplarily, the comparison of the calibration parameters with the default autofocus parameters of the electronic device in step S810 to obtain the comparison result may be to determine the difference between the calibration parameters and the default autofocus parameters, and determine the difference as the comparison result. Alternatively, the comparison may be to determine the ratio of the calibration parameters to the default autofocus parameters, and determine the ratio as the comparison result.
[0269] In one embodiment, in step S820, determining the calibration parameter or the default auto-focus parameter as the target auto-focus parameter according to the comparison result is determined in the following manner:
[0270] When the comparison result is within the preset range, the calibration parameter is determined as the target auto-focus parameter.
[0271] When the comparison result is outside the preset range, the default auto-focus parameter is determined as the target auto-focus parameter.
[0272] In this embodiment, when the comparison result is within the preset range, the calibration parameter is slightly different from the default autofocus parameter, and the effective calibration parameter is determined as the target autofocus parameter. When the comparison result is outside the preset range, the calibration parameter is significantly different from the default autofocus parameter, and the default autofocus parameter is determined as the target autofocus parameter. By determining whether the calibration parameter is reliable based on the comparison result, and then determining the target autofocus parameter, the shooting effect of the electronic device is improved.
[0273] Exemplarily, whether the calibration parameter is valid is determined according to the flag, for example, when the flag is 0, it is determined that the calibration parameter is valid, and when the flag is 1, it is determined that the calibration parameter is invalid.
[0274] In an exemplary embodiment, a control device of an electronic device is provided, and the control device of the electronic device is used to implement the above method. The control device may include an acquisition module, a third determination module and a third control module, wherein, in the process of implementing the above method,
[0275] The second acquisition module is configured to acquire calibration parameters.
[0276] The fifth determination module is configured to determine the target auto-focus parameters according to the calibration parameters.
[0277] The third control module is configured to execute a shooting action according to the target auto-focus parameter.
[0278] In an exemplary embodiment, a control device of an electronic device is provided, in which a fifth determining module is configured to:
[0279] The calibration parameters are compared with default autofocus parameters of the electronic device to obtain a comparison result.
[0280] According to the comparison result, the calibration parameters or the default autofocus parameters are determined as the target autofocus parameters. Or,
[0281] Get the flag corresponding to the calibration parameter, which is used to indicate whether the calibration parameter is valid.
[0282] When it is determined according to the identifier that the calibration parameter is valid, the calibration parameter is determined to be a target auto-focus parameter.
[0283] When it is determined according to the identifier that the calibration parameter is invalid, the default auto-focus parameter is determined as the target auto-focus parameter.
[0284] In an exemplary embodiment, an electronic device is provided, and the electronic device is, for example, a mobile phone, a laptop computer, a tablet computer, a wearable device, etc.
[0285] refer to Fig. 22 As shown, electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0286] The processing component 402 generally controls the overall operation of the electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0287] The memory 404 is configured to store various types of data to support operations on the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0288] The power supply component 406 provides power to the various components of the electronic device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 400.
[0289] The multimedia component 408 includes a screen that provides an output interface between the electronic device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera module and / or a rear camera module. When the electronic device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera module and / or the rear camera module may receive external multimedia data. Each front camera module and the rear camera module may be a fixed optical lens system or have a focal length and optical zoom capability.
[0290] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the electronic device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0291] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0292] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, the orientation or acceleration / deceleration of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0293] The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other terminals. The electronic device 400 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0294] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing terminals (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-described methods.
[0295] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the above instructions can be executed by the processor 420 of the electronic device 400 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, and an optical data storage terminal. When the instructions in the storage medium are executed by the processor of the terminal, the terminal is enabled to perform the method shown in the above embodiment.
[0296] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0297] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0298] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A camera calibration method, characterized in that: The method comprises: Determine camera configuration parameters; According to the camera configuration parameters, a camera installed on the electronic device is controlled to shoot a target image to obtain a shot image; Calibration parameters are determined according to the captured image, and the calibration parameters are used to calibrate the auto-focus parameters of the camera.
2. The camera calibration method according to claim 1, characterized in that: The method of controlling a camera installed on the electronic device to shoot a target image according to the camera configuration parameters to obtain a shot image includes: Sending the camera configuration parameters to the electronic device to configure the camera; A shooting instruction is sent to the electronic device to control the camera to shoot the target image at different distances from the target image to obtain the shot image.
3. The camera calibration method according to claim 1, characterized in that: The step of determining calibration parameters according to the captured image includes: Obtaining a motor step value of the camera corresponding to the captured image; A motor step value of the camera is determined as the calibration parameter.
4. The camera calibration method according to claim 1, characterized in that: Before determining the calibration parameters according to the captured image, the method further includes: Determining a target area in the captured image; determining a resolution of the target area; According to the resolution of the target area, it is determined whether to determine the calibration parameter according to the captured image.
5. The camera calibration method according to claim 4, characterized in that: The target image is a black and white checkerboard, and determining the target area in the captured image includes: Determining a target point in the captured image; The target area is determined according to the target point.
6. The camera calibration method according to claim 5, characterized in that: The determining of the target point in the captured image comprises: Determining the center point and diagonal line of the captured image; The center point and a point on the diagonal line at a preset distance from the center point are determined as the target point.
7. The camera calibration method according to claim 5, characterized in that: Each of the target points corresponds to a plurality of the target areas, and determining whether to determine the calibration parameters according to the captured image according to the resolution of the target area includes: Determine the weight value corresponding to each target area according to the distance between the boundary line of the black and white grid in each target area and the target point; Determining the target point resolution corresponding to each target point according to the weight value corresponding to each target area and the resolution of each target area; According to the target point resolution corresponding to each of the target points, it is determined whether to determine the calibration parameter according to the captured image.
8. The camera calibration method according to claim 1, characterized in that: The camera is multiple, and the camera installed on the electronic device is controlled to shoot the target image according to the camera configuration parameters to obtain the shot image, including: Sending the camera configuration parameters to the electronic device to configure each of the cameras; Sending a shooting instruction to the electronic device to control each of the cameras to sequentially shoot the target image at different distances from the target image to obtain a plurality of the shot images; The step of determining calibration parameters according to the captured image includes: Obtaining a motor step value of each of the cameras corresponding to the captured image; The motor step value of each of the cameras is determined as the calibration parameter.
9. The camera calibration method according to claim 1, characterized in that: The method of controlling a camera installed on the electronic device to shoot a target image according to the camera configuration parameters to obtain a shot image includes: Sending the camera configuration parameters to the electronic device to configure the camera; The angle of the target image is adjusted, and a shooting instruction is sent to the electronic device to control the camera to shoot the target image at different angles to obtain a shot image.
10. The camera calibration method according to claim 1, characterized in that: After determining the calibration parameters according to the captured image, the method further includes: Obtaining a temperature value of the camera; Comparing the calibration parameters with default auto-focus parameters of the electronic device to obtain a comparison result; When the temperature value of the camera is less than a preset temperature value and the comparison result meets the preset requirements, the calibration parameters are written into the electronic device so that the electronic device can calibrate the autofocus parameters of the camera according to the calibration parameters, or, an identifier corresponding to the calibration parameters is determined, and the determined identifier and the calibration parameters are written into the electronic device, and the identifier is used to indicate whether the calibration parameters are valid.
11. The camera calibration method according to any one of claims 1 to 10, characterized in that: Before controlling the camera installed on the electronic device to shoot the target image according to the camera configuration parameters to obtain the shot image, the method further includes: Moving the electronic device to a calibration station; Turn on the light source of the target image.
12. The camera calibration method according to any one of claims 1 to 10, characterized in that: The camera includes a main camera, an ultra-telephoto camera and / or an ultra-wide-angle camera.
13. The camera calibration method according to any one of claims 1 to 10, characterized in that: Before controlling the camera installed on the electronic device to shoot the reference object according to the camera configuration parameters to obtain the shot image, the method further includes: Get the gold label parameters; The camera on the electronic device is initially calibrated according to the gold mark parameters.
14. A camera calibration device, characterized in that: The device comprises: A first determination module is configured to determine camera configuration parameters; A first control module is configured to control a camera installed on the electronic device to shoot a target image according to the camera configuration parameters to obtain a shot image; The calibration module is configured to determine calibration parameters according to the captured image, and the calibration parameters are used to calibrate the autofocus parameters of the camera.
15. The camera calibration device according to claim 14, characterized in that: The device also includes: A second determination module is configured to determine a target area in the captured image; A third determination module is configured to determine the resolution of the target area; The fourth determination module is configured to determine whether to determine the calibration parameter according to the captured image according to the resolution of the target area.
16. The camera calibration device according to claim 14, characterized in that: The device also includes: A first acquisition module is configured to acquire a temperature value of the camera; A comparison module, configured to compare the calibration parameters with default auto-focus parameters of the electronic device to obtain a comparison result; A writing module is configured to write the calibration parameters into the electronic device when the temperature value of the camera is less than a preset temperature value and the comparison result meets the preset requirements, so that the electronic device can calibrate the autofocus parameters of the camera according to the calibration parameters, or to determine an identifier corresponding to the calibration parameters, and write the determined identifier and the calibration parameters into the electronic device, wherein the identifier is used to indicate whether the calibration parameters are valid.
17. The camera calibration device according to any one of claims 14 to 16, characterized in that: The device also includes: A second control module is configured to move the electronic device to a calibration station; The starting module is configured to start the light source of the target image.
18. A camera calibration device, characterized in that: The device comprises: case; A testing unit, the testing unit is disposed in the housing, the testing unit includes a target image, and the testing unit is used to test an autofocus function of a camera installed on the electronic device; A control unit, wherein the control unit is arranged in the shell, the control unit is connected to the test unit, and the control unit is configured to determine camera configuration parameters; according to the camera configuration parameters, control a camera installed on the electronic device to shoot a target image to obtain a shot image; according to the shot image, determine calibration parameters, and the calibration parameters are used to calibrate the autofocus parameters of the camera.
19. The camera calibration device according to claim 18, characterized in that: The device further comprises a display unit, which is arranged on the housing and is used to display the calibration parameters.
20. The camera calibration device according to claim 18 or 19, characterized in that: The testing unit further includes a calibration station and a light source disposed at the target image and connected to the control unit, the target image being disposed at the calibration station, and the device further includes: A clamping portion, the clamping portion is used to clamp the electronic device; A conveying part, the conveying part is connected to the housing, the control part and the clamping part, and the conveying part is used to convey the electronic device to the calibration station; The control unit is further configured to control the conveying unit to convey the electronic device to the calibration station and turn on the light source of the target image.
21. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the method according to any one of claims 1 to 13.
22. A method for controlling an electronic device, characterized in that: The method comprises: Get calibration parameters; Determining target auto-focus parameters according to the calibration parameters; A shooting action is performed according to the target auto-focus parameter.
23. The control method of the electronic device according to claim 22, characterized in that: Determining target auto-focus parameters according to the calibration parameters includes: Comparing the calibration parameters with default auto-focus parameters of the electronic device to obtain a comparison result; According to the comparison result, determining the calibration parameter or the default auto-focus parameter as the target auto-focus parameter; or, Obtaining an identifier corresponding to the calibration parameter, where the identifier is used to indicate whether the calibration parameter is valid; When it is determined according to the identifier that the calibration parameter is valid, determining the calibration parameter to be the target auto-focus parameter; When it is determined according to the identifier that the calibration parameter is invalid, the default auto-focus parameter is determined as the target auto-focus parameter.
24. A control device for an electronic device, characterized in that: The device comprises: A second acquisition module is configured to acquire calibration parameters; a fifth determination module, configured to determine a target auto-focus parameter according to the calibration parameter; The third control module is configured to execute a shooting action according to the target auto-focus parameter.
25. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the method as claimed in any one of claims 22 or 23.
26. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of the terminal, the terminal is enabled to execute the method as claimed in any one of claims 22 or 23.
