Image acquisition parameter adjustment method, comprehensive test card, device and electronic equipment
By using a comprehensive test card and an automated adjustment method, the process of adjusting image acquisition parameters is simplified, solving the problem of low efficiency in multi-card adjustment in traditional methods and achieving more efficient parameter adjustment.
Patent Information
- Application Number
- CN202210819683.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-13
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-07-13
AI Technical Summary
Traditional methods for adjusting image acquisition parameters require the use of various specialized test cards, resulting in low adjustment efficiency. This is especially difficult and time-consuming for non-professionals.
A comprehensive test chart is used, which includes reference objects for adjusting the focal length and other image acquisition parameters. By identifying the position information of these objects in the image, the focal length and other parameters are automatically adjusted, reducing the frequency of test chart replacement.
It simplifies the process of adjusting image acquisition parameters, reduces difficulty, saves time, and improves adjustment efficiency.
Smart Images

Figure CN115170426B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image technology, and in particular to an image acquisition parameter adjustment method, a comprehensive test card, a device, and an electronic device. Background Technology
[0002] With the development of imaging technology, image acquisition parameter adjustment techniques have emerged. The quality of image acquisition parameters determines the quality of the image. Traditional methods for adjusting image acquisition parameters involve using specialized test charts for each parameter, such as using a grayscale test chart to adjust color saturation and a distortion test chart to adjust image distortion.
[0003] However, there are many types of image acquisition parameters. Using a special test card for each type of image acquisition parameter to adjust the image acquisition parameters is not only difficult for non-professionals, but also takes a long time and is inefficient. Summary of the Invention
[0004] Therefore, it is necessary to provide an image acquisition parameter adjustment method, apparatus, electronic device, and computer-readable storage medium that can improve adjustment efficiency in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a method for adjusting image acquisition parameters. The method includes:
[0006] An initial comprehensive test image is obtained by acquiring images of a comprehensive test card using an image acquisition device; the comprehensive test card is provided with a first adjustment reference object and at least one second adjustment reference object; the first adjustment reference object is used to adjust the focal length parameter; each second adjustment reference object is used to adjust the corresponding image acquisition parameter;
[0007] Identify the position information of the first object image corresponding to the first adjustment reference object in the initial comprehensive test map, and adjust the focal length parameter based on the position information;
[0008] Based on the adjusted focal length parameters, images of the comprehensive test card are acquired to obtain the target comprehensive test image;
[0009] When adjusting the image acquisition parameters corresponding to each of the second adjustment reference objects, the second object image corresponding to the second adjustment reference object in the target comprehensive test map is identified;
[0010] The corresponding image acquisition parameters are adjusted based on the image of the second object.
[0011] In one embodiment, the location information includes the coordinates of the first object image in the initial integrated test map;
[0012] The adjustment of focal length parameters based on the location information includes:
[0013] Based on the coordinates, the focal length parameter of the image acquisition device is adjusted so that the image acquisition device can focus on the first adjustment reference object.
[0014] In one embodiment, adjusting the focal length parameter of the image acquisition device based on the coordinates so that the image acquisition device focuses on the first adjustment reference object includes:
[0015] Based on the coordinates, the focal length parameters of the image acquisition device are gradually adjusted multiple times, and the comprehensive test card is image acquired based on the focal length parameters adjusted each time, so as to obtain candidate images after multiple focal length adjustments;
[0016] Calculate the image sharpness of the first adjustment reference object in each of the candidate images;
[0017] The focal length parameter corresponding to the candidate image with the highest sharpness is determined as the focal length parameter after focusing on the first adjusted reference object.
[0018] In one embodiment, the first adjustment reference object is a plurality of reference patterns of different shapes and with sharpness greater than a sharpness threshold;
[0019] The step of calculating the sharpness of the image corresponding to the first adjustment reference object in each of the candidate images includes:
[0020] For each candidate image, calculate the edge gradient of each reference pattern in the candidate image;
[0021] The sharpness of the image corresponding to each of the reference patterns in the candidate image is determined based on the edge gradient.
[0022] In one embodiment, the adjustment of the corresponding image acquisition parameters based on the second object image includes:
[0023] Based on the differences in corresponding image acquisition parameters between the second object image and the second adjustment reference object in the comprehensive test card, a correction matrix for the image acquisition parameters is determined;
[0024] The image acquisition parameters are adjusted based on the correction matrix.
[0025] In one embodiment, the at least one second adjustment reference object includes a white balance adjustment color block; the second object image includes a white balance color block map in the target comprehensive test image;
[0026] The step of determining the correction matrix for the image acquisition parameters based on the difference between the second object image and the second adjustment reference object in the comprehensive test card in the corresponding image acquisition parameters includes:
[0027] Determine the first color average value of the pixels within the central region of the white balance color patch image;
[0028] Determine the average second color value of the pixels within the central area of the white balance adjustment color block in the comprehensive test card;
[0029] A white balance correction matrix is determined based on the difference between the first color average value and the second color average value.
[0030] In one embodiment, the at least one second adjustment reference object includes a plurality of color correction color patches; the second object image includes a plurality of color correction color patch images in the target comprehensive test image;
[0031] The step of determining the correction matrix for the image acquisition parameters based on the difference between the second object image and the second adjustment reference object in the comprehensive test card in the corresponding image acquisition parameters includes:
[0032] Determine the color values of multiple color correction color swatches separately;
[0033] The color values of the plurality of color correction color block images are compared with the color values of the corresponding color correction color blocks in the comprehensive test card.
[0034] A color correction matrix for color parameters is generated based on the difference comparison results.
[0035] Secondly, this application also provides a comprehensive test card, comprising: a card body; a first adjustment reference object and at least one second adjustment reference object are disposed on the surface of the card body; the first adjustment reference object is a reference object used for adjusting the focal length parameter.
[0036] In one embodiment, the first adjustment reference object includes multiple reference patterns of different shapes with sharpness greater than a sharpness threshold; the second adjustment reference object includes at least one of white balance adjustment color blocks and color correction color blocks.
[0037] In one embodiment, the comprehensive test card further includes an identification code and a blank area; the identification code is used to identify the identity information of the comprehensive test card; the blank area is used to fill in target information, the target information representing the information to be filled in.
[0038] Thirdly, this application also provides an image acquisition parameter adjustment device. The device includes:
[0039] The acquisition module is used to acquire an initial comprehensive test image obtained by the image acquisition device from the comprehensive test card; the comprehensive test card is provided with a first adjustment reference object and at least one second adjustment reference object; the first adjustment reference object is used to adjust the focal length parameter; each second adjustment reference object is used to adjust the corresponding image acquisition parameter;
[0040] The identification module is used to identify the position information of the first object image corresponding to the first adjustment reference object in the initial comprehensive test map, and to adjust the focal length parameter based on the position information; and to acquire an image of the comprehensive test card based on the adjusted focal length parameter to obtain the target comprehensive test map.
[0041] The adjustment module is used to identify the second object image corresponding to the second adjustment reference object in the target comprehensive test map when adjusting the image acquisition parameters corresponding to each second adjustment reference object; and to adjust the corresponding image acquisition parameters based on the second object image.
[0042] Fourthly, this application also provides an electronic device. The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.
[0043] Fifthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.
[0044] The aforementioned image acquisition parameter adjustment method, integrated test card, device, electronic device, and storage medium acquire an initial integrated test image obtained by the image acquisition device acquiring images from the integrated test card. The integrated test card includes a first adjustment reference object and at least one second adjustment reference object. The first adjustment reference object is used to adjust the focal length parameter. Each second adjustment reference object is used to adjust the corresponding image acquisition parameter. The position information of the first object image corresponding to the first adjustment reference object in the initial integrated test image is identified, and the focal length parameter is adjusted based on the position information. Based on the adjusted focal length parameter, the integrated test card is image acquired to obtain a target integrated test image. When adjusting the image acquisition parameters corresponding to each second adjustment reference object, the second object image corresponding to the second adjustment reference object in the target integrated test image is identified. Based on the second object image, the corresponding image acquisition parameters are adjusted. This application designs an integrated test card including different adjustment reference objects and proposes an image acquisition parameter adjustment method based on this integrated test card. Specifically, the focal length parameter of the image acquisition device is adjusted using the first adjustment reference object, and other image acquisition parameters besides the focal length parameter are adjusted using the second adjustment reference objects. Furthermore, by using a single comprehensive test card to adjust multiple image acquisition parameters, the frequent replacement of test cards for different image acquisition parameters is avoided. This not only reduces the difficulty of adjusting image acquisition parameters but also saves time spent manually adjusting them, thus improving the efficiency of adjusting image acquisition parameters. Attached Figure Description
[0045] Figure 1 This is an application environment diagram of an image acquisition parameter adjustment method in one embodiment;
[0046] Figure 2 This is a flowchart illustrating an image acquisition parameter adjustment method in one embodiment;
[0047] Figure 3 This is a schematic diagram of a comprehensive test card in one embodiment;
[0048] Figure 4 This is a structural block diagram of an image acquisition parameter adjustment device in one embodiment;
[0049] Figure 5 This is a structural block diagram of the identification module in one embodiment;
[0050] Figure 6 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0053] The image acquisition parameter adjustment method provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown. For example... Figure 1 As shown, the image acquisition device 101 acquires images from the integrated test card 102, and sends the acquired images to the electronic device 103. The electronic device 103 analyzes and processes the images sent by the image acquisition device 101 and controls the image acquisition device 101 to adjust the image acquisition parameters.
[0054] Specifically, electronic device 103 acquires the initial comprehensive test image obtained by image acquisition device 101 from the comprehensive test card 102; electronic device 103 identifies the position information of the first object image corresponding to the first adjustment reference object in the initial comprehensive test image, and controls image acquisition device 101 to adjust the focal length parameter based on the position information; image acquisition device 101 acquires images of the comprehensive test card based on the adjusted focal length parameter to obtain the target comprehensive test image; when adjusting the image acquisition parameters corresponding to each second adjustment reference object, electronic device 102 identifies the second object image corresponding to the second adjustment reference object in the target comprehensive test image; image acquisition device 101 adjusts the corresponding image acquisition parameters based on the second object image.
[0055] It should be noted that the electronic device 103 can be independent of the image acquisition device 101 or integrated into the image acquisition device 101. This embodiment does not limit this.
[0056] In one embodiment, such as Figure 2 As shown, an image acquisition parameter adjustment method is provided, which can be applied to... Figure 1 Taking electronic device 103 as an example, the explanation includes the following steps:
[0057] Step 201: The electronic device acquires the initial comprehensive test image obtained by the image acquisition device from the comprehensive test card; the comprehensive test card is equipped with a first adjustment reference object and at least one second adjustment reference object; the first adjustment reference object is used to adjust the focal length parameter; each second adjustment reference object is used to adjust the corresponding image acquisition parameter.
[0058] Image acquisition devices are devices used to acquire images. These include, but are not limited to, mobile terminals with cameras, camcorders, cameras, scanners, video capture cards, and other devices with image acquisition capabilities.
[0059] Image acquisition parameters are the parameters set by the image acquisition device when acquiring images. Specifically, image acquisition parameters include, but are not limited to, at least one of focal length parameters, resolution parameters, dynamic range parameters, or distortion parameters.
[0060] The comprehensive test chart is a test chart used to adjust various image acquisition parameters. It includes multiple adjustment reference objects. Specifically, various image acquisition parameters can be adjusted using these adjustment objects. The image obtained from the initial image acquisition using the comprehensive test chart is the initial comprehensive test image.
[0061] The reference object is the object that the image acquisition device refers to when adjusting the image acquisition parameters.
[0062] Specifically, the reference object for adjustment is represented by the patterns on the comprehensive test card. The comprehensive test card includes various patterns to adjust different image acquisition parameters. For example, image acquisition parameters include dynamic range parameters. Taking the dynamic range parameter as an example, when adjusting the dynamic range parameter, the reference object is the grayscale pattern on the comprehensive test card. By analyzing the grayscale pattern on the initial comprehensive test image obtained from the acquisition, the current dynamic range parameter is determined. If the current dynamic range parameter does not meet the requirements, the dynamic range parameter of the image acquisition device is adjusted. It can be understood that different image acquisition parameters correspond to different adjustment reference objects.
[0063] The first adjustment reference object is a reference object that represents the focal length parameter when it is adjusted. Specifically, the first reference object includes at least one focus pattern, and the image acquisition device adjusts the focal length parameter based on the focus pattern.
[0064] The second adjustment reference object is the object referenced when adjusting image acquisition parameters other than the focal length parameter. Specifically, the second adjustment reference object is related to the type of image acquisition parameter. For example, when adjusting distortion parameters, the second adjustment reference object is the grid lines on the comprehensive test chart. When adjusting color parameters, the second adjustment reference object is the color blocks on the comprehensive test chart.
[0065] It should be noted that the second adjustment reference object does not specifically refer to the adjustment reference object corresponding to a certain image acquisition parameter. It is only used to distinguish it from the first adjustment reference object. All reference objects other than the adjustment reference object corresponding to the focal length parameter can be called the second adjustment reference object.
[0066] Step 202: The electronic device identifies the position information of the first object image corresponding to the first adjustment reference object in the initial comprehensive test map, and adjusts the focal length parameter based on the position information.
[0067] The first object image is the image of the first adjusted reference object presented in the initial integrated test diagram.
[0068] It is understood that the electronic device can locate the image corresponding to the integrated test card from the initial integrated test diagram to obtain the test card image. Then, it can identify the positional information of the first object image from the test card image. Alternatively, the electronic device can determine the positional transformation relationship between the integrated test card design drawing and the initial integrated test diagram, and directly determine the positional information of the first object image corresponding to the first adjustment reference object from the initial integrated test diagram. No limitations are imposed on this.
[0069] In some embodiments, the electronic device can extract features from the design drawing and the test card image in the initial integrated test drawing of the integrated test card, and perform feature matching to obtain a homography transformation matrix. The electronic device can determine the coordinates of the vertices of the integrated test card in the initial integrated test drawing based on the coordinates of the vertices in the design drawing and the homography transformation matrix. Then, by adjusting the relative positional relationship of the first reference object in the design drawing of the integrated test card, a first object image is determined from the test card image to obtain the positional information of the first object image in the initial integrated test drawing.
[0070] In some embodiments, the electronic device can use a feature matching algorithm to extract features of the test card image in the design drawing and initial integrated test drawing of the integrated test card, and perform feature matching to obtain the homography transformation matrix.
[0071] It is understandable that the electronic device can analyze the initial comprehensive test image to determine whether focal length parameter adjustment is required. If so, step 202 is executed. If not (i.e., it is determined that focal length parameter adjustment is not required), then the focal length parameter adjustment is not performed, but the adjustment is performed on the next image acquisition parameter (i.e., the image acquisition parameter corresponding to the second adjustment reference object).
[0072] Specifically, the electronic device can determine whether the focal length parameter has reached a sharpness threshold by calculating the sharpness of the first object image in the initial comprehensive test image. If the sharpness does not reach the sharpness threshold, it is determined that the image acquisition device needs to adjust the focal length parameter. If the sharpness reaches the sharpness threshold, it is determined that the image acquisition device does not need to adjust the focal length parameter.
[0073] Sharpness is one of the determining factors of image quality; the higher the sharpness, the more detailed the image. The sharpness threshold is a critical value that characterizes whether an image is sharp or not. The sharpness threshold is related to the pixels and resolution of the image acquisition device, and different image acquisition devices have different sharpness thresholds.
[0074] Step 203: The image acquisition device acquires images of the comprehensive test card based on the adjusted focal length parameters to obtain the target comprehensive test image.
[0075] The target comprehensive test image is the image obtained by the image acquisition device after adjusting the focal length parameters and capturing the image of the comprehensive test card. It can be understood that the adjusted focal length parameters meet the image sharpness requirements, that is, the sharpness reaches the sharpness threshold. Therefore, the target comprehensive test image is the image obtained by the image acquisition device based on the adjusted focal length parameters and capturing the image of the comprehensive test card; in other words, the sharpness of the target comprehensive test image has reached the sharpness threshold.
[0076] Step 204: When the electronic device adjusts the image acquisition parameters corresponding to each second adjustment reference object, it identifies the second object image corresponding to the second adjustment reference object in the target comprehensive test map.
[0077] The second object image is the image of the second adjusted reference object presented in the target comprehensive test map.
[0078] It is understandable that when electronic devices adjust image acquisition parameters, they determine whether the image acquisition parameters meet the requirements by using the second object image corresponding to each parameter. If the requirements are not met, the image acquisition parameters are adjusted based on the second object image. If the requirements are met, it is determined that the image acquisition device does not need to adjust the image acquisition parameters corresponding to the second object image.
[0079] Step 205: The image acquisition device adjusts the corresponding image acquisition parameters based on the second object image.
[0080] In some embodiments, the electronic device may determine the difference between the second object image and the second adjustment reference object in the integrated test card in the corresponding image acquisition parameters, and adjust the image acquisition parameters of the image acquisition device based on the difference.
[0081] It is understood that the method of this application is applicable to image acquisition parameters of a corresponding second adjustment reference object set in the comprehensive test card.
[0082] It should be noted that if the comprehensive test chart has corresponding image acquisition parameters for a second adjustment reference object, steps 204 to 205 can be executed when adjusting the image acquisition parameters. For image acquisition parameters where no corresponding second positioning reference object is set in the comprehensive test chart, the image acquisition parameters can be adjusted according to preset adjustment rules. For example, the exposure time parameter can be adjusted to a preset time range.
[0083] In the above-described image acquisition parameter adjustment method, an initial comprehensive test image is obtained by acquiring images of a comprehensive test card using an image acquisition device. The comprehensive test card includes a first adjustment reference object and at least one second adjustment reference object. The first adjustment reference object is used to adjust the focal length parameter. Each second adjustment reference object is used to adjust the corresponding image acquisition parameter. The position information of the first object image corresponding to the first adjustment reference object in the comprehensive test image is identified, and the focal length parameter is adjusted based on the position information. Based on the adjusted focal length parameter, the comprehensive test card is used to acquire images to obtain a target comprehensive test image. When adjusting the image acquisition parameters corresponding to each second adjustment reference object, the second object image corresponding to the second adjustment reference object in the target comprehensive test image is identified. Based on the second object image, the corresponding image acquisition parameters are adjusted. By adjusting multiple image acquisition parameters using a single comprehensive test card, the frequent replacement of the test card for adjusting different image acquisition parameters is avoided. This not only reduces the difficulty of adjusting image acquisition parameters but also saves time spent manually adjusting image acquisition parameters, thus improving the efficiency of image acquisition parameter adjustment.
[0084] In some embodiments, the location information includes the coordinates of the first object image in the initial integrated test map; the electronic device adjusting the focal length parameter based on the location information includes: adjusting the focal length parameter of the image acquisition device based on the coordinates so that the image acquisition device focuses on the first adjustment reference object.
[0085] It is understood that the initial integrated test image and the first object image are in the same image coordinate system. Specifically, determining the coordinates of the first object image in the initial integrated test image means determining the coordinates of the first object image in the image coordinate system, and then determining the coordinates of the first adjustment reference object in the internal coordinate system based on the correspondence between the internal coordinate system of the image acquisition device and the image coordinate system.
[0086] In some embodiments, adjusting the focal length parameter of the image acquisition device based on coordinates means that the image acquisition device moves the focus point to the coordinates of the first adjustment reference object in the internal coordinate system. In other words, the first adjustment reference object is the subject to be focused, and when the focus point is accurately aligned with the subject to be focused, an adjustment of the focal length parameter is completed.
[0087] The image coordinate system is a coordinate system in which the center of the image plane is the origin, the X-axis and Y-axis are parallel to the two vertical sides of the image plane, and the coordinate values are represented by (x,y).
[0088] The internal coordinate system has the optical center of the image acquisition device as its origin, the X-axis and Y-axis as parallel to the X-axis and Y-axis of the image coordinate system, and the optical axis of the image acquisition device as the Z-axis. Its coordinate values are represented by (Xc, Yc, Zc).
[0089] It is understood that the coordinates of the first adjustment reference object in the internal coordinate system can be determined through the projection mapping relationship between the internal coordinate system and the image coordinate system. In other embodiments, the focal length parameter of the image acquisition device is adjusted by slowly moving the focus point of the image acquisition device so that the focus point is aligned with the first adjustment reference object.
[0090] In the above embodiments, the focal length parameter is adjusted by using the coordinates of the first object image in the initial comprehensive test map, which is simple and efficient.
[0091] In one embodiment, adjusting the focal length parameter of an image acquisition device based on coordinates to enable the image acquisition device to focus on a first adjustment reference object includes: the image acquisition device gradually and repeatedly adjusting the focal length parameter of the image acquisition device based on coordinates, and acquiring images of a comprehensive test card based on the focal length parameter adjusted each time to obtain candidate images after multiple focal length adjustments; the electronic device calculates the sharpness of the image corresponding to the first adjustment reference object in each candidate image; and determines the focal length parameter corresponding to the candidate image with the highest sharpness as the focal length parameter after focusing on the first adjustment reference object.
[0092] The candidate images are those acquired by the image acquisition device after each adjustment of the focal length parameter on the comprehensive test card. It can be understood that the number of candidate images is related to the number of times the focal length parameter has been adjusted.
[0093] In some embodiments, after each adjustment of the focal length parameter of the image acquisition device, the image acquisition device re-acquires an image from the comprehensive test card to obtain a candidate image. Then, the sharpness of the first adjustment reference object in the candidate image is calculated using an image sharpness evaluation function. When the sharpness is greater than a sharpness threshold, the focal length parameter corresponding to that sharpness is determined as the focal length parameter after focusing on the first adjustment reference object. When the sharpness is less than the sharpness threshold, the focus point coordinates of the image acquisition device are adjusted multiple times, and the sharpness of each candidate image is calculated until the sharpness of the candidate image is greater than the sharpness threshold. The focal length parameter corresponding to the candidate image that meets the sharpness threshold is determined as the focal length parameter after focusing on the first adjustment reference object.
[0094] In some embodiments, the electronic device calculates the sharpness of a limited number of candidate images and selects the focal length parameter corresponding to the candidate image with the highest sharpness as the focal length parameter after focusing on the first adjustment reference object. It can be understood that selecting a limited number of candidate images is to save adjustment time and avoid repeatedly adjusting the focal length parameter, which could affect the adjustment of other image acquisition parameters.
[0095] In the above embodiments, by repeatedly adjusting the focal length parameters of the image acquisition device, the focal length parameters corresponding to the highest clarity of the candidate image are determined as the focal length parameters after focusing on the first adjustment reference object, resulting in higher accuracy of the obtained focal length parameters.
[0096] In one embodiment, the first adjustment reference object is a plurality of reference patterns of different shapes with sharpness greater than a sharpness threshold; calculating the image sharpness of the first adjustment reference object in each candidate image includes: for each candidate image, calculating the edge gradient of each reference pattern in the candidate image; and determining the image sharpness of each reference pattern in the candidate image based on the edge gradient.
[0097] Sharpness is an indicator that reflects the sharpness of image edges. The sharpness of image edges is positively correlated with the magnitude of the sharpness value.
[0098] The sharpness threshold is a critical value that represents the sharpness of a reference pattern when it meets the required sharpness level.
[0099] Specifically, multiple reference patterns of different shapes with sharpness greater than the sharpness threshold (i.e., sharp edges) are selected as the first adjustment reference objects. When adjusting the focal length parameter, after aligning the focus point with the reference pattern, the image acquisition device acquires images of the comprehensive test card to obtain candidate images.
[0100] Among them, edge gradient is the gradient value of the image edge, which is used to characterize how fast the image edge changes.
[0101] Specifically, the electronic device calculates the edge gradient of each reference pattern in the candidate image by calling the image sharpness evaluation function. When the edge gradient is greater than the preset gradient value, it indicates that the edge change of each reference pattern is the most significant, which means that the candidate image has met the sharpness requirements.
[0102] The reference pattern is the pattern used by the image acquisition device when adjusting its focal length parameters. It can be understood that adjusting the focal length parameters of the image acquisition device is to obtain a sharp image. After each focal length parameter adjustment, the sharpness of the candidate image needs to be calculated, and sharpness is positively correlated with edge gradient. To facilitate the calculation of the candidate image's sharpness, a reference pattern with sharp edges (i.e., sharpness greater than a sharpness threshold) is selected as the first adjustment reference object.
[0103] In the above embodiments, the sharpness of each candidate image is determined by calculating the edge gradient corresponding to each reference pattern in the candidate image, which is convenient and simple.
[0104] In one embodiment, adjusting the corresponding image acquisition parameters based on the second object image includes: the electronic device determining a correction matrix for the image acquisition parameters based on the difference between the second object image and the second adjustment reference object in the integrated test card in the corresponding image acquisition parameters; and adjusting the image acquisition parameters based on the correction matrix.
[0105] The correction matrix is a matrix used to correct image acquisition parameters. Correction matrices include, but are not limited to, white balance correction matrices for white balance parameters and color correction matrices for color parameters.
[0106] Specifically, the image acquisition parameters of the second object image and the corresponding image of the second adjustment reference object are compared to see if there are differences. If there are differences, the corresponding image acquisition parameters are adjusted based on the correction matrix. If there are no differences, there is no need to adjust the corresponding image acquisition parameters.
[0107] In some embodiments, the electronic device compares the color values of a white balance patch in a comprehensive test chart and a second object image, where the second object image is the representation of the white balance patch in the target comprehensive test chart. When a difference exists, a white balance correction matrix is determined from the white balance patch in the comprehensive test chart and the second object image. When no difference exists, no adjustment of the white balance parameters is required.
[0108] In some embodiments, the electronic device compares the average color values of multiple color-corrected color patches in a comprehensive test chart and a second object image to determine if there is a difference. The second object image is an image of the multiple color-corrected color patches presented in the target comprehensive test chart. When a difference exists, a color correction matrix is determined from the multiple color-corrected color patches in the comprehensive test chart and the second object image. When there is no difference, no adjustment of the color parameters is required.
[0109] In the above embodiments, the image acquisition parameters are adjusted based on the correction matrix, resulting in high accuracy.
[0110] In some embodiments, at least one second adjustment reference object includes a white balance adjustment color patch; the second object image includes a white balance color patch map in a target comprehensive test map; the electronic device determines a correction matrix for the image acquisition parameters based on the difference between the second object image and the second adjustment reference object in the comprehensive test card in corresponding image acquisition parameters, including: determining a first color average value of pixels in the central region of the white balance color patch map; determining a second color average value of pixels in the central region of the white balance adjustment color patch in the comprehensive test card; and determining a white balance correction matrix for the white balance parameters based on the difference between the first color average value and the second color average value.
[0111] Specifically, the electronic device determines the difference in white balance parameters between the second object image and the second adjustment reference object. When a difference exists, a white balance correction matrix is determined based on the first color average and the second color average. It can be understood that in this embodiment, the second object image is a white balance color patch image, and the second adjustment reference object is a white balance adjustment color patch.
[0112] In some embodiments, the electronic device calculates the average value of the red, green, and blue channels of each pixel in the central region of the white balance color patch image, i.e., the first color average value. It also calculates the average value of the red, green, and blue channels of each pixel in the central region of the white balance adjustment color patch, i.e., the second color average value. When there is a difference between the first color average value and the second color average value, an adjustment parameter between the first color average value and the second color average value is determined. For example, the average value of the red, green, and blue channels of each pixel in the central region of the white balance color patch image is divided by the average value of the red, green, and blue channels of each pixel in the central region of the white balance adjustment color patch image; that is, the average value of the red channel of each pixel in the central region of the white balance color patch image is divided by the average value of the red channel of each pixel in the central region of the white balance color patch image, to obtain the red channel value adjustment ratio. The same method can be used to obtain the green channel value adjustment ratio and the blue channel value adjustment ratio, finally resulting in the red, green, and blue channel value adjustment matrix, i.e., the white balance correction matrix.
[0113] In the above embodiments, the white balance correction matrix is obtained by using the average value of the first color and the average value of the second color. The white balance parameters are then adjusted using the white balance matrix, which is both efficient and accurate.
[0114] In some embodiments, at least one second adjustment reference object includes multiple color correction patches; the second object image includes multiple color correction patch images in the target comprehensive test image; the electronic device determines a correction matrix for the image acquisition parameters based on the differences between the second object image and the second adjustment reference object in the comprehensive test card in the corresponding image acquisition parameters, including: determining the color values of the multiple color correction patch images respectively; comparing the color values of the multiple color correction patch images with the color values of the corresponding color correction patches in the comprehensive test card respectively; and generating a color correction matrix for the color parameters based on the difference comparison results.
[0115] Specifically, the electronic device determines the differences between the color values in the color correction swatch map and the color values in the color correction swatches. When differences exist, a color correction matrix is generated based on the color values in the color correction swatch map and the color values in the color correction swatches.
[0116] In some embodiments, taking six color correction patches as an example, the generation of the color correction matrix is explained. It can be understood that the color correction patch image is the image of the color correction patches presented in the target comprehensive test image; therefore, the patches in the color correction patch image correspond one-to-one with the color correction patches.
[0117] Specifically, the electronic device calculates the red, green, and blue channel values of six color correction patches, as well as the red, green, and blue channel values of the six color patches in the color correction patch image. It then compares the red, green, and blue channel values of the same color patches in the color correction patch image with their values within the color correction patch image to determine color value differences. If color differences exist, a color correction matrix is generated based on the red, green, and blue channel values of the same color patches in the color correction patch image and their values within the color correction patch image.
[0118] In the above embodiments, a color correction matrix is generated based on the red, green and blue channel values of each color correction patch in the comprehensive test card, and based on the red, green and blue channel values of each color correction patch in the color correction patch diagram, which is both efficient and accurate.
[0119] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0120] In some embodiments, this application also provides a comprehensive test card, which includes a card body; a first adjustment reference object and at least one second adjustment reference object are disposed on the surface of the card body; the first adjustment reference object is a reference object used to adjust the focal length parameter.
[0121] In some embodiments, the first adjustment reference object includes multiple reference patterns of different shapes with sharpness greater than a sharpness threshold; the second adjustment reference object includes at least one of white balance adjustment color blocks and color correction color blocks.
[0122] In some embodiments, the comprehensive test card further includes an identification code and a blank area; the identification code is used to identify the identity information of the comprehensive test card; the blank area is used to fill in target information, the target information representing the information that needs to be filled in.
[0123] In some embodiments, such as Figure 3 As shown, a schematic diagram of a comprehensive test card is provided.
[0124] The following is a detailed explanation of the comprehensive test card.
[0125] The comprehensive test card includes a white balance adjustment color block 301 (i.e., the second adjustment reference object), a reference pattern 302 (i.e., the first adjustment reference object), a color correction color block 303 (i.e., the second adjustment reference object), an identification code 304, and a blank area (not shown in the figure).
[0126] The white balance adjustment color block 301 is used to adjust the white balance parameters. It can be understood that, to facilitate white balance adjustment, the area of the white balance adjustment color block 301 can be several times the area of the other reference patterns. The specific size of the white balance adjustment color block 301 is not limited.
[0127] The reference pattern 302 includes at least one pattern with a sharpness greater than a sharpness threshold (i.e., sharp edges), and is used to adjust the focal length parameter. It is understood that there are many patterns with a sharpness greater than the sharpness threshold, and therefore the shape and number of reference patterns can be selected according to requirements.
[0128] It should be noted that the number and shape of reference pattern 302 are not limited to... Figure 3 As shown, this embodiment is merely for illustration with reference to the diagram and is not intended to limit this application.
[0129] Among them, color correction swatches 303 are used to adjust color parameters. It is understandable that, considering the difficulty in obtaining color correction swatches 303, several colors with relatively simple manufacturing processes are selected from the standard color chart as color correction swatches 303. The colors and number of color correction swatches 303 can be selected according to requirements.
[0130] In some embodiments, emerald green, deep red, orange, cerulean blue, lemon yellow, and purple can be selected from a standard color chart as color correction color patch 303. Alternatively, bright red, orange, titanium white, sky blue, and light green can be selected from a standard color chart as color correction color patch 303. Another option is to select magenta, orange-red, pale yellow, ultramarine, black, and purple from a standard color chart as color correction color patch 303.
[0131] It should be noted that the color and number of color correction blocks can be selected according to requirements. This embodiment is only used to illustrate color correction blocks and is not intended to limit this application.
[0132] The identification code 304 is used to identify the identity information of the integrated test card. The identity information includes, but is not limited to, the model and size of the integrated test card.
[0133] The blank areas are the blank areas in the comprehensive test card, used to fill in target information, which represents the information that needs to be filled in. For example, target information includes, but is not limited to, logos and barcodes.
[0134] Understandable. Figure 3 The arrangement order of the white balance adjustment color block 301 (i.e., the second adjustment reference object), color correction color block 303 (i.e., the second adjustment reference object), reference pattern 302 (i.e., the first adjustment reference object), and identification code 304 in the comprehensive test card shown is not fixed and can be randomly combined and arranged. Furthermore, the size of the comprehensive test card can be determined according to requirements, and this embodiment does not impose any limitations on it.
[0135] In the above embodiments, a comprehensive test card is provided that can adjust image acquisition parameters such as white balance parameters, color parameters, and focal length parameters. This avoids the need to frequently change test cards to adjust different image acquisition parameters, which not only reduces the difficulty of adjusting image acquisition parameters but also saves time for manual adjustment and improves adjustment efficiency.
[0136] Based on the same inventive concept, this application also provides an image acquisition parameter adjustment device for implementing the image acquisition parameter adjustment method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more image acquisition parameter adjustment device embodiments provided below can be found in the limitations of the image acquisition parameter adjustment method described above, and will not be repeated here.
[0137] In one embodiment, such as Figure 4 As shown, an image acquisition parameter adjustment device is provided, including: an acquisition module 401, a recognition module 402, and an adjustment module 403, wherein:
[0138] The acquisition module 401 is used to acquire the initial comprehensive test image obtained by the image acquisition device from the comprehensive test card; the comprehensive test card is provided with a first adjustment reference object and at least one second adjustment reference object; the first adjustment reference object is used to adjust the focal length parameter; each second adjustment reference object is used to adjust the corresponding image acquisition parameter.
[0139] The recognition module 402 is used to recognize the position information of the first object image corresponding to the first adjustment reference object in the initial comprehensive test map, and to adjust the focal length parameter based on the position information; and to acquire the image of the comprehensive test card based on the adjusted focal length parameter to obtain the target comprehensive test map.
[0140] The adjustment module 403 is used to identify the second object image corresponding to the second adjustment reference object in the target comprehensive test map when adjusting the image acquisition parameters corresponding to each second adjustment reference object; and to adjust the corresponding image acquisition parameters based on the second object image.
[0141] In one embodiment, the recognition module 402 is used to adjust the focal length parameter of the image acquisition device based on coordinates, so that the image acquisition device can focus on the first adjustment reference object.
[0142] In one embodiment, such as Figure 5 As shown, a structural block diagram of an identification module 402 is provided, which specifically includes:
[0143] The adjustment unit 4021 is used to adjust the focal length parameters of the image acquisition device step by step multiple times based on the coordinates, and to acquire images of the comprehensive test card based on the focal length parameters adjusted each time, so as to obtain candidate images after multiple focal length adjustments.
[0144] The calculation unit 4022 is used to calculate the sharpness of the image corresponding to the first adjustment reference object in each candidate image.
[0145] The determining unit 4023 is used to determine the focal length parameter corresponding to the candidate image with the highest sharpness as the focal length parameter after focusing on the first adjustment reference object.
[0146] In one embodiment, the recognition module 402 is specifically used to calculate the edge gradient of each reference pattern in the candidate image for each candidate image; and determine the image sharpness of each reference pattern in the candidate image based on the edge gradient.
[0147] In one embodiment, the adjustment module 403 is used to determine a correction matrix for the image acquisition parameters based on the difference between the second object image and the second adjustment reference object in the comprehensive test card in the corresponding image acquisition parameters; and to adjust the image acquisition parameters based on the correction matrix.
[0148] In one embodiment, the adjustment module 403 is specifically configured to determine a first average color value of pixels within the central region of the white balance color block image; determine a second average color value of pixels within the central region of the white balance adjustment color block in the comprehensive test card; and determine a white balance correction matrix for the white balance parameters based on the difference between the first average color value and the second average color value.
[0149] In one embodiment, the adjustment module 403 is further configured to determine the color values of multiple color correction color block images respectively; compare the color values of the multiple color correction color block images with the color values of the corresponding color correction color blocks in the comprehensive test card; and generate a color correction matrix for the color parameters based on the comparison results.
[0150] Each module in the aforementioned image acquisition parameter adjustment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.
[0151] In one embodiment, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an image acquisition parameter adjustment method.
[0152] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0153] In one embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0154] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0155] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0156] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for adjusting image acquisition parameters, characterized in that, The method includes: An initial comprehensive test image is obtained by acquiring images of a comprehensive test card using an image acquisition device; the comprehensive test card is provided with a first adjustment reference object and at least one second adjustment reference object; the first adjustment reference object is used to adjust the focal length parameter; each second adjustment reference object is used to adjust the corresponding image acquisition parameter; The method involves identifying the position information of the first object image corresponding to the first adjustment reference object in the initial comprehensive test map, and gradually adjusting the focal length parameter of the image acquisition device multiple times based on the coordinates of the first object image in the initial comprehensive test map, and acquiring images of the comprehensive test card based on the focal length parameter adjusted each time to obtain candidate images after multiple focal length adjustments; calculating the sharpness of the image corresponding to the first adjustment reference object in each of the candidate images; determining the focal length parameter corresponding to the candidate image with the highest sharpness as the focal length parameter after focusing on the first adjustment reference object; and adjusting the focal length parameter of the image acquisition device based on the coordinates, which includes moving the focus point to the coordinates of the first adjustment reference object in the internal coordinate system. Based on the adjusted focal length parameters, images of the comprehensive test card are acquired to obtain the target comprehensive test image; When adjusting the image acquisition parameters corresponding to each of the second adjustment reference objects, the second object image corresponding to the second adjustment reference object in the target comprehensive test map is identified; Based on the differences in corresponding image acquisition parameters between the second object image and the second adjustment reference object in the comprehensive test card, a correction matrix for the image acquisition parameters is determined; The image acquisition parameters are adjusted based on the correction matrix.
2. The method according to claim 1, characterized in that, The method further includes: Features are extracted from the design drawing of the integrated test card and the test card image in the initial integrated test drawing, and feature matching is performed to obtain the homography transformation matrix.
3. The method according to claim 2, characterized in that, The method further includes: Based on the coordinates of the vertices of the integrated test card in the design drawing and the homography transformation matrix, the coordinates of the vertices of the integrated test card in the initial integrated test drawing are determined; By determining the relative position of the first adjustment reference object in the design drawing of the integrated test card, the first object image is determined from the test card image to obtain the position information of the first object image in the initial integrated test drawing.
4. The method according to claim 3, characterized in that, The first adjustment reference object is a series of reference patterns of different shapes with sharpness greater than the sharpness threshold; The step of calculating the sharpness of the image corresponding to the first adjustment reference object in each of the candidate images includes: For each candidate image, calculate the edge gradient of each reference pattern in the candidate image; The sharpness of the image corresponding to each of the reference patterns in the candidate image is determined based on the edge gradient.
5. The method according to claim 1, characterized in that, The method further includes: Calculate the sharpness of the first object image in the initial comprehensive test image, and determine whether the focal length parameter reaches the sharpness threshold. If the sharpness does not reach the sharpness threshold, it is determined that the image acquisition device needs to adjust the focal length parameter; if the sharpness reaches the sharpness threshold, it is determined that the image acquisition device does not need to adjust the focal length parameter.
6. The method according to claim 1, characterized in that, The at least one second adjustment reference object includes a white balance adjustment color block; the second object image includes a white balance color block image in the target comprehensive test image; The step of determining the correction matrix for the image acquisition parameters based on the difference between the second object image and the second adjustment reference object in the comprehensive test card in the corresponding image acquisition parameters includes: Determine the first color average value of the pixels within the central region of the white balance color patch image; Determine the average second color value of the pixels within the central area of the white balance adjustment color block in the comprehensive test card; A white balance correction matrix is determined based on the difference between the first color average value and the second color average value.
7. The method according to claim 1, characterized in that, The at least one second adjustment reference object includes multiple color correction color blocks; the second object image includes multiple color correction color block images in the target comprehensive test image; The step of determining the correction matrix for the image acquisition parameters based on the difference between the second object image and the second adjustment reference object in the comprehensive test card in the corresponding image acquisition parameters includes: Determine the color values of multiple color correction color swatches separately; The color values of the plurality of color correction color block images are compared with the color values of the corresponding color correction color blocks in the comprehensive test card. A color correction matrix for color parameters is generated based on the difference comparison results.
8. A comprehensive test card as described in any one of claims 1 to 7, characterized in that, include: Card body; a first adjustment reference object and at least one second adjustment reference object are provided on the surface of the card body; the first adjustment reference object is a reference object used to adjust the focal length parameter.
9. The comprehensive test card according to claim 8, characterized in that, The first adjustment reference object includes multiple reference patterns of different shapes with sharpness greater than a sharpness threshold; the second adjustment reference object includes at least one of white balance adjustment color blocks and color correction color blocks.
10. The comprehensive test card according to claim 8, characterized in that, The comprehensive test card also includes an identification code and a blank area; the identification code is used to identify the identity information of the comprehensive test card; the blank area is used to fill in target information, and the target information represents the information that needs to be filled in.
11. An image acquisition parameter adjustment device, characterized in that, The device includes: The acquisition module is used to acquire an initial comprehensive test image obtained by the image acquisition device from the comprehensive test card; the comprehensive test card is provided with a first adjustment reference object and at least one second adjustment reference object; the first adjustment reference object is used to adjust the focal length parameter; each second adjustment reference object is used to adjust the corresponding image acquisition parameter; The identification module is used to identify the position information of the first object image corresponding to the first adjustment reference object in the initial comprehensive test map, and based on the coordinates of the first object image in the initial comprehensive test map including the position information, gradually and repeatedly adjust the focal length parameters of the image acquisition device, and perform image acquisition on the comprehensive test card based on the focal length parameters adjusted each time to obtain candidate images after multiple focal length adjustments; calculate the sharpness of the image corresponding to the first adjustment reference object in each of the candidate images respectively; determine the focal length parameters corresponding to the candidate image with the highest sharpness as the focal length parameters after focusing on the first adjustment reference object; and perform image acquisition on the comprehensive test card based on the adjusted focal length parameters to obtain the target comprehensive test map; the step of adjusting the focal length parameters of the image acquisition device based on the coordinates includes: moving the focus point to the coordinates of the first adjustment reference object in the internal coordinate system; The adjustment module is used to identify the second object image corresponding to the second adjustment reference object in the target comprehensive test map when adjusting the image acquisition parameters corresponding to each second adjustment reference object; determine the correction matrix for the image acquisition parameters based on the difference between the second object image and the second adjustment reference object in the comprehensive test card in the corresponding image acquisition parameters; and adjust the image acquisition parameters based on the correction matrix.
12. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for calculating image definition value for focusing, computing device and focusing system
CN108833770A
Imaging quality detection method and device, electronic equipment and readable storage medium
CN111031311A