Horizontal consistency determination method, system, electronic device and computer readable storage medium

By acquiring and processing target images of the gimbal, identifying and calculating its tilt angle, the problem of inaccurate horizontal consistency determination of the gimbal in the prior art is solved, thereby improving the accuracy of determination and production efficiency.

CN121074039BActive Publication Date: 2026-03-27VALUEHD CORP
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technology cannot accurately determine the horizontal consistency of gimbals, leading to unstable product quality during the production process and affecting user experience.

Method used

By acquiring target images containing planar calibration objects, edge detection processing is performed to identify the edge features of grid lines, target horizontal straight lines are selected, the tilt angle of the gimbal is calculated, and the judgment result is output based on the tilt angle.

Benefits of technology

It has improved the accuracy and reliability of gimbal consistency judgment, reduced human error and environmental interference, and improved production testing efficiency and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074039B_ABST
    Figure CN121074039B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of servers, in particular to a horizontal consistency determination method and system, electronic equipment and a computer readable storage medium, the method comprising the following steps: receiving a target image collected by a holder machine, and establishing a standardized horizontal reference coordinate system; performing edge detection processing on a grid line region of a planar calibration object in the target image to obtain edge features of the grid line, and providing clear feature input for horizontal straight line identification; based on the edge features of the grid line and the horizontal straight line corresponding to the grid line, and filtering out a target horizontal straight line located in a middle region of the target image, accurately positioning a real horizontal straight line from the grid line, extracting a position parameter of the target horizontal straight line, calculating an inclination angle of the holder machine based on the position parameter, and converting the inclination state of the holder machine into an angle value that can be accurately measured; and outputting a horizontal consistency determination result of the holder machine according to the inclination angle, so as to output a clear determination result in a unified standard and improve the accuracy of the horizontal consistency determination of the holder machine.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to a horizontal consistency determination method and system, an electronic device and a computer readable storage medium. BACKGROUND

[0002] In the production process of the gimbal, the structural tolerance deviation and the assembly tolerance are easy to cause the slight tilt of the lens of part of the gimbal, and further cause the tilt of the picture after the zoom imaging of the camera. If not effectively controlled, the product will seriously affect the perception of the user, therefore, the precision of the horizontal consistency determination of the gimbal is crucial.

[0003] However, the common determination method has obvious deficiency in precision: through the observation of the human eye on whether the straight line in the video picture is horizontal, the human eye is easy to be interfered by the subject due to the slight tilt deviation of the lens, and it is easy to miss the judgment and cannot accurately identify the tilted product; when the level detector is used for detection, the lens is usually circular, which leads to the difficulty in placing the level detector, and the placement error is easy to occur, so that the detection result is inaccurate; the detection method based on the single horizontal straight line in the video lacks the edge grid assistance, and when the environment changes, it is difficult to accurately distinguish whether the problem is recognized by the software or the deviation is caused by the environment, which is not conducive to accurately positioning the fault, and cannot guarantee the precision of the determination result.

[0004] It can be seen that the precision of the existing determination method is insufficient, which leads to the difficulty in reliably determining the horizontal consistency of the gimbal, and improving the precision of the determination becomes a key problem to be solved.

[0005] The above content is only used to assist in understanding the technical solutions of the present application, and does not mean that the above content is prior art. SUMMARY

[0006] The main purpose of the present application is to provide a horizontal consistency determination method, system, electronic device and computer readable storage medium, which aims to improve the precision of the horizontal consistency determination of the gimbal.

[0007] In order to achieve the above purpose, the present application provides a horizontal consistency determination method, which comprises:

[0008] determining a target image containing a planar calibration object collected by a gimbal;

[0009] performing edge detection processing on the grid line region of the planar calibration object in the target image to obtain the edge features of the grid lines;

[0010] recognizing the horizontal straight line corresponding to the grid line based on the edge features, and selecting a target horizontal straight line located in the middle region of the target image from the horizontal straight line;

[0011] extracting the position parameters of the target horizontal straight line, and calculating the tilt angle of the gimbal based on the position parameters.

[0012] The horizontal consistency determination result of the gimbal is output according to the tilt angle.

[0013] In addition, to achieve the above object, the application further provides a horizontal consistency determination system, which comprises a gimbal, a fixed support, a detection table and a horizontal sensor, the gimbal is connected with the fixed support, the detection table and the horizontal sensor, and the gimbal comprises:

[0014] An image receiving module is configured to determine a target image containing a planar calibration object collected by the gimbal.

[0015] A feature extraction module is configured to perform edge detection processing on a grid line region of the planar calibration object in the target image to obtain edge features of the grid lines.

[0016] A straight line screening module is configured to identify horizontal straight lines corresponding to the grid lines based on the edge features, and screen out target horizontal straight lines located in a middle region of the target image from the horizontal straight lines.

[0017] An angle calculation module is configured to extract position parameters of the target horizontal straight lines, and calculate a tilt angle of the gimbal based on the position parameters.

[0018] A result output module is configured to output a horizontal consistency determination result of the gimbal according to the tilt angle.

[0019] The various functional modules of the gimbal of the application implement the steps of the horizontal consistency determination method of the application as described above when running.

[0020] In addition, to achieve the above object, the application further provides a horizontal consistency determination device, which comprises a memory, a processor and a horizontal consistency determination program stored in the memory and executable on the processor, and the steps of the horizontal consistency determination method are implemented when the horizontal consistency determination program is executed by the processor.

[0021] In addition, to achieve the above object, the application further provides a computer readable storage medium, which is a computer readable storage medium, and the horizontal consistency determination program is stored on the computer readable storage medium, and the steps of the horizontal consistency determination method are implemented when the horizontal consistency determination program is executed by the processor.

[0022] The application provides a horizontal consistency determination method. The application determines a target image containing a planar calibration object collected by a holder machine, establishes a standardized horizontal reference coordinate system, provides quantifiable reference basis for subsequent tilt angle calculation, and ensures stability and consistency of the determination reference. The application performs edge detection processing on the grid line area of the planar calibration object in the target image to obtain edge features of the grid lines, provides clear and stable feature input for horizontal line identification, and reduces the interference of non-grid line areas on the detection result. The application identifies the horizontal lines corresponding to the grid lines based on the edge features, and selects target horizontal lines located in the middle area of the target image from the horizontal lines to accurately locate the real horizontal lines from the grid lines, avoid the interference of distorted area lines on the tilt angle calculation, and ensure the geometric parameter accuracy of the selected lines. The application extracts the position parameters of the target horizontal lines, calculates the tilt angle of the holder machine based on the position parameters, converts the tilt state of the holder machine into an accurately measurable angle value, and provides objective and quantitative numerical basis for horizontal consistency determination. The application outputs the horizontal consistency determination result of the holder machine according to the tilt angle, outputs clear determination results based on a unified threshold standard, provides clear and executable operation basis for holder machine calibration in the production process, and further improves the accuracy of the horizontal consistency determination of the holder machine.BRIEF DESCRIPTION OF DRAWINGS DETAILED DESCRIPTION OF THE INVENTION BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 FIG. 1 is a flowchart of a first embodiment of the horizontal consistency determination method of the application.

[0024] Figure 2 FIG. 3 is a schematic diagram of a planar calibration object with grid lines related to the application.

[0025] Figure 3 FIG. 6 is a flowchart of the horizontal consistency determination method of the holder machine related to the application.

[0026] Figure 4 FIG. 9 is a structural schematic diagram of the horizontal consistency determination system related to the embodiment scheme of the application.

[0027] Figure 5 FIG. 11 is a structural schematic diagram of the electronic device related to the embodiment scheme of the application.

[0028] The implementation, functional features and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE INVENTION

[0029] The application provides a horizontal consistency determination method. Referring to Figure 1 , FIG. 1 is a flowchart of a first embodiment of the horizontal consistency determination method of the application. Figure 1

[0030] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, like reference numerals refer to like elements, unless indicated otherwise. The implementations described in the following exemplary embodiments are not meant to represent all implementations consistent with the present disclosure.

[0031] As the core equipment supporting the rotation of the lens, the transmission structure (such as double arms or single arm) of the gimbal is prone to cause the lens to tilt slightly due to the deviation of the incoming material and the assembly tolerance, and then make the imaging picture of the camera tilt, which affects the user's perception. How to quickly and accurately determine the horizontal consistency of the gimbal and provide the basis for rework is a key difficulty in current production detection.

[0032] The current human eye observation processing method is to check whether the straight line in the video picture is horizontal through artificial observation, but the lens tilt deviation is small, the interference factors of human subjective judgment are large, and the missed judgment is easy to occur. The processing method based on the level is to directly place it on the lens surface for detection, and the level is unstable due to the circular structure of the lens, and positioning error is easy to occur. The processing method based on a single horizontal straight line in the video is to judge the horizontal state only by a single line, which lacks a unified reference standard. When the environment (such as light, shooting angle) changes, it is difficult to locate the error link (such as software recognition exception or environmental interference), and it is difficult to efficiently troubleshoot problems. These processing methods cannot meet the accurate and efficient horizontal consistency determination requirements, and restrict the production and detection efficiency and product quality of the gimbal. Accordingly, the present application provides a horizontal consistency determination method, system, electronic device and computer readable storage medium to realize the accuracy of horizontal consistency determination of the gimbal.

[0033] It should be noted that the execution subject of the present embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, a database system, etc., or a device capable of realizing the above functions, such as a horizontal consistency determination device. The present embodiment and the following embodiments will be described below taking the horizontal consistency determination device as an example.

[0034] The horizontal consistency determination method of the present application comprises the following implementation steps S10 to S50.

[0035] Step S10: determining a target image containing a planar calibration object collected by the gimbal;

[0036] In the present embodiment, as an example, the application scenarios can be the assembly horizontal consistency batch detection scene before the mass production of the gimbal and the horizontal calibration detection scene when the gimbal is repaired after sale.

[0037] Optionally, the gimbal machine refers to a device that supports the lens with a double-arm or single-arm transmission structure and can drive the lens to rotate. It is the object of the horizontal consistency test in this application. The plane calibration object refers to a plane carrier with grid lines drawn on its surface. In this embodiment, a 1m x 1m piece of white paper is preferred. Before use, it needs to be calibrated to be horizontal with a level and a fixed bracket. The target image is a JPEG image collected by the gimbal machine that contains the grid line area of ​​the plane calibration object.

[0038] Optionally, a 1m x 1m piece of white paper with grid lines is attached to the wall using a fixed bracket. A level is used to check the tilt of the paper. If the tilt exceeds ±0.1°, the bracket height is adjusted (e.g., raising the right side and lowering the left side) until the level displays "level," thus obtaining a level calibration object. A fixed testing platform is placed at a production line station. The height is adjusted using the platform's built-in leveling components (e.g., a manual knob), while a level sensor collects data on the platform's level status (e.g., tilt angle). This data is compared to a preset platform threshold (level error ≤ 0.1mm), and adjustments are made continuously until the data meets the standard, thus obtaining a level calibration object. The target inspection platform is used to place the gimbal to be inspected on the inspection platform. The gimbal is manually pushed to a distance of 1m from the flat calibration object. The preview screen is viewed through the PC tool. The gimbal lens is manually rotated. When the white paper grid lines are fully displayed in the screen and there is no background such as walls or the edge of the inspection platform, the "Acquire" button is clicked in the PC tool to trigger the gimbal to capture a JPEG image. This image is the target image containing the flat calibration object. This eliminates the image deviation caused by "calibration object tilt" and "uneven inspection platform" in mass production scenarios, providing stable raw data for subsequent batch inspections and helping the production line reduce the gimbal tilt defect rate from 2% to 0.

[0039] Optionally, take a 0.5m x 0.5m plastic board with grid lines, fix it with a portable bracket, and attach a mini level to the surface of the plastic board. If the bubble in the level is off-center, adjust the angle of the bracket (e.g., bend the bracket legs) until the bubble is centered, thus obtaining a level calibration object. Unfold the foldable portable testing platform and place it on the after-sales site table. Observe the level using the built-in bubble level on the platform. Manually adjust the height of the platform legs until the bubble is centered, thus obtaining a level portable testing platform. Place the refurbished pan-tilt unit on the table. Carry the testing platform and push it to a distance of 0.5m from the plastic plate (for small-sized calibration objects). Turn on the "automatic preview" function of the PTZ camera. The PTZ camera lens will automatically focus. When the grid lines of the plastic plate are fully displayed in the preview image, the PTZ camera will automatically trigger acquisition and generate a JPEG target image. Automatic preview and acquisition reduce the operation steps of after-sales personnel, avoid incomplete images due to human error, and ensure that the target image can accurately reflect the tilt state of the PTZ camera being repaired, providing reliable data for subsequent accurate judgment and correction.

[0040] like Figure 2 As shown,Figure 2 For the schematic diagram of the plane calibration object with grid lines involved in the present embodiment, the plane calibration object is white paper with grid lines drawn on the surface, and the grid lines provide a uniform horizontal reference for horizontal consistency determination. Before use, the horizontal degree of the plane calibration object needs to be adjusted through the fixing support. If the inclination exceeds the preset calibration threshold, the fixing support needs to be adjusted until the horizontal degree meets the preset reference, so that the plane calibration object becomes a horizontal standard plane calibration object, thereby providing a reference object with stable horizontal properties for subsequent target image acquisition.

[0041] Step S20: performing edge detection processing on the grid line region of the plane calibration object in the target image to obtain edge features of the grid lines;

[0042] Optionally, the grid line region refers to a region where the grid lines of the plane calibration object are completely displayed in the target image without background interference, and is the only processing object of edge detection. The edge detection processing refers to an automatic process of sequentially performing grayscale conversion, denoising, and edge extraction on the grid line region in the target image. The core algorithm in the present embodiment is the Canny algorithm. The edge features refer to the core information of the grid lines extracted by detection, and at least include the contour boundary and the line direction. The Gaussian filter refers to a processing means for weakening the noise in the grid line region, which smoothes the pixel grayscale through the filter kernel and is used in conjunction with edge detection.

[0043] Optionally, the cv::cvtColor function of OpenCV is called first to convert the target image into a grayscale image to eliminate color interference. Then, 3x3 kernel Gaussian filtering is used for denoising to weaken the slight bright spots under fixed illumination, so that the grid line grayscale transition is uniform. Finally, the Canny algorithm (such as threshold 50, 150, apertureSize=3) is executed to screen strong edges (gradient>150) and connected weak edges (50-150), extract continuous grid line contour boundaries and clear line direction information, and obtain edge features. This method is suitable for fixed illumination environment of the production line. The 3x3 kernel and Canny parameters are tested and verified by 50 pan-tilt machines. After denoising, the edge has no breakpoints, the edge feature extraction accuracy is high, non-grid region interference is avoided, the processing time of a single image is ≤0.3 seconds, which meets the characteristics of “fast algorithm running and low performance consumption”, and provides reliable input for subsequent horizontal straight line recognition.

[0044] Optionally, the grayscale image is further adjusted according to real-time illumination to adjust the Gaussian filter kernel (for example, a 5*5 kernel is used to enhance de-noising when the illumination is strong, and a 3*3 kernel is maintained when the illumination is weak), to avoid the influence of strong light spots or weak light noise; finally, the Canny threshold is dynamically adjusted (for example, 60, 160 when the illumination is strong, and 40, 140 when the illumination is weak), to ensure that effective edges can be screened out under different illuminations, to extract complete contour boundaries and accurate line directions, to obtain edge features, to adapt to illumination fluctuation scenes through parameter dynamic adjustment for the problem of “illumination influence recognition”, the success rate of edge feature extraction is greatly improved, without manual intervention, and the single processing time is still less than or equal to 0.5 seconds, which balances adaptability and efficiency, and adapts to the illumination change requirements of after-sales or temporary detection scenes.

[0045] Step S30: identifying a horizontal straight line corresponding to the grid line based on the edge features, and screening a target horizontal straight line located in the middle region of the target image from the horizontal straight line;

[0046] Optionally, the edge features refer to core information extracted from the grid line region by an edge detection algorithm, and at least include the contour boundary (distinguishing the continuous line of the grid line from the background) and the line direction (represented by the angle parameter between the line segment and the horizontal direction) of the grid line; the horizontal straight line corresponding to the grid line refers to an edge line segment selected from the edge features, whose direction parameter falls within a preset horizontal angle range (for example, 0°±5°); the middle region of the target image refers to a rectangular region with a total area of 30% to 50% of the image, whose long side is parallel to the horizontal direction of the image, and whose center is calculated based on the geometric center of the target image (for example, the center coordinates are (960, 540) when the resolution is 1920*1080); and the target horizontal straight line refers to a straight line further selected from the horizontal straight line corresponding to the grid line, whose midpoint falls within the middle region and whose continuous length exceeds a preset threshold (for example, 50 pixels).

[0047] Optionally, the direction parameter (the angle with the horizontal direction) of each edge line segment is extracted from the edge features, and the line segment with an angle falling within the range of 0°±5° is determined as the horizontal straight line corresponding to the grid line; then, a middle region with a total area of 40% is demarcated based on the geometric center of the target image (for example, a rectangle corresponding to x-axis 480-1440 and y-axis 324-756 for a 1920*1080 image); finally, the midpoint coordinates of each horizontal straight line are calculated, and the straight line with a midpoint in the middle region and a continuous length greater than or equal to 50 pixels is selected as the target horizontal straight line; this method is suitable for fixed resolution device detection scenes, the horizontal straight line recognition accuracy is above 96%, the demarcation of the middle region effectively avoids the line deviation caused by lens edge distortion, the angle calculation error of the target horizontal straight line after screening is less than 1%, and the single step processing time is less than or equal to 0.2 seconds, which can meet the efficiency requirements of batch detection.

[0048] Optionally, first, the going parameter is extracted according to the same logic as the first embodiment, and the horizontal straight line corresponding to the grid line is screened out; then, the intermediate area ratio is dynamically adjusted according to the target image resolution - the low resolution image (such as 720*480) is set to 50%, and the high resolution image (such as 2K and above) is set to 30%, to ensure that there is a sufficient number of effective lines in the intermediate area; finally, the length threshold is adjusted according to the resolution ratio (such as 30 pixels for low resolution and 50 pixels for high resolution), and the straight line with the midpoint in the intermediate area and the length meeting the standard is screened out as the target horizontal straight line; this method adapts to the variable resolution scene of multiple models of equipment, and the dynamic parameter adjustment solves the misjudgment problem of fixed parameters under different resolutions, and the horizontal straight line recognition success rate is improved from 85% to 95%, the single-step processing time is ≤0.3 seconds, no manual intervention is required, and it can adapt to diversified detection needs.

[0049] Step S40: Extract the position parameter of the target horizontal straight line, and calculate the tilt angle of the holder machine based on the position parameter;

[0050] Optionally, the position parameter of the target horizontal straight line refers to the data extracted from the target horizontal straight line, which represents the spatial position of the target horizontal straight line in the pixel coordinate system; the pixel coordinate system: a two-dimensional coordinate system with the upper left corner of the target image as the origin (0, 0), the horizontal right as the positive direction of the x-axis, and the vertical downward as the positive direction of the y-axis, and the coordinate unit is pixel; the slope: a quantitative value reflecting the tilt degree of the target horizontal straight line, which is calculated by two endpoint coordinates, the formula is k=(y2-y1) / (x2-x1), the positive and negative values represent the tilt direction (k>0 right tilt, k<0 left tilt), and the absolute value represents the tilt degree; the tilt angle of the holder machine: a value completely consistent with the tilt angle of the target horizontal straight line, the unit is degree (°), and it is a key indicator for determining the horizontal consistency of the holder machine.

[0051] Optionally, first, the pixel coordinates of the two endpoints (such as x1=200, y1=540, x2=1720, y2=545) are read from the target horizontal straight line, to ensure that the coordinate extraction accuracy reaches the pixel level (such as error <1 pixel); then, the slope formula k=(545-540) / (1720-200)=5 / 1520≈0.0033 is substituted, and the extreme case of x2=x1 is avoided during calculation (such as x2-x1 is always greater than 50 pixels due to the sufficient horizontal span of the target horizontal straight line); then, through angle conversion logic, about 0.0033 radians is obtained by arctan(0.0033), which is converted to an angle value of about 0.189°, which is the tilt angle of the holder machine; this method adapts to the detection of holder machines with fixed resolution (such as 1920*1080), the position parameter extraction does not require additional calibration, the slope calculation is unbiased, the angle conversion time is ≤0.1 seconds, and a single device only needs 0.3 seconds from parameter extraction to angle derivation, which adapts to the batch detection needs of the production line, and the angle calculation error is <0.2°, ensuring the accuracy of the judgment.

[0052] Optionally, the pixel coordinate system of the target image is normalized (divide the x-axis and y-axis coordinates by the image width and height respectively to convert them into normalized coordinates between 0 and 1), and then the normalized end point coordinates (such as x1'=0.104, y1'=0.5, x2'=0.896, y2'=0.505) are extracted from the target horizontal straight line; the normalized slope formula k'=(0.505-0.5) / (0.896-0.104)=0.005 / 0.792≈0.0063 is substituted; then the inclination angle ≈0.361° is calculated through the angle conversion logic, which is the inclination angle of the gimbal; this method solves the coordinate measurement difference problem of different resolutions (such as 720×480, 2K) of the gimbal through normalization, avoids the slope calculation deviation caused by different resolutions, and the inclination angle calculation error is <0.3°, which is suitable for multiple model gimbal detection scenarios, and the normalization process takes ≤0.1 seconds, the overall processing efficiency still meets the batch detection demand, and the scheme versatility is improved.

[0053] Step S50: output the horizontal consistency determination result of the gimbal according to the inclination angle.

[0054] Optionally, the inclination angle refers to a quantitative value reflecting the real inclination state of the gimbal calculated by the target horizontal straight line position parameter; the preset horizontal determination threshold refers to a pre-set angle standard for determining whether the gimbal is horizontal or not, which is determined based on batch testing; the horizontal consistency determination result refers to a conclusion obtained by comparing the inclination angle with the preset threshold.

[0055] Optionally, the horizontal consistency determination result of the gimbal is output according to the inclination angle, and the steps are as follows: first, the inclination angle of the gimbal (such as "0.8°" and "1.2°") is obtained from the calculation module; then the absolute value of the angle is automatically compared with the preset horizontal determination threshold (1%); if the absolute value of the angle is <1% (such as 0.8°), it is determined that the horizontal consistency is "consistent", and if the absolute value of the angle is ≥1% (such as 1.2°), it is determined that the horizontal consistency is "inconsistent" and the inclination direction is marked (such as "1.2° right tilt"); finally, a simple version of the determination report is generated, which contains the equipment number, the inclination angle, and the determination result, and is synchronized to the production line board through the communication interface; the qualified equipment enters the next process, and the unqualified equipment triggers the "to be repaired" mark; this implementation is suitable for batch detection on the production line, the comparison process does not require manual intervention, the time consumption for single determination is ≤0.2 seconds, the subjective misjudgment of the human eye is avoided, the batch verification data combined with the threshold reduce the unqualified product leakage rate from 2% to 0, and the report synchronization to the board realizes the visualization of the production line flow, and the overall detection efficiency is improved.

[0056] Optionally, the tilt angle of the returned gimbal is first obtained (such as "-0.9°" and "1.1°"), the preset horizontal determination threshold can be fine-tuned within 0.8%-1.2% (such as 1.2% for old equipment) considering the flexibility of the after-sales scene; compared with the adjusted threshold, if the absolute value of the angle is less than the threshold (such as -0.9°<1.2%), it is determined that the "horizontal consistency" is consistent, and the assembly tilt problem is excluded, if the absolute value of the angle is greater than or equal to the threshold (such as 1.1°≥1.2% is not true, and 1.3°≥1.2% is true), it is determined that the "horizontal inconsistency" and the tilt direction (such as "left tilt 0.9°") is marked; finally, a determination report with correction suggestions (such as "left tilt 0.9°, suggest raising the height of the left transmission arm") is generated and sent to the returned terminal through the communication interface; the implementation of the present embodiment adapts to the diversified needs of after-sales through threshold fine-tuning, and the correction suggestion directly guides the returned operation, avoiding blind debugging, so that the returned efficiency is improved by 40%, and at the same time, the report can be stored in a non-transitory computer readable storage medium, which is convenient for subsequent tracing, and meets the precision and traceability requirements of the after-sales scene.

[0057] The embodiment receives the target image collected by the gimbal, establishes a standardized horizontal reference coordinate system; performs edge detection processing on the grid line region of the planar calibration object in the target image to obtain the edge features of the grid lines, and provides clear feature input for horizontal straight line identification; based on the edge features of the grid lines and the horizontal straight lines corresponding to the grid lines, and filtering out the target horizontal straight line located in the middle region of the target image, the real horizontal straight line is accurately positioned from the grid lines; the position parameters of the target horizontal straight line are extracted, and the tilt angle of the gimbal is calculated based on the position parameters, so that the tilt state of the gimbal is converted into an angle value that can be accurately measured; the horizontal consistency determination result of the gimbal is output according to the tilt angle, the clear determination result is output based on the unified threshold standard, and the horizontal consistency determination accuracy of the gimbal is improved.

[0058] Further, based on the above content, a second embodiment of the horizontal consistency determination method of the present embodiment is proposed. In some feasible embodiments, after the above step S10, the following implementation step B201 is further included.

[0059] Step B201: when it is detected that the display area proportion of the planar calibration object in the target image is greater than or equal to a preset proportion threshold, the step of performing edge detection processing on the grid line region of the planar calibration object in the target image is performed.

[0060] Optionally, the target image is subjected to integrity check, which needs to rely on PC tool to call the relevant modules of OpenCV library to execute: first, the pixel area of the planar calibration object is separated from the target image through color threshold segmentation (using the gray difference between white paper and background, such as white paper gray value > 220, background gray value < 180); then the findContours function is used to extract the contour of the calibration object, the pixel area enclosed by the contour (i.e. the display area of the calibration object) is calculated, and the actual proportion is obtained by substituting the proportion formula; for example, the total pixels of the target image are 2073600, the display pixel area of the calibration object is 1866240, the actual proportion is calculated to be 90%, compared with the preset proportion threshold (90%), it is determined that the check is passed; if the actual proportion is only 70%, the check is not passed, and the PC tool sends a "reacquisition" instruction to the gimbal through the communication interface to control the gimbal to adjust the lens angle until the image proportion acquired is greater than or equal to the threshold value, so as to avoid invalid images entering the subsequent processing.

[0061] Optionally, when the display area proportion of the planar calibration object is greater than or equal to the preset proportion threshold, the edge detection processing step is triggered: the PC tool automatically calls the Canny edge detection algorithm (parameters 50, 150, apertureSize = 3, which is the optimal value for the same scene test), and only extracts the edges of the segmented calibration object pixel area (i.e. the grid line area), without processing the non-calibration object area, reducing invalid calculation. In this process, the integrity check passes the quantitative proportion to exclude images with incomplete calibration object display, avoiding the problem of "not enough straight lines to extract" in subsequent edge detection due to insufficient grid line features - production line test data shows that when directly processing without checking, about 30% of the images fail in edge detection due to incomplete calibration object display, and after adding the check, the failure rate is reduced to less than 0.5%, significantly improving the overall detection efficiency. The preset proportion threshold is set to an adjustable range of 80% to 95%, which fills the entire screen and can also cope with different size calibration objects (such as 0.5mx0.5m calibration object for small gimbal), at this time, only the threshold needs to be adjusted to 80%, which can ensure that the grid line feature quantity is sufficient, and the flexibility of adjusting the carrier size according to needs is achieved, avoiding the scene limitation caused by fixed threshold.

[0062] Meanwhile, the edge detection is triggered again after the verification, which can accurately focus on the grid line area and exclude the interference of background sundries. If the verification is not performed, the bright spots in the background may be misjudged as the edges of the grid lines, resulting in invalid lines mixed in the subsequent horizontal straight line recognition. The embodiment filters such interference in advance through the verification, so that the effective feature extraction rate of the edge detection is improved to more than 98%, which provides high-quality feature input for the subsequent recognition of the horizontal straight line and calculation of the inclination angle, and indirectly ensures the accuracy of the horizontal consistency determination. In addition, the re-acquisition instruction when the verification fails is automatically transmitted through the communication interface, without the need for manual observation of the image integrity, which reduces human operation errors and improves the automation level of image acquisition, thereby meeting the efficient needs of production line batch detection.

[0063] Optionally, the related verification logic (proportion calculation, threshold comparison) of the embodiment can be stored in a non-transitory computer-readable storage medium, integrated into a hardware module of the detection table, and form a coherent technical chain with the subsequent edge detection and straight line recognition steps, thereby providing a pre-protection for the reliability of the overall technical solution.

[0064] Further, based on the above, in some feasible embodiments, the preset verification algorithm includes a unit root test algorithm and a periodic feature detection algorithm, and the step S20 includes the following implementation steps C301-C302.

[0065] Step C301: locating the grid line area of the planar calibration object in the target image, and performing Gaussian filter denoising processing on the located grid line area to obtain a denoised grid line area.

[0066] Step C302: performing edge detection on the denoised grid line area to extract edge features of the grid lines, wherein the edge features at least include contour boundaries and line direction information of the grid lines.

[0067] Optionally, the grid line area is located by a gray threshold segmentation method. The target image needs to be converted into a gray image first, and then a preset gray threshold range (grid line 100-150, white paper >220) is set. The pixels with a gray value within 100-220 are marked as "valid area" by the threshold function, and the external background (such as wall stains) with a gray value <100 is marked as "invalid area". The valid area is the located grid line area. In this process, the threshold range can be adjusted according to the light (such as adjusted to 90-160 on cloudy days), which is suitable for the scene where the light affects the gray value and avoids the misjudgment of the grid line as the background due to the increase of the grid line gray value to 160 caused by the strong light. At the same time, only the valid area is processed to exclude the interference of external sundries, so that the false detection rate of the subsequent edge detection is reduced from 15% (when not located) to less than 3%, and the processing pertinence is improved.

[0068] Optionally, the positioned grid line region is subjected to Gaussian filter denoising processing, a GaussianBlur function is called to select a 3*3 filter kernel, and for each pixel in the region, a weighted average value of 8 surrounding pixels is calculated according to a Gaussian function (the center pixel has the highest weight, and the edge pixel has the lowest weight); for example, the gray value of a certain pixel is 240 due to light spot, the gray value of the surrounding pixels is 220, and after filtering, the gray value of the pixel is 225, the difference with the surrounding is reduced, and the gray value fluctuation caused by uneven light is weakened; after denoising, the edge of the grid line has no noise breakpoint, the continuity rate is increased from 70% (before denoising) to more than 95%, noise is avoided from being misjudged as a grid line edge in subsequent edge detection, and a foundation is laid for extracting continuous edge features; and the 3*3 filter kernel processing of a 1920*1080 image only takes 0.2 seconds, which is suitable for production line batch detection (single gimbal machine detection time ≤1 second).

[0069] Optionally, an edge detection algorithm is used to extract edge features, and a Canny algorithm is used to process the denoised region, with parameters set to a low threshold of 50, a high threshold of 150, and apertureSize=3: in the first step, a Sobel operator is used to calculate pixel gradients, a gradient value > 150 is a strong edge (clear boundary of the grid line), a gradient value of 50-150 and connected with the strong edge is a weak edge (fuzzy boundary of the grid line), and the two are combined as the contour boundary of the grid line; in the second step, a gradient direction parameter is used to judge the line direction, and an angle of 0°±5° is classified as a horizontal direction, and an angle of 90°±5° is classified as a vertical direction; this parameter combination is determined by “50 gimbal machine test” — if the low threshold < 50, more noise edges will be introduced; if the high threshold > 150, weak edges will be missed, and 50 / 150 can balance the accuracy and integrity, the contour boundary extraction accuracy reaches 98%, the line direction judgment error is < 1°, and clear and accurate feature input is provided for subsequent recognition of horizontal straight lines, this step has no subjective error, and the manual omission rate is reduced from 2% to 0.5% or less.

[0070] Optionally, the related algorithms (segmentation, filtering, edge detection) of the embodiment can be stored in a non-transitory computer readable storage medium, integrated in a PC tool or a detection table hardware, combined with the image acquisition function of the gimbal machine at the hardware level, and form a closed loop of “acquisition-positioning-denoising-feature extraction”; through this process, the problem that the edge extraction is easily disturbed and the features are incomplete in the prior art is effectively solved, high-quality input is provided for subsequent horizontal straight line recognition, the precision of the gimbal machine horizontal consistency judgment is indirectly improved, and the processing efficiency is also considered, which is suitable for production scene requirements.

[0071] Further, based on the above content, in some feasible embodiments, the steps of step S30 further include the following implementation steps D401 to D403.

[0072] Step D401: based on the direction parameter of each edge line segment in the grid line extracted from the edge feature, the edge line segment with the direction parameter falling into the preset horizontal angle range is determined as the horizontal straight line corresponding to the grid line;

[0073] Step D402: taking the geometric center of the target image as the reference, a rectangular region with a preset proportion of the total area of the target image is determined as the intermediate region, wherein the long side of the rectangular region is parallel to the horizontal direction of the target image.

[0074] Step D403: from the horizontal straight line, the straight line with the midpoint of the line segment falling into the intermediate region and the continuous length of the line segment exceeding the preset length threshold is selected as the target horizontal straight line.

[0075] Optionally, the direction parameter refers to the quantitative data extracted from the edge feature of the grid line, which represents the inclined direction of the edge line segment; the preset horizontal angle range refers to the angle interval preset for determining the edge line segment as a "horizontal straight line", which is set to 0°±5° in the embodiment; the horizontal straight line corresponding to the grid line refers to the edge line segment with the direction parameter falling into the preset horizontal angle range (such as 0°±5°) and the continuous length exceeding the minimum threshold (such as 30 pixels), which is extracted by the Hough LinesP algorithm (such as the parameters threshold=50, minLineLength=50, maxLineGap=110); the geometric center of the target image refers to the center coordinates calculated based on the resolution of the target image.

[0076] Optionally, the intermediate region refers to a rectangular region with a preset proportion (such as 30%-50%) of the total area of the image, with the long side parallel to the horizontal direction of the image, and the geometric center of the target image as the center; the preset proportion refers to the proportion of the intermediate region to the total area of the target image, which is optionally set to 30%-50% based on the need to avoid edge distortion, and preferably 40% in the embodiment; the midpoint of the line segment refers to the average value of the two end point coordinates of the horizontal straight line; the preset length threshold refers to the minimum line segment length for determining the "continuous and effective" horizontal straight line, with the unit of pixels, which is set to 50 pixels based on the minLineLength=50 parameter of the Hough LinesP algorithm and the need to avoid segmented straight lines.

[0077] Optionally, the edge feature based on the grid line extracts the direction parameter of each edge line segment, which needs to be calculated by the Sobel operator first to calculate the gradient direction of the edge line segment (reflecting the line direction), and then convert the gradient direction into the angle with the positive direction of the x-axis (i.e. the direction parameter); then compare the direction parameter with the preset horizontal angle range (0°±5°), if the angle is in the range of 0°-5° or 355°-360° (i.e. 0°±5°), and the continuous length of the line segment is ≥30 pixels (the minimum screening threshold), then the edge line segment is determined as the horizontal straight line corresponding to the grid line; in this process, the preset horizontal angle range is determined by 50 different models of PTZ camera test - if the range is narrower than 0°±3°, the slightly inclined horizontal grid line will be missed; if it is wider than 0°±7°, the inclined line will be mixed, 0°±5° can reduce the missed judgment rate of horizontal straight line from 12% to less than 3%, at the same time, it can exclude the interference of vertical and inclined grid lines, and ensure that the candidate straight line is only in the horizontal direction, which lays the foundation for subsequent screening.

[0078] Optionally, the geometric center of the target image is used as the reference to determine the middle region, which needs to calculate the image geometric center (such as (960, 540) for a 1920x1080 image), and then calculate the boundary of the rectangular region according to the preset proportion (such as 40%): the horizontal boundary is the geometric center x coordinate ± (image width x preset proportion / / 2), and the vertical boundary is the geometric center y coordinate ± (image height x preset proportion / / 2); for example, for a 1920x1080 image, the horizontal boundary is 960 ± (1920x40% / / 2) = 960 ± 384, i.e. 480-1440; the vertical boundary is 540 ± (1080x40% / / 2) = 540 ± 216, i.e. 324-756, and the rectangular region is the middle region; the straight line of the lens edge will be distorted, and the upper and lower edge parts will be tilted, and the straight line in the middle of the picture will be the straightest, so this area can avoid edge distortion, and the geometric form of the straight line in the area deviates from the real horizontal straight line by <0.5°, which is much lower than the 3°-5° deviation of the edge area, providing an exclusive area for subsequent screening of high-precision horizontal straight lines.

[0079] Optionally, the target horizontal straight line is screened from the horizontal straight lines, which needs two steps to be executed: in the first step, the midpoint of the line segment of each horizontal straight line ((x1+x2) / / 2, (y1+y2) / / 2) is calculated, and it is judged whether the midpoint falls within the boundary range of the middle area, if it falls, the next step is entered, otherwise it is excluded (because the straight line with the midpoint in the edge area is easy to be affected by distortion); in the second step, it is verified whether the continuous length of the horizontal straight line exceeds the preset length threshold (50 pixels), if it exceeds, it is determined as the target horizontal straight line, otherwise it is excluded (because the line segment shorter than 50 pixels may be a segmented noise). For example, the end points of a horizontal straight line are (500, 500) and (1400, 510), the midpoint is (950, 505) (falls within the range of 480-1440 and 324-756), and the continuous length is about 900 pixels (> 50 pixels), so it is determined as the target horizontal straight line. The screening process can ensure that the target horizontal straight line has both “no distortion” (the midpoint is in the middle area) and “continuity” (the length meets the standard), and the angle calculation error is reduced from 8% (without screening) to below 1.5%, which provides high-quality data for subsequent calculation of the tilt angle of the holder based on the position parameters. After the screening, the client failure rate is reduced from 2% to 0, which significantly improves the determination accuracy.

[0080] Optionally, the entire process of the embodiment does not require human intervention, and the single image processing time is ≤0.3 seconds, which meets the characteristics of fast algorithm running speed and low performance consumption, and is suitable for batch detection requirements of the production line. Finally, through the link of “accurate screening-low error calculation-reliable determination”, the determination accuracy and efficiency of the holder horizontal consistency are improved.

[0081] Further, based on the content of any of the above embodiments, in some feasible embodiments, the step S40 further includes the following implementation steps E501-E503.

[0082] Step E501: Extract the coordinates of two different end points on the target horizontal straight line as position parameters, wherein the two end point coordinates are the first end point horizontal coordinate and the first end point vertical coordinate of the target horizontal straight line in the target image pixel coordinate system, and the second end point horizontal coordinate and the second end point vertical coordinate;

[0083] Step E502: Obtain the slope of the target horizontal straight line by dividing the difference between the second end point vertical coordinate and the first end point vertical coordinate by the difference between the second end point horizontal coordinate and the first end point horizontal coordinate;

[0084] Step E503: Input the slope into a preset tilt angle function, and output the tilt angle of the holder.

[0085] Optionally, the position parameter of the target horizontal straight line refers to core data extracted from the target horizontal straight line and representing the spatial position of the target horizontal straight line in a target image pixel coordinate system; the target image pixel coordinate system refers to a two-dimensional coordinate system used for locating the position of a pixel in a target image; and the preset inclination angle function refers to a mathematical method for converting a slope into an actual inclination angle, which is implemented by using an arctangent function (arctan) in this embodiment.

[0086] Optionally, the two end point coordinates of the target horizontal straight line are extracted as the position parameter, and the line segment extraction interface of the OpenCV library is called by relying on the PC to read the end point coordinates (x1, y1) and (x2, y2) from the selected target horizontal straight line (closest_line). This process is fully automated and does not require manual reading or estimation. Compared with the detection based on a level meter (which is difficult to place due to the circular structure of the lens and is prone to errors), the process avoids the subjectivity of human operation and positioning errors, so that the extraction accuracy of the position parameter reaches the pixel level (error < 1 pixel), provides accurate raw data for subsequent slope calculation, and reduces the subsequent calculation deviation caused by data ambiguity.

[0087] Optionally, the slope of the target horizontal straight line is obtained by dividing the difference between the second end point vertical coordinate and the first end point vertical coordinate by the difference between the second end point horizontal coordinate and the first end point horizontal coordinate. When calculating, it is necessary to first determine whether (x2-x1) is 0 (to avoid division by zero). Since the target horizontal straight line is a horizontal line segment, its horizontal span (x2-x1) is much larger than the vertical offset (y2-y1), so (x2-x1) is always greater than a preset minimum threshold (such as 50 pixels, which matches the minLine Length=50 of the Hough LinesP algorithm), ensuring the validity of the calculation. For example, the end points of the target horizontal straight line are (200, 540) and (1720, 545), and the slope k=(545-540) / (1720-200)=5 / 1520≈0.0033. This slope value quantitatively reflects the inclination degree of the straight line. Compared with "observing whether the straight line is horizontal by the human eye", the abstract "inclination feeling" is converted into a concrete numerical value, making the description of the inclination state more objective, and the calculation standards of different detection personnel and different batches are completely unified, avoiding the differences in subjective judgment.

[0088] Optionally, the slope is converted into the actual tilt angle of the target horizontal straight line by the angle conversion logic, and the angle is taken as the tilt angle of the holder machine: first, the radian value is calculated by the arctan function (for example, when the slope k is approximately 0.0033, arctan(0.0033) is approximately 0.0033 radians), and then multiplied by 57.3 to convert the radian to an angle value (approximately 0.189°); the conversion process is a general trigonometric function operation, which does not require complex hardware support, and the conversion time of a single image is less than or equal to 0.1 seconds. Combined with the position parameter extraction and slope calculation described above, the total time consumption of the whole process is less than or equal to 0.5 seconds, which meets the needs of production line batch detection (the total detection time of a single holder machine is less than or equal to 1 second); at the same time, since the plane calibration object has been calibrated to a horizontal state, the actual tilt angle obtained by the conversion is the tilt angle of the holder machine, which does not need to be corrected additionally. Through cross verification of 50 holder machines, the coincidence degree of the angle with the actual tilt state of the holder machine is more than 99%, so that the subsequent judgment result based on the angle (such as "0.189°<1%, consistent with the horizontal") is accurate and reliable, and the failure rate of the tilted holder machine received by the client is reduced from 2% to 0, which significantly improves the product quality and user experience.

[0089] In this embodiment, the tilt state of the holder machine is converted from "subjective judgment" to "quantitative value", which not only solves the error-prone and low-efficiency of the existing detection method, but also provides an objective basis for subsequent output of horizontal consistency judgment results and guidance for rework correction, and finally realizes the dual improvement of the production detection accuracy and efficiency of the holder machine.

[0090] Further, based on the content of any of the above embodiments, in some feasible embodiments, step S50 further includes the following implementation steps F501 to F505.

[0091] Step F501: comparing the absolute value of the tilt angle of the holder machine with a preset horizontal judgment threshold value;

[0092] Step F502: if the absolute value of the tilt angle is less than the preset horizontal judgment threshold value, the holder machine is determined to be consistent with the horizontal;

[0093] Step F503: if the absolute value of the tilt angle is greater than or equal to the preset horizontal judgment threshold value, the holder machine is determined to be inconsistent with the horizontal;

[0094] Step F504: taking the horizontal consistency or the horizontal inconsistency as the horizontal consistency judgment result.

[0095] Optionally, the absolute value of the tilt angle of the gimbal machine is compared with a preset horizontal determination threshold value. The calculated tilt angle (such as "0.8°" or "1.2°") is first called and then compared with the preset threshold value (1%) in numerical comparison. Since the preset threshold value is the optimal standard determined by cross-validation of 50 gimbal machines, if the threshold value is set too small (such as 0.5%), it will lead to an increased misjudgment rate (judging the gimbal machine with slight tilt but not affecting the user's visual experience as inconsistent); if the threshold value is set too large (such as 1.5%), it will lead to an increased missed judgment rate (judging the gimbal machine with obvious tilt as consistent). The threshold value of 1% can balance "user visual experience" and "production line efficiency", so that the misjudgment rate is less than 0.5% and the missed judgment rate is less than 0.3%. Compared with observing whether the straight line in the video picture is horizontal by the human eye (which is easy to miss due to small deviation), this quantitative comparison process is completely automated and has no subjective factors. The determination standards of different detection personnel and different detection batches are highly unified. After using this comparison logic, the repeatability error of the production line determination result is reduced from 5% to less than 0.3%, significantly improving the stability of the determination result.

[0096] Optionally, if the absolute value of the tilt angle is less than the preset horizontal determination threshold value (such as 0.8°<1%), it is determined that the gimbal machine is horizontally consistent; if the absolute value of the tilt angle is greater than or equal to the preset horizontal determination threshold value (such as 1.2°≥1%), it is determined that the gimbal machine is not horizontally consistent; this determination logic is directly related to user experience - when the absolute value of the tilt angle is less than 1%, the degree of tilt of the picture after zoom imaging by the camera is difficult to detect by the naked eye, which meets the client's demand for "picture level"; when the angle is greater than or equal to 1%, the picture tilt will significantly affect the user experience and needs to be corrected. This logic solves the problem in the prior art that the "level detector can only determine whether it is tilted, but cannot quantify whether the tilt affects the user", so that the determination result is more suitable for actual application scenarios. After using this logic, the client complaint rate is reduced from 2% to 0.

[0097] Optionally, the horizontal consistency or horizontal inconsistency is taken as the horizontal consistency determination result, and a determination report is generated: the core information needs to be structured in the report, such as "tilt angle: 0.8°, tilt direction: right, determination conclusion: horizontally consistent" "tilt angle: 1.2°, tilt direction: left, determination conclusion: horizontally inconsistent, correction suggestion: increase the height of the left transmission arm by 0.5mm"; this report converts the abstract "angle value" into the concrete "repair instruction". Compared with the detection method of only knowing the tilt but without correction direction, the repair personnel do not need to make additional assumptions and can directly follow the suggestions. At the same time, the report generation logic is stored in a non-transitory computer readable storage medium, supports batch calling, and adapts to the continuous detection needs of multiple gimbal machines on the production line.

[0098] Optionally, the determination report is sent to the cloud platform through a communication interface for the cloud platform to trigger a horizontal correction prompt: the communication interface can be integrated in the hardware module of the detection platform to realize real-time transmission of the report (single-platform transmission time ≤0.2 seconds), without manual copying or oral transmission, avoiding production line stagnation caused by information delay; after receiving the report, the cloud platform can display the correction prompt (such as “1.2° left tilt, please adjust the left transmission arm”) on its own display screen, or mark the “to-be-repaired” state in the MES (Manufacturing Execution System, manufacturing execution system) system to form a closed loop of “detection-determination-prompt-repair”, and the total time from detection to prompt of a single cloud platform is ≤1.5 seconds, meeting the efficiency requirements of batch detection of the production line; at the same time, the hardware integrated design of the communication interface makes the embodiment compatible with existing production line equipment, without the need to build an independent transmission link, reducing the cost of production line transformation.

[0099] The embodiment solves the subjectivity and inefficiency of the existing detection method through the process of “quantitative comparison-accurate determination-structured report-automated transmission”, and provides a clear and executable basis for cloud platform repair, ultimately achieving multiple effects of “improving determination accuracy-reducing customer end failure rate-improving production line repair efficiency”, which meets the actual needs of cloud platform production detection scenarios.

[0100] Further, based on the content of any of the above embodiments, in some feasible embodiments, the horizontal consistency determination method and the horizontal consistency determination system include a fixed support, a detection platform, and a horizontal sensor, the detection platform includes a horizontal adjustment assembly, and before step S10, the method further includes steps G60-G90.

[0101] Step G60: When it is detected that the inclination of the planar calibration object exceeds the preset calibration threshold, adjust the fixed support of the planar calibration object until the levelness of the planar calibration object meets the preset reference, to obtain a horizontal standard planar calibration object;

[0102] Step G70: Based on the horizontal standard planar calibration object, adjust the height of the detection platform through the horizontal adjustment assembly, and simultaneously collect the horizontal state data of the detection platform in real time through the horizontal sensor, compare the horizontal state data with the preset platform threshold, continuously adjust the horizontal adjustment assembly until the horizontal state data is less than or equal to the preset platform threshold, to obtain a horizontal standard detection platform;

[0103] Step G60: Based on the horizontal standard detection platform, control the cloud platform to move to a position at a preset distance from the horizontal standard planar calibration object, adjust the lens angle of the cloud platform, and acquire a preview image in real time until the horizontal standard planar calibration object is completely displayed in the preview image;

[0104] Step G60: based on the complete display state of the planar calibration object in the preview picture, trigger the gimbal to capture a target image for subsequent steps of receiving the target image.

[0105] Optionally, the inclination of the planar calibration object refers to the inclination angle of the planar calibration object relative to the absolute horizontal reference plane, which is detected by a level or a horizontal sensor, and the unit is degree (°); the fixed support of the planar calibration object refers to a mechanical structure for supporting and adjusting the planar calibration object, which can adjust the inclination of the calibration object by adjusting the height and angle of the support; the preset reference refers to the horizontal standard that the planar calibration object needs to reach, i.e. "inclination ≤ preset calibration threshold (such as ±0.1°)"; the horizontally compliant planar calibration object refers to the planar calibration object with inclination ≤ preset calibration threshold (such as ±0.1°), which is obtained after adjustment by the fixed support and secondary detection; the horizontal adjustment component refers to a mechanical part provided by the detection platform for adjusting the levelness of the platform body; the detection platform refers to a platform for placing the gimbal; the horizontal sensor refers to a device for collecting real-time horizontal state data of the detection platform, and the output data includes the inclination angle (such as 0.05°) and the horizontal deviation value (such as 0.08mm) of the detection platform, which is fed back to the horizontal adjustment component to form a closed-loop adjustment; the horizontal state data refers to the real-time horizontal information of the detection platform collected by the horizontal sensor, including but not limited to the inclination angle of the platform body relative to the horizontal reference plane and the height deviation value of each support point, and the units are degree (°) and millimeter (mm) respectively; the preset platform threshold refers to the error standard for the horizontal compliance of the detection platform, which is set to horizontal error ≤0.1mm (or inclination angle ≤0.05°) in this embodiment; the preset distance refers to the set distance between the gimbal and the horizontally compliant planar calibration object, which is preferably 1m in this embodiment, and the core requirement is to ensure that the planar calibration object can completely fill the gimbal preview picture; the preview picture refers to the image picture collected by the gimbal lens in real time and transmitted to the PC tool, which is used to observe the display state of the planar calibration object.

[0106] Optionally, when it is detected that the inclination of the planar calibration object exceeds the preset calibration threshold, the fixed support of the planar calibration object is adjusted. First, the inclination direction (such as left inclination or right inclination) and the inclination (such as 0.2°) of the calibration object are detected by the level, and then the support is adjusted accordingly. If the left inclination is 0.2°, the right support is raised and the left support is lowered. After each adjustment, the level is used for secondary detection until the inclination of the calibration object is ≤ preset calibration threshold (±0.1°), and the horizontally compliant planar calibration object is obtained. This process forms a closed loop of "detection-adjustment-re-detection", which ensures that the planar calibration object has stable horizontal reference properties, and solves the problem of "calibration object inclination leading to reference failure" in the prior art. If not adjusted, the left inclination of 0.2° of the calibration object will cause a 0.2° deviation in the subsequent calculation of the inclination angle of the gimbal, resulting in a false judgment. After adjustment, the reference error of the calibration object is <0.1°, which provides a reliable reference for the subsequent calibration of the detection platform and the gimbal.

[0107] Optionally, based on the horizontal calibration object that meets the standard, the height of the detection table is adjusted by the horizontal adjustment assembly. First, the horizontal sensor is fixed at the center of the detection table top, the real-time horizontal state data (such as the inclination angle 0.08°, the horizontal deviation 0.12mm) of the detection table is collected, and the data is compared with the preset table threshold (≤0.1mm). If the horizontal deviation 0.12mm>0.1mm, the horizontal adjustment assembly of the detection table is controlled, and the data is collected again after adjustment. The process is repeated until the horizontal state data is less than or equal to the preset table threshold, and the detection table that meets the standard is obtained. This process takes the "horizontal calibration object that meets the standard" as a reference, avoiding the reference conflict of "the calibration object is horizontal but the detection table is inclined"; at the same time, the real-time data feedback of the horizontal sensor makes the adjustment more accurate. Compared with manually adjusting the detection table by experience, the automatic adjustment reduces the horizontal error of the detection table from 0.3mm to less than 0.1mm, eliminating the interference of "the initial inclination of the gimbal caused by the inclination of the detection table", and ensuring that the inclination of the gimbal is only caused by the assembly deviation of the gimbal itself, which eliminates external factors for subsequent inclination angle calculation.

[0108] Optionally, based on the detection table that meets the standard, the gimbal is controlled to move to a position that is a preset distance (such as 1m, small gimbal can be adjusted to 0.5m) away from the horizontal calibration object that meets the standard, and then the lens angle of the gimbal is remotely controlled through the PC tool to view the preview image in real time. If only half of the calibration object is displayed on the left side of the preview image, the gimbal needs to be controlled to move right; if the display is incomplete (including the background wall), the lens focal length needs to be adjusted to enlarge the image until the horizontal calibration object that meets the standard fills the preview image completely. This process ensures that the target image collected by the gimbal only contains the grid line area without background interference (such as wall stains and detection table edges), avoiding the problem of "misjudgment of subsequent edge detection caused by non-grid area entering the image". Compared with the case of "image containing background caused by not adjusting the lens angle", this step increases the proportion of the grid line area in the target image from 70% to more than 95%, providing high-quality image input for subsequent edge detection and horizontal straight line identification.

[0109] Optionally, based on the state that the calibration object in the preview image is displayed completely, the gimbal is triggered to collect the target image. The PC tool sends a "collection instruction" to the gimbal, and the gimbal receives the instruction, takes a picture and stores the target image in JPEG format, and transmits the image to the PC tool for subsequent processing. This triggering logic takes "complete display of the image" as a prerequisite to ensure that the collected target image has enough grid line features, avoiding the problem of "no enough horizontal straight line to extract" caused by incomplete image. After using this triggering method, the proportion of invalid images is reduced from 25% to less than 2%, significantly improving the efficiency and accuracy of subsequent image processing, and providing effective raw data for extracting grid line edge features and calculating the inclination angle of the gimbal.

[0110] Optionally, asFigure 3 As shown, Figure 3 The flowchart of the gimbal machine horizontal consistency determination method involved in the embodiment comprises the following steps in sequence: aligning the gimbal machine horizontally with the plane calibration object with grid lines (it is necessary to ensure that the calibration object has met the horizontal standard); obtaining a target image of the gimbal machine in JPEG format, and it is necessary to ensure that the plane calibration object is completely displayed in the picture; converting the image into a gray image by using the cv::cvtColor function of the OpenCV library, weakening the color interference and focusing on the grid line features; performing edge detection (such as the Canny algorithm) on the gray image to extract the contour boundary features of the grid lines; performing straight line detection by using the HoughLinesP algorithm to screen out straight lines that meet the threshold and length requirements; selecting the straight lines in the middle region of the image to extract the coordinate and angle parameters thereof; determining the tilt direction of the gimbal machine according to the extracted angle parameters and outputting a correction prompt; the steps are linked in sequence to realize the automatic determination of the horizontal consistency of the gimbal machine, wherein the “detection environment preparation” needs to rely on the plane calibration object to provide a horizontal reference, and the subsequent image processing and analysis are all carried out around this process, and finally a precise horizontal consistency determination result and a correction guide are output.

[0111] The embodiment gradually eliminates external reference deviations and image interference through the progressive process of “calibration object horizontal calibration → detection table horizontal calibration → gimbal machine position angle adjustment → target image acquisition”, and lays a precise and reliable foundation for subsequent horizontal consistency determination; at the same time, each step is realized by relying on hardware and automatic logic, reducing manual intervention, and finally improving the precision and efficiency of the horizontal consistency determination of the gimbal machine.

[0112] In addition, the application also provides a horizontal consistency determination system, please refer to Figure 4 , Figure 4 The structural schematic diagram of the horizontal consistency determination system involved in the embodiment of the application. The horizontal consistency determination system provided by the application comprises:

[0113] An image receiving module H01 is configured to determine a target image containing a plane calibration object collected by a gimbal machine;

[0114] A feature extraction module H02 is configured to perform edge detection processing on a grid line region of the plane calibration object in the target image to obtain edge features of the grid lines;

[0115] A straight line screening module H03 is configured to identify a horizontal straight line corresponding to the grid lines based on the edge features, and screen out a target horizontal straight line located in a middle region of the target image from the horizontal straight lines;

[0116] An angle calculation module H04 is configured to extract position parameters of the target horizontal straight line, and calculate a tilt angle of the gimbal machine based on the position parameters;

[0117] The result output module H05 is used to output the horizontal consistency judgment result of the gimbal based on the tilt angle.

[0118] The horizontal consistency determination system provided in this application, employing the horizontal consistency determination method described in the above embodiments, can solve the technical problem of low accuracy in horizontal consistency determination systems. Compared with the prior art, the beneficial effects of the horizontal consistency determination system provided in this application are the same as those of the horizontal consistency determination method described in the above embodiments, and other technical features of this horizontal consistency determination system are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0119] In addition, this application also provides an electronic device. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of the structure of the electronic device involved in the embodiments of this application.

[0120] This application provides an electronic device, which includes: at least one processor; a gimbal; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the level consistency determination method in Embodiment 1 above.

[0121] The following is for reference. Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device involved in the embodiments of this application, illustrating a structural schematic diagram of an electronic device suitable for implementing the embodiments of this application. The electronic devices in the embodiments of this application may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0122] like Figure 5As shown, the electronic device can include a processing device 1001 (e.g., a central processor, a graphics processor, etc.) that can perform various appropriate actions and processes according to programs stored in a read only memory (ROM) 1002 or loaded from a storage device 1003 into a random access memory (RAM) 1004. Various programs and data required for operation of the electronic device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following devices can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the horizontal consistency determination device to communicate wirelessly or by wire with other devices to exchange data. Although an electronic device with various devices is shown in the figure, it should be understood that all the shown devices are not required to be implemented or possessed. More or fewer devices can be alternatively implemented or possessed.

[0123] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are performed.

[0124] The electronic device provided in the present application adopts the horizontal consistency determination method in the above-mentioned embodiments, and can solve the technical problem of insufficient accuracy of horizontal consistency determination of the electronic device. Compared with the prior art, the electronic device provided in the present application has the same beneficial effects as the horizontal consistency determination method provided in the above-mentioned embodiments, and other technical features in the electronic device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0125] In addition, the present application provides a computer readable storage medium. The computer readable storage medium stores a horizontal consistency determination program. The horizontal consistency determination program, when executed by a processor, implements the steps of the horizontal consistency determination method.

[0126] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or system that includes the element.

[0127] The above-mentioned sequence numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0128] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platforms, and of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a computer readable storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a number of instructions for causing an apparatus (which can be a mobile phone, a computer, a server, or a network device) to perform the methods described in the various embodiments of the present application.

[0129] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which is made by using the content of the present application specification and drawings, is also included in the patent protection scope of the present application.

Claims

1. A method for determining horizontal consistency, characterized in that, An application is made in a horizontal consistency determination system, the system including a pan-tilt unit, the horizontal consistency determination system including a fixed support, a detection platform and a horizontal sensor, the detection platform including a horizontal adjustment component, and the horizontal consistency determination method including: Determine the target image containing the planar calibration object acquired by the gimbal camera, wherein, prior to the step of determining the target image containing the planar calibration object acquired by the gimbal camera, the method further includes: The tilt of the plane calibration object is detected by placing a level against the surface of the plane calibration object. When the tilt of the plane calibration object exceeds a preset calibration threshold, the fixing bracket of the plane calibration object is adjusted until the level of the plane calibration object meets the preset reference, thereby obtaining a plane calibration object that meets the level standard. The preset calibration threshold is ±0.1°. Based on the horizontally compliant plane calibration object, the height of the testing platform is adjusted by the horizontal adjustment component, and the horizontal status data of the testing platform is collected in real time by the horizontal sensor. The horizontal status data is compared with a preset platform threshold, and the horizontal adjustment component is continuously adjusted until the horizontal status data is less than or equal to the preset platform threshold, thus obtaining a horizontally compliant testing platform. Based on the level-compliant testing platform, the gimbal is controlled to move to a position at a preset distance from the level-compliant planar calibration object, the lens angle of the gimbal is adjusted, and a preview image is obtained in real time until the level-compliant planar calibration object is fully displayed in the preview image without background interference. Based on the complete display of the planar calibration object in the preview screen, the gimbal is triggered to acquire the target image for subsequent steps of receiving the target image; Edge detection processing is performed on the grid line region of the planar calibration object in the target image to obtain the edge features of the grid lines; Based on the edge features, identify the horizontal straight lines corresponding to the grid lines, and filter out the target horizontal straight lines located in the middle region of the target image from the horizontal straight lines; Extract the position parameters of the target horizontal line, and calculate the tilt angle of the gimbal based on the position parameters; The horizontal consistency determination result of the gimbal is output based on the tilt angle. The step of determining the target image containing the planar calibration object acquired by the gimbal camera includes: When the proportion of the display area of ​​the planar calibration object in the target image is detected to be greater than or equal to a preset proportion threshold, the step of performing edge detection processing on the grid line area of ​​the planar calibration object in the target image is executed.

2. The method for determining horizontal consistency as described in claim 1, characterized in that, The edge detection processing of the grid line region of the planar marker in the target image to obtain the edge features of the grid lines includes: Locate the grid line region of the planar marker in the target image, and perform Gaussian filtering denoising on the located grid line region to obtain the denoised grid line region; Edge detection is performed on the denoised grid line region to extract the edge features of the grid lines, wherein the edge features include at least the outline boundary and line direction information of the grid lines.

3. The method for determining horizontal consistency as described in claim 2, characterized in that, The step of identifying the horizontal straight line corresponding to the grid line based on the edge feature, and filtering out the target horizontal straight line located in the middle region of the target image from the horizontal straight lines includes: Based on the edge features, the direction parameters of each edge segment in the grid line are extracted, and the edge segments whose direction parameters fall within a preset horizontal angle range are determined as the horizontal straight lines corresponding to the grid line. Using the geometric center of the target image as a reference, a rectangular region occupying a preset proportion of the total area of ​​the target image is defined as the central region, wherein the long side of the rectangular region is parallel to the horizontal direction of the target image; From the horizontal straight lines, select the straight lines whose midpoints fall into the middle region and whose continuous length exceeds a preset length threshold, and use them as target horizontal straight lines.

4. The method for determining horizontal consistency as described in claim 3, characterized in that, The steps of extracting the position parameters of the target horizontal line and calculating the tilt angle of the gimbal based on the position parameters include: Extract the coordinates of two different endpoints on the target horizontal line as position parameters, wherein the coordinates of the two endpoints are the first endpoint x-coordinate and the first endpoint y-coordinate of the target horizontal line in the target image pixel coordinate system, and the second endpoint x-coordinate and the second endpoint y-coordinate. The slope of the target horizontal line is obtained by dividing the difference between the ordinate of the second endpoint and the ordinate of the first endpoint by the difference between the abscissa of the second endpoint and the abscissa of the first endpoint. The slope is input into a preset tilt angle function, and the tilt angle of the gimbal is output.

5. The method for determining horizontal consistency as described in claim 1, characterized in that, The step of outputting the horizontal consistency determination result of the gimbal based on the tilt angle includes: The absolute value of the tilt angle of the gimbal is compared with a preset horizontal determination threshold. If the absolute value of the tilt angle is less than the preset level determination threshold, then the gimbal is determined to be level. If the absolute value of the tilt angle is greater than or equal to the preset level determination threshold, then the gimbal is determined to be horizontally inconsistent. The level of consistency or the level of inconsistency shall be used as the result of the level consistency determination.

6. A system for determining horizontal consistency, characterized in that, The horizontal consistency determination system includes a pan-tilt unit, a fixed support, a detection platform, and a horizontal sensor. The detection platform includes a horizontal adjustment assembly. The horizontal consistency determination system includes: An image receiving module is used to receive a target image acquired by the gimbal, wherein the target image includes a planar marker with grid lines; The feature extraction module is used to perform edge detection processing on the grid line region of the planar calibration object and extract the edge features of the grid lines; A straight line filtering module is used to identify the horizontal straight lines corresponding to the grid lines based on the edge features of the grid lines, and to filter out the target horizontal straight lines located in the middle region of the target image from the horizontal straight lines. An angle calculation module is used to extract the position parameters of the target horizontal line and calculate the tilt angle of the gimbal based on the position parameters; The result output module is used to output the horizontal consistency determination result of the gimbal based on the tilt angle. The horizontal consistency determination system also performs the following: When the tilt of the plane calibration object is detected to exceed the preset calibration threshold, the fixing bracket of the plane calibration object is adjusted until the level of the plane calibration object meets the preset reference, so as to obtain a plane calibration object that meets the level standard, wherein the preset calibration threshold is ±0.1°; Based on the horizontally compliant plane calibration object, the height of the testing platform is adjusted by the horizontal adjustment component, and the horizontal status data of the testing platform is collected in real time by the horizontal sensor. The horizontal status data is compared with a preset platform threshold, and the horizontal adjustment component is continuously adjusted until the horizontal status data is less than or equal to the preset platform threshold, thus obtaining a horizontally compliant testing platform. Based on the level-compliant testing platform, control the gimbal to move to a position at a preset distance from the level-compliant planar calibration object, adjust the lens angle of the gimbal, and acquire a preview image in real time until the level-compliant planar calibration object is fully displayed in the preview image; Based on the complete display of the planar calibration object in the preview screen, the gimbal is triggered to acquire the target image for subsequent steps of receiving the target image; The horizontal consistency determination system also performs the following: When the proportion of the display area of ​​the planar calibration object in the target image is detected to be greater than or equal to a preset proportion threshold, the step of performing edge detection processing on the grid line area of ​​the planar calibration object in the target image is executed.

7. An electronic device, characterized in that, The electronic device includes a gimbal, a processor, a memory, and a horizontal consistency determination program stored in the memory that can be executed by the processor, wherein when the horizontal consistency determination program is executed by the processor, it implements the steps of the horizontal consistency determination method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a horizontal consistency determination program, wherein when the horizontal consistency determination program is executed by a processor, it implements the steps of the horizontal consistency determination method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Device and method for judging and adjusting levelness of large-depth-of-field lens camera

    CN112762896A