Leveling Method, Device, System and Storage Medium for Image Sensor
By acquiring the target image on the image sensor, calculating the grayscale difference value and normalization processing, the problem of poor leveling accuracy of the image sensor is solved, and a more efficient leveling effect is achieved.
Patent Information
- Application Number
- CN202210667172.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-06-13
AI Technical Summary
The leveling accuracy of image sensors is affected by the accuracy of equipment such as leveling, resulting in inaccurate leveling.
By acquiring the target image, determining the statistical window based on the preset window, calculating the sum of the grayscale difference values of the pixel points in each statistical window, and using the normalized value, standard deviation and extreme difference to judge the position information of the image sensor to achieve accurate leveling.
It improves the accuracy and efficiency of image sensor leveling and reduces the dependence on the accuracy of equipment such as level.
Smart Images

Figure CN114926528B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial testing technologies, and more particularly, to a leveling method, device, system, and storage medium for an image sensor. Background Art
[0002] In industrial inspection applications, by adjusting the position of a camera, the image sensor of the camera is made parallel to the object to be inspected.
[0003] In related technologies, to level an image sensor, a device such as a spirit level is usually used to make the camera with the image sensor parallel to the object to be inspected.
[0004] However, the leveling method using devices such as spirit levels is affected by the accuracy of these devices, thus reducing the leveling accuracy of the image sensor. Summary of the Invention
[0005] To solve the problem that the leveling of the image sensor is affected by the accuracy of devices such as spirit levels, resulting in poor leveling accuracy of the image sensor, this application provides a leveling method, device, system, and storage medium for an image sensor.
[0006] The embodiments of this application are implemented as follows:
[0007] In a first aspect of the embodiments of this application, a leveling method for an image sensor is provided. The method includes the following steps:
[0008] Obtain a target image;
[0009] Based on a preset window, determine a statistical window on the target image, where the position of the preset window includes the central position and the edge position of the imaging area of the image sensor;
[0010] Determine the statistical value of each statistical window, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window;
[0011] Based on the statistical values of each statistical window, determine the position information of the image sensor.
[0012] In a feasible implementation manner, determining the position information of the image sensor based on the statistical values of each statistical window includes:
[0013] Normalize the statistical values of each statistical window to determine the normalized values of the statistical values;
[0014] Determine the standard deviation and range of all the normalized values;
[0015] If both the standard deviation and the range meet the preset parallel condition, the position information of the image sensor is parallel.
[0016] In a feasible implementation, after determining the standard deviation and range of all normalization values, the method further includes:
[0017] If at least one of the standard deviation and the range does not meet the preset parallel condition, the position information of the image sensor includes the adjustment information of the image sensor.
[0018] In a feasible implementation, determining the statistical value of each statistical window, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window, includes:
[0019] Determine the judgment area of the statistical window, where the judgment area is determined with each pixel point in the statistical window as the target pixel point;
[0020] Based on the judgment area, determine the gray difference value of each target pixel point.
[0021] In a feasible implementation, based on the judgment area, determining the gray difference value of each target pixel point includes:
[0022] Obtain the gray value of each pixel point in the judgment area;
[0023] Based on the gray value of the target pixel point and the gray value of the edge pixel point of the judgment area, determine the gray difference value of the target pixel point.
[0024] In a feasible implementation, the gray difference value is calculated according to the following formula:
[0025]
[0026] In the formula, V m is the gray difference value, d t is the gray value of the target pixel point, d ei is the gray value of the edge pixel point, N is the number of edge pixel points, m is the number of the judgment window, and M is the number of judgment areas in the statistical window.
[0027] In a feasible implementation, the patterns of the target images corresponding to each statistical window are the same.
[0028] The second aspect of the embodiments of the present application provides a leveling device for an image sensor, including an acquisition module, a statistics module, and an output module;
[0029] The acquisition module is used to acquire a target image;
[0030] The statistics module is used to determine a statistical window on the target image based on a preset window, where the positions of the preset windows include the central position and the edge position of the imaging area of the image sensor;
[0031] The statistical module is further configured to determine the statistical value of each statistical window, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window.
[0032] The output module is configured to determine the position information of the image sensor based on the statistical value of each statistical window.
[0033] A third aspect of the embodiments of the present application provides a leveling system for an image sensor, including a target, an image sensor, and a controller.
[0034] The image sensor is configured to collect a target image of the target.
[0035] The controller is communicatively connected to the image sensor and is configured to:
[0036] Receive the target image sent by the image sensor.
[0037] Based on a preset window, determine the statistical windows on the target image, where the positions of the preset windows include the central position and the edge position of the imaging area of the image sensor.
[0038] Determine the statistical value of each statistical window, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window.
[0039] Based on the statistical value of each statistical window, determine the position information of the image sensor.
[0040] Wherein, the size of the target is larger than the imaging area of the image sensor.
[0041] A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor is caused to execute the steps of the leveling method for an image sensor in the inventive content.
[0042] Advantages of the present application: By based on a preset window, it is possible to determine the statistical windows on the target image; further, based on the gray difference values of each pixel point in the statistical window, the statistical value of each statistical window can be determined; further, based on the analysis of the statistical value of each statistical window, it is possible to output the position information of the image sensor, improving the accuracy of leveling the image sensor. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0044] Figure 1 The figure shows a schematic flowchart of a leveling method for an image sensor according to an embodiment of the present application;
[0045] Figure 2a The figure shows a schematic diagram of a specific target in an embodiment of the present application;
[0046] Figure 2b The figure shows a schematic diagram for determining a statistical window 200a on a target image 100a in area array image sensing according to an embodiment of the present application;
[0047] Figure 2c The figure shows a schematic diagram for determining a statistical window 200b on a target image 100b in line array image sensing according to an embodiment of the present application;
[0048] Figure 3 The figure shows a schematic flowchart of step 130 in a leveling method for an image sensor according to another embodiment of the present application;
[0049] Figure 4 The figure shows a schematic flowchart of step 140 in a leveling method for an image sensor according to another embodiment of the present application;
[0050] Figure 5 The figure shows a schematic structural diagram of a leveling device for an image sensor according to another embodiment of the present application;
[0051] Figure 6 The figure shows a schematic structural diagram of a leveling system for an image sensor according to another embodiment of the present application. Detailed implementation manners
[0052] To make the objectives, implementation manners, and advantages of the present application clearer, the following will clearly and completely describe the exemplary implementation manners of the present application with reference to the accompanying drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only a part of the embodiments of the present application, rather than all of the embodiments.
[0053] It should be noted that the brief description of the terms in the present application is only for facilitating the understanding of the subsequent described implementation manners, rather than intending to limit the implementation manners of the present application. Unless otherwise specified, these terms should be understood according to their ordinary and common meanings.
[0054] The terms "first", "second", "third", etc. in the description, claims, and the above accompanying drawings of the present application are used to distinguish similar or homogeneous objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that such terms can be interchanged under appropriate circumstances.
[0055] The terms "comprising", "having" and any variations thereof are intended to cover inclusion but not exclusivity. For example, a product or device comprising a series of components need not be limited to all the components clearly listed, but may include other components not clearly listed or inherent to such products or devices.
[0056] For the leveling of the image sensor of a camera, the parallelism between the image sensor and the object to be detected is usually adjusted by means of a device such as a spirit level, or the image sensor is manually set so that the image sensor is parallel to the object to be detected; afterwards, the lens connected to the camera can also be combined to collect the detection image, and it is judged whether the image sensor is parallel to the object to be detected by detecting the clarity of the image.
[0057] Affected by the accuracy of the spirit level or the level set manually, the stability of the parallelism between the image sensor and the object to be detected after adjustment is poor.
[0058] Based on this, the embodiments of the present application provide a leveling method, device, system and storage medium for an image sensor. By dividing the obtained target image according to a preset window into statistical windows, since the positions of the preset windows include the central position and the edge position of the imaging area of the image sensor, the statistical windows on the target image cover the center and the edge of the target image; based on the sum of the gray difference values of each pixel point in the statistical window, the statistical value of each statistical window is determined; in addition, the position information of the image sensor is determined through the statistical value of each statistical window; the accuracy of leveling the image sensor is improved.
[0059] The following will describe in detail the leveling method, device, system and storage medium for an image sensor according to the embodiments of the present application with reference to the accompanying drawings.
[0060] Figure 1 It is a schematic flowchart of a leveling method for an image sensor provided by an embodiment of the present application. As Figure 1 shown, the embodiments of the present application provide a leveling method for an image sensor.
[0061] It should be noted that the leveling method for an image sensor according to the embodiments of the present application can be used for cameras with image sensors, such as area array cameras, line array cameras, etc.; it can also be an installation surface fixedly connected to the image sensor.
[0062] Specifically, the leveling method for the image sensor includes the following steps:
[0063] S110. Obtain a target image.
[0064] The target image of the embodiment of the present application is obtained by photographing a target fixed on the platform to be detected. The target image is collected by the image sensor.
[0065] Among them, the target image can be a single image or a certain video frame in a video stream.
[0066] The size of the target needs to satisfy covering the field of view range of the image sensor, that is to say, the size of the target is greater than or equal to the imaging area of the image sensor.
[0067] The pattern of the target has high contrast. For example, the target can be white background with black target, or black background with white target, which can improve the accuracy of subsequent analysis.
[0068] In addition, there is no requirement for the pattern content of the target. It can be a conventional target pattern in the field, or other patterns with high contrast.
[0069] Such as Figure 2a shown, a schematic diagram of a specific target is provided.
[0070] S120. Based on a preset window, determine a statistical window on the target image, where the positions of the preset window include the central position and the edge position of the imaging area of the image sensor.
[0071] According to the position information of the preset window in the imaging area of the image sensor, correspondingly determine the statistical window on the target image. Since the positions of the preset window include the central position and the edge position of the imaging area of the image sensor, the statistical window on the target image covers the center and the edge of the target image.
[0072] In some embodiments, the image sensor is a area array image sensor, and its preset windows include those at the central position and the edge position. There can be one or more at the central position and multiple at the edge position.
[0073] Exemplarily, based on the preset window, determine the statistical window of the target image obtained by the area array image sensor. In this example, there are 9 preset windows, where 1 is located at the central position of the imaging area and 8 are distributed at the periphery of the imaging area, that is, the edge position. At this time, as Figure 2b shown, a schematic diagram of determining 9 statistical windows 200a on the target image 100a.
[0074] Exemplarily, based on the preset window, determine the statistical window of the target image obtained by the line array image sensor. In this example, there are 3 preset windows, where 1 is located at the central position of the imaging area and 2 are distributed at the periphery of the imaging area, that is, the edge position. At this time, as Figure 2c shown, a schematic diagram of determining 3 statistical windows 200b on the target image 100b.
[0075] S130. Determine the statistical value of each statistical window, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window.
[0076] Accumulating the gray - level differences of all pixel points within each statistical window yields the statistical value of that statistical window. Among them, the gray - level difference of each pixel point is determined by taking each pixel point as the target pixel point and using the gray - level value of the target pixel point and the gray - level values of its surrounding pixel points.
[0077] S140. Determine the position information of the image sensor based on the statistical value of each statistical window.
[0078] It should be understood that the statistical windows are distributed at the middle position and the edge position of the target image, and their statistical values can reflect the position information of the target image. When the statistical values of each statistical window are more consistent, the determined position information of the image sensor is parallel; when the differences between the statistical values of each statistical window are greater, the determined position information of the image sensor is non - parallel, and adjustment is required according to the statistical values.
[0079] In the embodiment of the present application, based on a preset window, a statistical window can be determined on the target image; based on the gray - level differences of each pixel point in the statistical window, the statistical value of each statistical window can be determined; based on the analysis of the statistical value of each statistical window, the output of the position information of the image sensor can be realized, improving the accuracy of leveling the image sensor.
[0080] Figure 3 It is a schematic flowchart of step 130 in a method for leveling an image sensor provided by an embodiment of the present application, as Figure 3 shown, that is, the above - mentioned step 130 specifically includes the following steps:
[0081] S1301. Determine the judgment area of the statistical window, where the judgment area is determined by taking each pixel point in the statistical window as the target pixel point.
[0082] Among them, the patterns of the target images corresponding to each statistical window are the same, so that the subsequent analysis of each judgment area is more accurate, and the same case of each statistical window can be realized based on the target image and the preset window.
[0083] It should be understood that each judgment area is determined by taking each pixel point in the statistical window as the target pixel point, and includes the target pixel point and the edge pixel points; that is to say, each pixel point in the statistical window is used as the target pixel point for traversal.
[0084] During the traversal process, it can be a row - by - row scan along the horizontal direction of the statistical window until the last pixel point of the statistical window is reached.
[0085] Among them, the size of the judgment area can be determined according to a preset size, and the preset size can be a height H and a width M; the judgment area can be square, cross-shaped or other conventional area division forms in the art.
[0086] Exemplarily, for the target image obtained by the area array image sensor, among them, the judgment area takes 3*3 pixels. For a certain judgment area, the pixel points are arranged as:
[0087] d11, d12, d13,
[0088] d21, d22, d23,
[0089] d31, d32, d33,
[0090] In this judgment area, d22 is the target pixel point; d11, d12, d13, d21, d23, d31, d32, d33 are edge pixel points.
[0091] Exemplarily, for the target image obtained by the line array image sensor, among them, the judgment area is 1*3 pixels. For one of the judgment areas, the pixel points are arranged as:
[0092] d1, d2, d3,
[0093] In this judgment area, d2 is the target pixel point; d1, d3 are edge pixel points.
[0094] S1302. Based on the judgment area, determine the gray difference value of each target pixel point.
[0095] Among them, the determination of the gray difference value of each target pixel point includes the following steps:
[0096] Obtain the gray value of each pixel point (i.e., the target pixel point and the edge pixel point) in the judgment area; based on the gray value of the target pixel point and the gray value of the edge pixel point in the judgment area, determine the gray difference value of the target pixel point. The gray difference value can be calculated according to the following formula:
[0097]
[0098] In the formula, V m is the gray difference value, d t is the gray value of the target pixel point, d ei is the gray value of the edge pixel point, N is the number of edge pixel points, m is the number of the judgment window, and M is the number of judgment areas in the statistical window.
[0099] In some embodiments, other gradient operators can also be used to calculate the gray difference value, such as: sobel operator, Canny operator, etc.
[0100] For the example in step 1301 above, the area array image sensor obtains a 3*3 pixel judgment area in the target image, and its gray-scale difference is:
[0101] V m = 8d22 - d11 - d12 - d13 - d21 - d23 - d31 - d32 - d33
[0102] The line array image sensor obtains a 1*3 pixel judgment area in the target image, and its gray-scale difference is:
[0103] V m = 2d2 - d1 - d3
[0104] It should be noted that the gray-scale value difference can also be obtained by other methods with the same effect.
[0105] In the embodiment of the present application, based on a preset window, a statistical window can be determined on the target image; based on the judgment area corresponding to each pixel point in the statistical window, the gray-scale difference of each pixel point can be determined, and the statistical value of each statistical window can be determined; based on the statistical value of each statistical window, the position information output of the image sensor can be realized, improving the accuracy of leveling the image sensor.
[0106] Figure 4 It is a schematic flow chart of step 140 in a leveling method for an image sensor provided by an embodiment of the present application. As Figure 4 shown, that is, step 140 specifically includes the following steps:
[0107] S1401. Normalize the statistical value of each statistical window to determine the normalized value of the statistical value.
[0108] After normalization processing, the normalized value of the statistical value of each statistical window is in the range of (0, 1]. Through the normalized value, under different statistical windows and different brightness target images and other different states, judgments can be made according to a unified standard.
[0109] S1402. Determine the standard deviation and range of all normalized values.
[0110] Among them, the standard deviation of all normalized values (Standard Deviation, also known as: mean square error) is the square root of the arithmetic mean of the squares of the deviations of the standard values of each statistical area of all normalized values from their average, and is used to reflect the dispersion degree of all normalized values.
[0111] The range of all normalized values is the difference between the maximum value and the minimum value among all normalized values, and is used to evaluate the dispersion degree of all normalized values.
[0112] S1403. When both the standard deviation and the range meet the preset parallel conditions, the position information of the image sensor is parallel.
[0113] Among them, the preset parallel conditions can be that the standard deviation meets the first threshold and the range meets the second threshold.
[0114] When the standard deviation is less than the first threshold and the range is less than the second threshold, that is, the preset parallel conditions are met, and the position information of the image sensor at this time is parallel.
[0115] For example, the first threshold is 0.05 and the second threshold is 0.1; then when the standard deviation is less than 0.05 and the range is less than 0.1, the preset parallel conditions are met, that is, the position information of the image sensor at this time is parallel.
[0116] S1404. When at least one of the standard deviation and the range does not meet the preset parallel conditions, the position information of the image sensor includes the adjustment information of the image sensor.
[0117] In the case where the differences between the statistical values of each statistical window are large, that is, there is a situation where the standard deviation and / or the range corresponding to the normalized values after normalization do not meet the preset parallel conditions, the position information of the image sensor at this time is not parallel. At the same time, based on the normalized values or the statistical values, the position information can also include adjustment information for adjusting the position of the image sensor.
[0118] In some embodiments, the image sensor can be controlled to make adjustments based on the adjustment information until the position information of the image sensor is parallel.
[0119] It should be noted that if the target image is a certain video frame of a video stream, through the judgment of step 1403 or step 1404, the position information of the image sensor is updated in real time, improving the leveling efficiency.
[0120] Of course, when the target image is a single picture, based on the judgment of step 1403 or step 1404, the image sensor can also be controlled to obtain the target image again for the target, which can also improve the leveling efficiency.
[0121] In the embodiment of the present application, based on the preset window, the statistical window on the target image can be determined; based on the gray difference of each pixel point in the statistical window, the statistical value of each statistical window can be determined; based on the normalized value of the statistical value of each statistical window, as well as the standard deviation and range for determining the normalized value, the position information output of the image sensor can be realized, improving the accuracy of leveling the image sensor.
[0122] An image sensor leveling method provided by an embodiment of the present application includes Figure 1 、 Figure 3 and Figure 4The process is similar to the method embodiment above in terms of implementation principle and technical effect, and will not be elaborated here.
[0123] In the embodiment of the present application, based on a preset window, a statistical window can be determined on the target image; based on the judgment area corresponding to each pixel point in the statistical window, the gray difference value of each pixel point can be determined, and the statistical value of each statistical window can be determined; based on the normalized value of the statistical value of each statistical window, as well as the standard deviation and range for determining the normalized value, the position information of the image sensor can be output, improving the accuracy of leveling the image sensor.
[0124] Figure 5 It is a schematic structural diagram of a leveling device for an image sensor provided by an embodiment of the present application. As Figure 5 shown, the leveling device 500 for an image sensor provided by the embodiment of the present application includes an acquisition module 501, a statistics module 502, and an output module 503, where:
[0125] The acquisition module 501 is configured to acquire a target image.
[0126] The statistics module 502 is configured to determine a statistical window on the target image based on a preset window, where the position of the preset window includes the central position and the edge position of the imaging area of the image sensor.
[0127] The statistics module 502 is further configured to determine the statistical value of each statistical window, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window.
[0128] The output module 503 is configured to determine the position information of the image sensor based on the statistical value of each statistical window.
[0129] In some embodiments, the output module 503 is configured to determine the position information of the image sensor, including: normalizing the statistical value of each statistical window to determine the normalized value of the statistical value; determining the standard deviation and range of all normalized values; if both the standard deviation and the range meet the preset parallel condition, the position information of the image sensor is parallel.
[0130] After the output module 503 determines the standard deviation and range of all normalized values, it includes: if at least one of the standard deviation and the range does not meet the preset parallel condition, the position information of the image sensor includes the adjustment information of the image sensor.
[0131] In other embodiments, the statistics module 502 is configured to determine the statistical value of each statistical window, including: determining the judgment area of the statistical window, where the judgment area is determined with each pixel point in the statistical window as the target pixel point; based on the judgment area, determining the gray difference value of each target pixel point.
[0132] Among them: The gray-scale difference of each target pixel point includes: obtaining the gray-scale value of each pixel point in the judgment area; determining the gray-scale difference of the target pixel point based on the gray-scale value of the target pixel point and the gray-scale value of the edge pixel points in the judgment area. The gray-scale difference is calculated according to the following formula:
[0133]
[0134] In the formula, V m is the gray-scale difference, d t is the gray-scale value of the target pixel point, d ei is the gray-scale value of the edge pixel point, N is the number of edge pixel points, m is the number of the judgment window, and M is the number of judgment areas in the statistical window.
[0135] In some embodiments, the patterns of the target images corresponding to each statistical window are the same.
[0136] Each module in the above device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0137] The leveling device for an image sensor provided in the embodiments of the present application can be applied to a computer device. The computer device can be a server or a terminal. Among them, the server can be a single server or a server cluster composed of multiple servers. The embodiments of the present application do not make specific limitations in this regard. The terminal can be, but is not limited to, various personal computers, laptop computers, smartphones, tablet computers, and portable devices.
[0138] Figure 6 A schematic structural diagram of a leveling system for an image sensor provided in the embodiments of the present application is shown as Figure 6 shown. The leveling system 600 for an image sensor provided in the embodiments of the present application includes a target 601, an image sensor 602, and a controller 603, where:
[0139] The image sensor 602 is configured to collect the target image of the target 601; among them, the size of the target is larger than the imaging area of the image sensor.
[0140] The controller 603 is communicatively connected to the image sensor 602 and is configured to execute the following processes:
[0141] Receive the target image sent by the image sensor. Based on a preset window, determine the statistical window on the target image, where the position of the preset window includes the central position and the edge position of the imaging area of the image sensor. Determine the statistical value of each statistical window, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window. Based on the statistical value of each statistical window, determine the position information of the image sensor.
[0142] In some embodiments, determining the position information of the image sensor based on the statistical value of each statistical window includes:
[0143] Normalize the statistical value of each statistical window to determine the normalized value of the statistical value; determine the standard deviation and range of all normalized values; if both the standard deviation and the range meet the preset parallel condition, the position information of the image sensor is parallel.
[0144] In some embodiments, after determining the standard deviation and range of all normalized values, the method further includes:
[0145] If at least one of the standard deviation and the range does not meet the preset parallel condition, the position information of the image sensor includes the adjustment information of the image sensor.
[0146] In some embodiments, determining the statistical value of each statistical window, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window, includes:
[0147] Determine the judgment area of the statistical window, where the judgment area is determined with each pixel point in the statistical window as the target pixel point; based on the judgment area, determine the gray difference value of each target pixel point.
[0148] In some embodiments, based on the judgment area, determining the gray difference value of each target pixel point includes:
[0149] Obtain the gray value of each pixel point in the judgment area; based on the gray value of the target pixel point and the gray value of the edge pixel point of the judgment area, determine the gray difference value of the target pixel point. The gray difference value is calculated according to the following formula:
[0150]
[0151] In the formula, V m is the gray difference value, d t is the gray value of the target pixel point, d ei is the gray value of the edge pixel point, N is the number of edge pixel points, m is the number of the judgment window, and M is the number of judgment areas in the statistical window.
[0152] Those skilled in the art can understand, Figure 6The structure shown is only a schematic diagram of some structures related to the solution of this application, and does not constitute a limitation on the application of the solution of this application to other systems. Some of the components can be replaced with devices having the same effect, or different component arrangements.
[0153] The embodiments of this application also provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the processor is caused to execute the steps of the above leveling method for an image sensor. The implementation principle and technical effects are similar to those of the above method embodiments and will not be elaborated here.
[0154] The following paragraphs will list and compare the Chinese terms involved in the specification of this application and their corresponding English terms for easy reading and understanding.
[0155] For ease of explanation, the above description has been made in conjunction with specific embodiments. However, the above discussion in some embodiments is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. According to the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are for better explaining the principles and practical applications, so that those skilled in the art can better use the embodiments and various different modified embodiments suitable for specific use considerations.
Claims
1. A leveling method for an image sensor, characterized in that, Including: Obtain a target image; Based on a preset window, determine a statistical window on the target image, wherein the position of the preset window includes the central position and the edge position of the imaging area of the image sensor; Determine the statistical value of each statistical window, wherein the statistical value is the sum of the gray difference values of each pixel point in the statistical window, including: Determine the judgment area of the statistical window, wherein the judgment area is determined with each pixel point in the statistical window as the target pixel point; Based on the judgment area, determine the gray difference value of each target pixel point, including: Obtain the gray value of each pixel point in the judgment area; Based on the gray value of the target pixel point and the gray value of the edge pixel point of the judgment area, determine the gray difference value of the target pixel point; The gray difference value is calculated according to the following formula: Wherein, V m is the gray difference value, d t is the gray value of the target pixel point, d ei is the gray value of the edge pixel point, N is the number of edge pixel points, m is the number of the judgment window, and M is the number of judgment regions in the statistical window; Based on the statistical value of each statistical window, determine the position information of the image sensor.
2. The leveling method for an image sensor according to claim 1, characterized in that, The determining the position information of the image sensor based on the statistical value of each statistical window includes: Normalize the statistical value of each statistical window to determine the normalized value of the statistical value; Determine the standard deviation and the range of all the normalized values; If both the standard deviation and the range meet the preset parallel condition, the position information of the image sensor is parallel.
3. The leveling method for an image sensor according to claim 2, characterized in that, After determining the standard deviation and the range of all the normalized values, the method further includes: If at least one of the standard deviation and the range does not meet the preset parallel condition, the position information of the image sensor includes the adjustment information of the image sensor.
4. The leveling method for an image sensor according to claim 1, wherein The pattern of the target image corresponding to each statistical window is the same.
5. A leveling device for an image sensor, characterized in that, Including: An acquisition module, configured to obtain a target image; A statistics module, configured to determine a statistical window on the target image based on a preset window, wherein the position of the preset window includes the central position and the edge position of the imaging area of the image sensor; The statistics module is further configured to determine the statistical value of each statistical window, wherein the statistical value is the sum of the gray difference values of each pixel point in the statistical window, including: Determine the judgment area of the statistical window, wherein the judgment area is determined with each pixel point in the statistical window as the target pixel point; Based on the judgment area, determine the gray difference value of each target pixel point, including: Obtain the gray value of each pixel point in the judgment area; Based on the gray value of the target pixel point and the gray value of the edge pixel point of the judgment area, determine the gray difference value of the target pixel point; The gray difference value is calculated according to the following formula: Where, V m is the gray difference value, d t is the gray value of the target pixel, d ei is the gray value of the edge pixel, N is the number of edge pixels, m is the number of the judgment window, and M is the number of judgment regions in the statistical window; An output module, configured to determine the position information of the image sensor based on the statistical value of each statistical window.
6. A leveling system for an image sensor, characterized in that, Including: A target; An image sensor, configured to collect the target image of the target; A controller, communicatively connected to the image sensor and configured to: Receive the target image sent by the image sensor; Based on a preset window, determine a statistical window on the target image, wherein the position of the preset window includes the central position and the edge position of the imaging area of the image sensor; Determine the statistical value of each of the statistical windows, where the statistical value is the sum of the gray difference values of each pixel point in the statistical window, including: Determine the judgment region of the statistical window, where the judgment region is determined with each pixel point in the statistical window as the target pixel point; Based on the judgment region, determine the gray difference value of each target pixel point, including: Obtain the gray value of each pixel point in the judgment region; Based on the gray value of the target pixel point and the gray value of the edge pixel point of the judgment region, determine the gray difference value of the target pixel point; The gray difference value is calculated according to the following formula: Wherein, V m is the gray difference value, d t is the gray value of the target pixel point, d ei is the gray value of the edge pixel point, N is the number of edge pixel points, m is the number of the judgment window, and M is the number of judgment regions in the statistical window; Based on the statistical value of each statistical window, determine the position information of the image sensor; Wherein, the size of the target is larger than the imaging area of the image sensor.
7. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the processor is caused to execute the steps of the leveling method for an image sensor according to any one of claims 1-4.
Citation Information
Patent Citations
Camera inclination angle adjusting method and device, storage medium and camera
CN111385560A
Dead pixel detection method and device, electronic equipment and storage medium
CN113674238A