A method and system for calibrating the orientation of a fixed monitoring device for a mobile terminal
Patent Information
- Application Number
- CN202611109963.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-10-27
AI Technical Summary
但该类技术的不足在于:对于已经安装在道路、园区、楼宇或杆件上的固定监控摄像头,现场通常难以布设标准标定板,也难以要求普通外业人员携带专业测量设备逐台标定
[0018]相比于现有技术,本发明的优点及有益效果在于:移动端根据待标定摄像头的摄像头编号获取对应参考图,并在参考图上确定中心主方向点和辅助质检点,适用于已安装固定监控摄像头的批量低成本标定和复核;调用移动端后置相机,在相机预览画面上叠加半透明参考图、中心主方向点和辅助质检点,将画面中心位置对准现实目标物,并在符合预设拍摄条件时,采集得到现场图,与参考图进行比对确认无误后,基于定位权限和方向传感器权限监听待标定摄像头方向时间,得到可信水平朝向角,通过可信度判断提高移动端朝向数据的可信性;基于可信水平朝向角持续采集设定时间窗口内姿态数据,判断设定时间窗口内的姿态数据是否满足提交资格,若满足,则根据满足提交资格的时间窗口建立稳定采样队列,便于进行异常样本剔除和多次数据比对,并对其姿态数据进行去离群平均处理,得到目标水平朝向角,完成标定并上传标定记录至服务端,实现对标定提交瞬时稳定性的确认,提高了朝向角计算的稳定性;服务端将标定记录写入数据库中,并基于参考图、现场图、中心主方向点和辅助质检点生成质检资产,以对目标水平朝向角进行标定复核,实现对固定监控摄像头的低成本朝向标定,确保标定结果的准确性,且提高了现场使用的适应性。
Smart Images

Figure CN122989889A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camera calibration technology, and in particular to a method and system for calibrating the orientation of fixed monitoring equipment for mobile devices. Background Technology
[0002] After fixed surveillance cameras are put into use, it is usually necessary to obtain parameters such as their installation location, field of view, horizontal orientation angle, and tilt angle in order to use them for map display, event location, video inspection, spatial correlation analysis, or subsequent quality inspection.
[0003] Existing fixed camera calibration methods include the following categories: (1) Camera calibration techniques based on calibration boards or known geometric targets. This type of technique typically solves for the camera's intrinsic parameters, distortion parameters, and extrinsic parameters by using checkerboard patterns, dot arrays, targets of known size, or the correspondence between multiple sets of spatial points and image points. This method is suitable for precise calibration in laboratories, industrial vision, or controllable scenarios. However, the drawback of this type of technique is that for fixed surveillance cameras already installed on roads, parks, buildings, or poles, it is usually difficult to set up standard calibration boards on-site, and it is also difficult to require ordinary field personnel to carry professional measuring equipment to calibrate each camera individually. Therefore, although this type of method has high accuracy, it has high on-site costs and high implementation requirements, and is not suitable for low-cost mobile end orientation acquisition of a large number of fixed surveillance cameras.
[0004] (2) Automatic calibration technology for traffic monitoring cameras based on road geometry, vanishing point, or vehicle trajectory. Research has been conducted in the field of traffic video analysis on the automatic calibration of monitoring cameras using lane lines, vehicle trajectories, road edges, vanishing points, or 3D vehicle models. However, this type of technology has shortcomings: it relies on road structure, vehicle motion, detection models, or video sequence quality, and usually requires a background algorithm to automatically extract geometric clues from the image; when the monitoring image lacks obvious road structure, has only a single reference image, has occlusion, or has poor image quality, the calibration stability decreases. Furthermore, this type of technology focuses on image geometric calculation and does not address how ordinary on-site personnel can use mobile terminals to collect, confirm, and verify the camera's orientation at low cost at the camera's location.
[0005] (3) Camera orientation calibration technology based on PTZ (pan-tilt-zoom) models or existing installation parameters. For PTZ cameras or cameras with attitude control parameters, the camera orientation can be calculated using pan, tilt, and zoom parameters, preset installation positions, or a small number of point correspondences. However, this type of technology is insufficient because it relies on road structures. Many fixed surveillance cameras are fixed bullet cameras and do not have directly readable PTZ angle parameters. Even if installation records exist, historical records may not match the actual installation orientation. Therefore, this type of technology is difficult to cover the on-site orientation calibration needs of fixed surveillance cameras without PTZ angle feedback and lacking reliable installation parameters. When the monitoring screen lacks obvious road structures, has only a single reference image, has obstructions, or has poor image quality, the calibration stability will decrease. At the same time, this type of technology focuses on image geometric calculation and does not solve the problem of how ordinary on-site personnel can use mobile terminals to collect, confirm, and verify the camera orientation at the camera's location at low cost.
[0006] (4) Orientation acquisition technology based on mobile terminal orientation sensors. Mobile terminal browsers obtain relevant attitude angles, and some browsers also provide extended fields related to compass direction. However, the shortcomings of this technology are: the ordinary orientation angle returned by the browser is not necessarily equivalent to the azimuth angle of the system compass, and the implementation of orientation events may differ between different operating systems, different browsers, and different models. If the instantaneous orientation reading of the mobile terminal is directly used as the orientation of a fixed monitoring camera, problems such as unreliable orientation sources, the phone not being placed flat, instantaneous shaking during submission, and magnetic field interference are likely to occur, resulting in unstable or unverifiable orientation calibration results.
[0007] In summary, although existing technologies have disclosed solutions for professional camera calibration, automatic traffic monitoring calibration, PTZ camera calibration, and mobile terminal orientation sensor acquisition, they still have the following shortcomings: First, on-site calibration is costly and not suitable for mass implementation by ordinary personnel; second, there is a lack of a mechanism to confirm the correspondence between the center direction of the fixed camera reference image and the on-site shooting direction of the mobile terminal; third, there is a lack of comprehensive access control for the reliable source of mobile terminal orientation data, horizontal attitude stability, and instantaneous stability; and fourth, there is a lack of a closed loop for the unified storage of on-site images, reference images, orientation angles, positioning information, and quality inspection images. Summary of the Invention
[0008] Therefore, it is necessary to provide a method and system for calibrating the orientation of fixed monitoring equipment for mobile devices to address the aforementioned technical problems.
[0009] A method for calibrating the orientation of a fixed monitoring device on a mobile device includes the following steps: The mobile device obtains a corresponding reference image based on the camera number of the camera to be calibrated, and determines the central main direction point and auxiliary quality inspection points based on the reference image; The mobile device's rear camera is activated, and a semi-transparent reference image, the central main direction point, and the auxiliary quality inspection points are overlaid on the camera preview screen, aligning the center position of the image with the real target object, and when a preset shooting condition is detected, a scene image is captured; The reference image and the scene image are compared and confirmed, and after confirmation, the camera to be calibrated is monitored based on positioning permissions and orientation sensor permissions. The direction event is used to obtain a reliable horizontal orientation angle. Based on the reliable horizontal orientation angle, attitude data within a set time window is continuously collected, and it is determined whether the attitude data within the set time window meets the submission qualification. If so, a stable sampling queue is established according to the time window that meets the submission qualification, and the attitude data is processed by outlier removal and averaging to obtain the target horizontal orientation angle, completing the calibration, and uploading the calibration record to the server. The server writes the calibration record into the database, and generates quality inspection assets based on the reference map, the site map, the central main direction point, and the auxiliary quality inspection points, which are used to verify the calibration of the target horizontal orientation angle.
[0010] In one embodiment, the mobile terminal obtains the corresponding reference image based on the camera number of the camera to be calibrated, including: the server pre-stores reference images of all fixed surveillance cameras, and the reference images are associated with camera numbers, scene states, reference image paths and reference image hash values; the camera number is obtained based on the surveillance camera to be calibrated, and the corresponding reference image is obtained from the server based on the camera number and returned to the mobile terminal.
[0011] In one embodiment, determining the central main direction point and auxiliary quality inspection points based on the reference image includes: normalizing the coordinates of the reference image, using the normalized center position as the center point corresponding to the main line of sight of the camera image to obtain the central main direction point; and setting auxiliary quality inspection points at the four corners of the reference image based on the stable target in the reference image.
[0012] In one embodiment, the step of acquiring a scene image when the preset shooting conditions are detected includes: detecting the mobile terminal's posture; when the mobile terminal is in landscape soft lock state, determining whether the central target is aligned based on the reference image, the central main direction point, and auxiliary quality inspection points; if aligned, it indicates that the preset shooting conditions are met, and shooting is performed to acquire a scene image.
[0013] In one embodiment, the comparison and confirmation of the reference image and the on-site image includes: comparing the reference image and the on-site image to determine whether the central main direction points of the two images overlap the same real-world target object, and whether the auxiliary quality inspection points and the overall image direction of the two images are all within a preset error range; if the central main direction points of the two images overlap the same real-world target object, and the auxiliary quality inspection points and the overall image direction of the two images are all within a preset error range, then the on-site image is confirmed to be correct; otherwise, the on-site image is re-acquired until the on-site image is confirmed to be correct.
[0014] In one embodiment, the step of listening to the orientation events of the camera to be calibrated based on positioning permissions and orientation sensor permissions to obtain a reliable horizontal orientation angle includes: acquiring the orientation events of the camera to be calibrated based on positioning permissions and orientation sensor permissions, wherein the orientation events include a direction source and a horizontal orientation angle; determining the reliability of the horizontal orientation angle based on the direction source, wherein when the direction source is a compass direction field and an absolute direction, the corresponding horizontal orientation angle is determined to be a reliable horizontal orientation angle.
[0015] In one embodiment, determining whether the attitude data within a set time window meets the submission eligibility criteria includes: the attitude data within the set time window satisfies the following conditions: a reliable horizontal orientation angle exists; the orientation data is not interrupted within the set time window; the number of samples within the time window reaches a preset minimum value; the yaw angle or the original yaw angle's circular angle deviation within the time window does not exceed the yaw angle threshold; the fluctuation range of the pitch angle and roll angle does not exceed a preset fluctuation threshold; the mobile device is in landscape mode; the level indicator status meets preset conditions; and the current instantaneous yaw angle, pitch angle, and roll angle are within a set range of the center of the stable window, and the above stable states are continuously maintained for a preset duration. In this case, the time window is considered a stable time window that meets the submission eligibility criteria.
[0016] In one embodiment, the calibration record includes: camera number, calibration personnel information, reference map address, reference map, center main direction point, auxiliary quality inspection point coordinates, yaw angle, pitch angle, roll angle, mobile terminal positioning latitude and longitude, positioning accuracy, optional altitude information, direction source, direction quality, number of stable samples, number of effective yaw angle samples, site map, calibration notes, and browser capability information.
[0017] A system for calibrating the orientation of fixed monitoring equipment on a mobile device, used to implement the orientation calibration method for fixed monitoring equipment on a mobile device as described above, includes: a reference image acquisition module, used by the mobile device to acquire a corresponding reference image based on the camera number of the camera to be calibrated, and to determine the central main direction point and auxiliary quality inspection points based on the reference image; a scene image acquisition module, used to call the rear camera of the mobile device, and to overlay a semi-transparent reference image, the central main direction point, and the auxiliary quality inspection points on the camera preview screen, aligning the center position of the image with the real target object, and acquiring a scene image when the preset shooting conditions are detected; and a reliable orientation angle acquisition module, used to compare and confirm the reference image and the scene image, and after confirmation, based on positioning permissions and orientation sensors... The system monitors the direction events of the camera to be calibrated to obtain a reliable horizontal orientation angle. A stable window judgment module continuously collects attitude data within a set time window based on the reliable horizontal orientation angle, and determines whether the attitude data within the set time window meets the submission requirements. A calibration completion module establishes a stable sampling queue based on the time window that meets the submission requirements when the attitude data meets the requirements, performs outlier removal and averaging on the attitude data to obtain the target horizontal orientation angle, completes the calibration, and uploads the calibration record to the server. A calibration verification module writes the calibration record into the database on the server side and generates quality inspection assets based on the reference image, site image, central main direction point, and auxiliary quality inspection points, which are used to verify the calibration of the target horizontal orientation angle.
[0018] Compared to existing technologies, the advantages and beneficial effects of this invention are as follows: The mobile terminal obtains the corresponding reference image based on the camera number of the camera to be calibrated, and determines the central main direction point and auxiliary quality inspection points on the reference image, which is suitable for batch low-cost calibration and verification of fixed surveillance cameras that have been installed; the mobile terminal's rear camera is invoked, and a semi-transparent reference image, central main direction point, and auxiliary quality inspection points are superimposed on the camera preview screen, aligning the center position of the image with the real target object, and when the preset shooting conditions are met, a scene image is captured. After comparing it with the reference image to confirm that there are no errors, the orientation time of the camera to be calibrated is monitored based on positioning permissions and orientation sensor permissions to obtain a reliable horizontal orientation angle. The reliability of the orientation data of the mobile terminal is improved by judging the reliability; based on the reliable horizontal orientation angle, the design is continuously collected. Within a defined time window, attitude data is used to determine if it meets the submission requirements. If it does, a stable sampling queue is established based on the time window that meets the submission requirements. This facilitates the removal of outlier samples and multiple data comparisons. Outlier removal and averaging are then performed on the attitude data to obtain the target horizontal orientation angle. Calibration is completed, and the calibration record is uploaded to the server. This confirms the instantaneous stability of the calibration submission and improves the stability of the orientation angle calculation. The server writes the calibration record into the database and generates quality inspection assets based on the reference map, site map, central main direction point, and auxiliary quality inspection points to verify the calibration of the target horizontal orientation angle. This enables low-cost orientation calibration of fixed surveillance cameras, ensures the accuracy of the calibration results, and improves adaptability for field use. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a method for calibrating the orientation of a fixed monitoring device for a mobile terminal in one embodiment.
[0020] Figure 2 This is a schematic diagram illustrating the execution flow of a method for calibrating the orientation of a fixed monitoring device for a mobile terminal, as shown in one embodiment.
[0021] Figure 3 This is a schematic diagram of the interaction architecture between the mobile terminal and the server in one embodiment.
[0022] Figure 4 This is a schematic diagram of the orientation calibration system for a fixed monitoring device used on a mobile device in one embodiment. Detailed Implementation
[0023] Before describing the specific embodiments of the present invention, the overall concept of the present invention will be explained as follows: This invention is mainly based on the calibration process of the orientation angle of fixed surveillance cameras. Currently, the on-site orientation calibration of fixed surveillance cameras is costly, the reliability of orientation data from mobile devices is unstable, single readings are easily affected by jitter or magnetic interference, and the calibration results lack verification basis.
[0024] Therefore, this invention proposes a method for calibrating the orientation of fixed monitoring equipment on a mobile device. The mobile device obtains a corresponding reference image based on the camera number of the camera to be calibrated, and determines the central main direction point and auxiliary quality inspection points on the reference image. This method is suitable for low-cost batch calibration and verification of installed fixed monitoring cameras. The mobile device's rear camera is invoked, and a semi-transparent reference image, central main direction point, and auxiliary quality inspection points are overlaid on the camera preview screen. The center position of the image is aligned with the real target object, and when the preset shooting conditions are met, a scene image is captured. After comparison with the reference image to confirm that there are no errors, the orientation of the camera to be calibrated is monitored for a certain time based on positioning and orientation sensor permissions to obtain a reliable horizontal orientation angle. The reliability of the orientation data of the mobile device is improved by judging the reliability. Based on the reliable horizontal orientation angle, the method continuously... Attitude data is collected within a set time window. It is determined whether the attitude data within the set time window meets the submission eligibility criteria. If it does, a stable sampling queue is established based on the time window that meets the submission eligibility criteria. This facilitates the removal of abnormal samples and multiple data comparisons. Outlier removal and averaging are performed on the attitude data to obtain the target horizontal orientation angle. Calibration is completed, and the calibration record is uploaded to the server, confirming the instantaneous stability of the calibration submission and improving the stability of the orientation angle calculation. The server writes the calibration record into the database and generates quality inspection assets based on the reference map, site map, central main direction point, and auxiliary quality inspection points to verify the calibration of the target horizontal orientation angle. This achieves low-cost orientation calibration of fixed surveillance cameras, ensuring the accuracy of the calibration results and improving adaptability for field use.
[0025] Having introduced the overall concept of the present invention, to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.
[0026] In one embodiment, such as Figure 1-3 As shown, a method for calibrating the orientation of a fixed monitoring device for mobile terminals is provided, including the following steps: In step S110, the mobile terminal obtains the corresponding reference image based on the camera number of the camera to be calibrated, and determines the central main direction point and auxiliary quality inspection point based on the reference image.
[0027] Specifically, the camera to be calibrated is identified and its corresponding camera number is obtained. The camera number is entered on the mobile device, and a reference image is received from the server. The central main direction point and auxiliary quality inspection points are determined based on the reference image. The central main direction point is a fixed point in the reference image, and the auxiliary quality inspection points can be adaptively adjusted according to the reference image to ensure the accuracy of the camera's main line of sight direction, while also enabling subsequent quality inspection through the auxiliary quality inspection points.
[0028] The steps for obtaining the reference image include: the server pre-stores reference images of all fixed surveillance cameras, and associates the reference images with the camera number, scene status, reference image path, and reference image hash value; obtains the camera number based on the surveillance camera to be calibrated, retrieves the corresponding reference image from the server based on the camera number, and returns it to the mobile device.
[0029] Specifically, the server pre-saves reference images for fixed surveillance cameras and associates these images with information such as camera ID, scene status, reference image path, and reference image hash value. After accessing the calibration page by scanning a QR code, the mobile calibration personnel enter the camera ID and their information. The server then returns the corresponding reference image based on the camera ID. In this step, the mobile device does not directly retrieve the camera's live video stream; instead, it uses the reference image pre-cached and confirmed by the server. This reduces the impact of factors such as the on-site network environment, video protocols, camera permissions, and live stream failures on the calibration process.
[0030] The steps for determining the central main direction point and auxiliary quality inspection points include: normalizing the coordinates of the reference image, taking the normalized center position as the center point corresponding to the main line of sight of the camera image, and obtaining the central main direction point; and setting auxiliary quality inspection points at the four corners of the reference image based on the stable target in the reference image.
[0031] Specifically, all coordinates in the reference image are normalized. The central main direction point is preferably set to the center position in the normalized coordinates of the reference image, i.e., {x:0.5, y:0.5}, to represent the central target corresponding to the main line of sight of the fixed surveillance camera. Auxiliary quality inspection points can be set in the reference image. Figure 4 Near the corner, these are used by calibration personnel to make fine adjustments based on stable targets in the reference image. Auxiliary quality control points are primarily used for subsequent verification of the overall orientation and field-of-view consistency between the reference image and the site image, rather than replacing the central main orientation point. By using a method of "fixed central main orientation point and adjustable auxiliary quality control points," on-site personnel are prevented from excessively pursuing edge image registration and neglecting the camera's main line-of-view direction.
[0032] Step S120: Use the mobile device's rear camera to overlay a semi-transparent reference image, a central main direction point, and auxiliary quality inspection points. Align the center of the image with the real target object and capture the scene image when the preset shooting conditions are met.
[0033] Specifically, the mobile device calls the rear camera and overlays a semi-transparent reference image, a central main direction point, and auxiliary quality inspection points onto the camera preview screen. Based on the overlaid image, the calibration personnel locate the same real-world target that corresponds to the central main direction point of the reference image on-site, such as a road edge, building corner, fixed pole, wall corner, or other long-term stable target. They then align the center of the mobile device's camera view with the real-world target, thereby establishing a correspondence between the mobile device's current orientation and the center direction of the reference image from the fixed surveillance camera.
[0034] At the same time, it detects whether the mobile device currently meets the preset shooting conditions, such as landscape soft lock state, target alignment, etc., and collects the on-site image corresponding to the reference image.
[0035] The steps for acquiring the on-site image include: detecting the mobile device's posture; when the mobile device is in landscape soft lock mode, determining whether the central target is aligned based on the reference image, the central main direction point, and auxiliary quality inspection points; if aligned, it indicates that the preset shooting conditions are met, and shooting is performed to acquire the on-site image.
[0036] Specifically, the mobile device enters the landscape shooting interface. The mobile device can be a smartphone, and the system detects the smartphone's landscape state and orientation. Only when the smartphone is in landscape mode and the screen orientation meets the preset shooting conditions is the capture of the scene image allowed. During scene image capture, the mobile device still displays the reference image overlay, the central main direction point, and auxiliary quality control points. After confirming that the central target is aligned with the camera frame, the shot is taken, resulting in the scene image. This scene image will be submitted along with the calibration record for subsequent quality control. Using landscape soft-lock shooting reduces issues such as inconsistent landscape and portrait locking capabilities across different mobile phone systems, non-standard portrait preview screenshots, and inconsistent scene image orientation, ensuring a more consistent frame orientation and verification basis between the scene image and the reference image.
[0037] Step S130: Compare and confirm the reference image and the on-site image. After confirming that there are no errors, listen for the orientation events of the camera to be calibrated based on the positioning permission and orientation sensor permission to obtain the reliable horizontal orientation angle.
[0038] Specifically, after acquiring the on-site image, the reference image and the on-site image are displayed simultaneously for comparison and confirmation. If the direction of the central main point, the auxiliary quality inspection points, and the overall image all match, it indicates that the on-site image is confirmed to be correct. Based on the positioning permissions and orientation sensor permissions of the mobile device, the orientation events of the camera to be calibrated are monitored, and the credibility of the horizontal orientation angle in the orientation event is judged to identify a credible horizontal orientation angle, ensuring that the obtained horizontal orientation angle is true and reliable, thereby reducing the erroneous calibration caused by differences in orientation event implementation between different mobile devices and different browsers.
[0039] The steps for comparing and confirming the reference image and the on-site image include: comparing the reference image and the on-site image to determine whether the central main direction point of the two images overlaps the same real-world target object, and whether the auxiliary quality inspection points and the overall image direction of the two images are all within the preset error range; if the central main direction point of the two images overlaps the same real-world target object, and the auxiliary quality inspection points and the overall image direction of the two images are all within the preset error range, then the on-site image is confirmed to be correct; otherwise, the on-site image is re-acquired until the on-site image is confirmed to be correct.
[0040] Specifically, after the on-site image is acquired, the mobile device displays a dual-image confirmation page showing both the reference image and the on-site image. Both images are overlaid with a central main direction point, auxiliary quality control points, and reference frame lines. The system confirms whether the central main direction point in both images overlaps the same real-world target, and whether the auxiliary quality control points and the overall image orientation are within the preset error range. If the central main direction point overlaps the same real-world target, and the auxiliary quality control points and the overall image orientation are within the preset error range, the system is considered correct and proceeds to the orientation sampling step. If any condition is not met, it indicates that the central target is not aligned or the on-site image is significantly deviated. The system then returns to step S120 to retake the on-site image until the on-site image meets the above conditions.
[0041] The step of obtaining a reliable orientation angle includes: obtaining orientation events of the camera to be calibrated based on positioning permissions and orientation sensor permissions, wherein the orientation events include orientation source and horizontal orientation angle; determining the reliability of the horizontal orientation angle based on the orientation source, wherein when the orientation source is a compass orientation field and an absolute direction, the corresponding horizontal orientation angle is determined to be a reliable horizontal orientation angle.
[0042] Specifically, after the mobile device enters the submission page, it requests location and orientation sensor permissions and listens for device orientation events. The system does not directly use any arbitrary horizontal orientation angle returned by the browser as the camera's orientation; instead, it performs a reliability assessment of the orientation source. A reliable horizontal orientation angle includes at least one of the following sources: a reliable compass direction field provided by the mobile browser; a device orientation event explicitly marked as an absolute direction; or a horizontal orientation angle calculated from an attitude angle with absolute orientation semantics. For ordinary horizontal orientation angles, if they only represent relative attitude angles or browser internal coordinate angles, they are only recorded as background information, not included in stable sampling, not used as the final submitted horizontal orientation angle, and calibration records are not allowed to be submitted. This reliable orientation filtering mechanism avoids mistaking relative attitude angles for the true horizontal orientation angle of a fixed surveillance camera.
[0043] Step S140: Based on the reliable horizontal orientation angle, continuously collect attitude data within a set time window, and determine whether the attitude data within the set time window meets the submission qualification.
[0044] Specifically, after obtaining the reliable horizontal orientation angle, the mobile device continuously collects attitude data such as yaw, pitch, and roll of the camera to be calibrated based on a set time window. For example, it acquires attitude data within a 2-second time window, determines whether the attitude data within the set time window meets the submission qualification, and if it does, proceeds to step S150; otherwise, it continues to wait until a stable time window that meets the submission qualification appears.
[0045] The steps for determining whether the attitude data within a set time window meets the submission eligibility criteria include: if the attitude data within the set time window meets the following criteria: there is a reliable horizontal orientation angle; the orientation data is not interrupted within the set time window; the number of samples within the time window reaches a preset minimum value; the yaw angle or the original yaw angle's circular angle deviation within the time window does not exceed the yaw angle threshold; the fluctuation range of the pitch angle and roll angle does not exceed the preset fluctuation threshold; the mobile device is in landscape mode; the level indicator status meets preset conditions; and the current instantaneous yaw angle, pitch angle, and roll angle are within the set range of the center of the stable window and the above stable states are continuously maintained for a preset duration, then the time window is considered a stable time window that meets the submission eligibility criteria.
[0046] Specifically, after the mobile device obtains a reliable horizontal orientation angle, the system continuously collects attitude data such as yaw, pitch, and roll, and establishes a stable sampling queue within the most recent time window. The system performs real-time access control judgment on submission eligibility, including at least the following conditions: A reliable horizontal orientation angle exists; the orientation data has not been interrupted within a preset time; the number of samples within the most recent statistical window reaches a preset minimum value; the circumferential angle deviation of yaw or raw yaw within the window does not exceed a preset threshold; the fluctuation range of pitch and roll does not exceed a preset threshold; the mobile device is currently placed nearly horizontally, and the level meets preset conditions; the current instantaneous yaw, pitch, and roll are still close to the center of the most recent stable window; the above stable state is maintained continuously for a preset duration. For example, in one implementation, a most recent statistical window of approximately 2 seconds, a continuous stable duration of approximately 2.5 seconds, at least 3 valid samples, a maximum yaw deviation threshold, a pitch / roll fluctuation threshold, and a level green zone threshold can be used. The above parameters can be adjusted according to different mobile devices, browsers, on-site environments, and accuracy requirements, and are not intended to limit the scope of protection.
[0047] If all the above conditions are met, the current time window indicates that it is a stable time window that meets the submission eligibility requirements. If any of the above conditions are not met, the system will clear or suspend submission eligibility and continue to wait for a new stable state. Even if the system has reached a stable state, if there is significant shaking of the mobile device, interruption of direction data, or the level indicator leaving the stable zone before submission, the submit button will be disabled again.
[0048] Step S150: If yes, then establish a stable sampling queue according to the time window that meets the submission qualification, perform outlier removal averaging on its attitude data to obtain the target horizontal orientation angle, complete the calibration, and upload the calibration record to the server.
[0049] Specifically, when the attitude data within a set time window meets the submission requirements, it is determined to be a stable time window. A stable sampling queue is established based on the stable time window, and the corresponding stable samples are saved, including information such as the number of effective yaw samples, orientation quality, positioning accuracy, and quality inspection images. Subsequently, multiple submission records from the same camera can be compared to identify obviously outlier orientation angles or on-site images that do not meet the quality inspection requirements, thereby improving the manageability of batch calibration data.
[0050] Before submitting attitude data within the set time window, the system does not directly use the orientation reading from the last frame. Instead, it performs statistical processing on samples within the stable time window. For yaw or raw yaw, since it is a circular angle from 0° to 360°, a circular average is used to calculate the average direction, and the angular distance of each sample relative to the circular average is calculated. For samples with significant deviations, outliers are removed based on the median angular distance or preset rules, and the circular average is recalculated for the remaining samples as the final submitted horizontal orientation angle. For pitch and roll, a pruning method can be used, such as removing a certain proportion of the highest and lowest samples before averaging, to reduce the impact of occasional jitter on the final attitude value. Through the above outlier removal averaging method, the impact of abnormal readings in a single frame, angles crossing the 0° / 360° boundary, short-term magnetic interference, or hand-held jitter on the final calibration result can be reduced.
[0051] In step S160, the server writes the calibration record into the database and generates quality inspection assets based on the reference map, the site map, the central main direction point and the auxiliary quality inspection points, which are used to calibrate and verify the target horizontal orientation angle.
[0052] The calibration record includes: camera number, calibration personnel information, reference map address, reference map, center main direction point, auxiliary quality inspection point coordinates, yaw angle, pitch angle, roll angle, mobile terminal positioning latitude and longitude, positioning accuracy, optional altitude information, direction source, direction quality, number of stable samples, number of effective yaw angle samples, on-site map, calibration notes, and browser capability information.
[0053] Specifically, once the mobile device meets the conditions of reliable direction, horizontal stability, continuous stability, location presence, and dual-map confirmation, the system allows the submission of calibration records. The submitted calibration records include, but are not limited to: camera ID; calibration personnel information; reference map address and related information; coordinates of the central main direction point and auxiliary quality inspection points; stable window statistics such as yaw, pitch, and roll; mobile device location latitude and longitude, positioning accuracy, and optional altitude information; direction source, direction quality, number of stable samples, and number of valid yaw samples; landscape view of the site; calibration notes and browser capability information. Upon receiving the calibration records, the server writes them to the database and generates quality inspection assets based on the reference map, site view, and point information. Quality inspection assets can include the original site view, reference map annotation map, site map annotation map, transparent overlay map, and comprehensive quality inspection map. Through this server-side evidence storage mechanism, quality inspectors can verify in subsequent stages whether the central target is consistent, whether the auxiliary points are reasonable, whether the site map is deviated, whether the direction source is reliable, whether the number of stable samples is sufficient, and whether the positioning information is abnormal, thereby achieving low-cost traceable management of calibration results.
[0054] In this embodiment, the mobile terminal obtains a corresponding reference image based on the camera number of the camera to be calibrated, and determines the central main direction point and auxiliary quality inspection points on the reference image. This is suitable for batch, low-cost calibration and verification of fixed surveillance cameras that have been installed. The mobile terminal's rear camera is invoked, and a semi-transparent reference image, central main direction point, and auxiliary quality inspection points are superimposed on the camera preview screen. The center position of the image is aligned with the real target object, and when the preset shooting conditions are met, a scene image is captured. After comparing it with the reference image to confirm that there are no errors, the orientation time of the camera to be calibrated is monitored based on positioning permissions and orientation sensor permissions to obtain a reliable horizontal orientation angle. The reliability of the orientation data of the mobile terminal is improved by judging the reliability. Based on the reliable horizontal orientation angle, the attitude within a set time window is continuously collected. The system uses data to determine whether the attitude data within a set time window meets the submission requirements. If it does, a stable sampling queue is established based on the time window that meets the submission requirements. This facilitates the removal of abnormal samples and multiple data comparisons. The attitude data is then processed by outlier removal and averaging to obtain the target horizontal orientation angle. The calibration is completed, and the calibration record is uploaded to the server to confirm the instantaneous stability of the calibration submission, thus improving the stability of the orientation angle calculation. The server writes the calibration record into the database and generates quality inspection assets based on the reference map, the site map, the central main direction point, and auxiliary quality inspection points to verify the calibration of the target horizontal orientation angle. This enables low-cost orientation calibration of fixed surveillance cameras, ensures the accuracy of the calibration results, and improves the adaptability for field use.
[0055] Specifically, through the above calibration method, without relying on a dedicated calibration board, professional measuring equipment, or camera pan-tilt parameters, the correspondence between the center direction of the fixed monitoring camera reference image and the common target object on site can be established using mobile terminal, server reference image, and orientation sensor data. The reliable horizontal orientation angle can be stably sampled and quality controlled on the mobile terminal, thereby obtaining a recordable and verifiable camera orientation calibration result.
[0056] Furthermore, by comprehensively judging the reliable absolute direction, the horizontal state of the mobile phone, the continuous stable time, and the state at the moment of submission, the influence of relative attitude angle misuse, mobile phone not being placed flat, direction angle jumps, or jitter at the moment of submission on the calibration results is reduced. This enables ordinary on-site personnel to complete the acquisition of the orientation of fixed monitoring cameras with the help of mobile terminals, and save the reference map, on-site map, annotation points, direction angle, positioning information, and quality inspection records together, providing a basis for subsequent manual review or removal of abnormal samples.
[0057] like Figure 4 As shown, a fixed monitoring equipment orientation calibration system 20 for mobile terminals is provided to implement the orientation calibration method for fixed monitoring equipment for mobile terminals as described above. The system includes: a reference image acquisition module 21, a field image acquisition module 22, a reliable orientation angle acquisition module 23, a stable window judgment module 24, a calibration completion module 25, and a calibration verification module 26, wherein: The reference image acquisition module 21 is used by the mobile terminal to acquire the corresponding reference image based on the camera number of the camera to be calibrated, and to determine the central main direction point and auxiliary quality inspection point based on the reference image. The on-site image acquisition module 22 is used to call the mobile terminal's rear camera and overlay a semi-transparent reference image, a central main direction point, and auxiliary quality inspection points on the camera preview screen, align the center position of the image with the real target object, and acquire the on-site image when the preset shooting conditions are detected. The reliable orientation angle acquisition module 23 is used to compare and confirm the reference image and the on-site image. After confirming that there is no error, it listens for the orientation event of the camera to be calibrated based on the positioning permission and orientation sensor permission to obtain the reliable horizontal orientation angle. The stable window judgment module 24 is used to continuously collect attitude data within a set time window based on the reliable horizontal orientation angle, and to determine whether the attitude data within the set time window meets the submission qualification. The calibration completion module 25 is used to establish a stable sampling queue according to the time window when the attitude data meets the submission qualification, and to perform outlier removal and averaging on the attitude data to obtain the target horizontal orientation angle, complete the calibration, and upload the calibration record to the server. The calibration and verification module 26 is used by the server to write calibration records into the database and generate quality inspection assets based on the reference map, the site map, the central main direction point and the auxiliary quality inspection points, which are used to calibrate and verify the target horizontal orientation angle.
[0058] In this embodiment, the above-mentioned system is used to facilitate interaction between the mobile terminal and the server. By combining the server reference map, mobile terminal on-site image alignment, reliable direction sensor screening, stable sampling access control, and server quality inspection and evidence storage, the on-site acquisition and verification of the horizontal orientation of the fixed monitoring camera is completed. This solves the problems of high cost of on-site orientation calibration of fixed monitoring cameras, unstable reliability of mobile terminal direction data, susceptibility of single readings to jitter or magnetic interference, and lack of verification basis for calibration results.
[0059] In summary, compared with the prior art, the present invention has at least the following beneficial effects: (1) Reduce the implementation cost of on-site orientation calibration for fixed surveillance cameras. This invention does not rely on dedicated calibration boards, surveying equipment, camera pan-tilt angle feedback, or complex back-end geometric solutions. Instead, it utilizes mobile terminals, server-side reference maps, and browser orientation sensors to complete on-site orientation data acquisition. Ordinary on-site personnel can enter the calibration process by scanning a code, making it suitable for low-cost batch calibration and verification of fixed surveillance cameras that have already been installed.
[0060] (2) Improve the reliability of orientation data on mobile devices. This invention does not directly use the ordinary orientation angle returned by the mobile browser as the camera orientation angle, but first determines whether the orientation data belongs to a reliable absolute direction. For data that only represents relative attitude angles or browser internal coordinate angles, the system does not allow it to enter stable sampling and final submission, thereby reducing erroneous calibration caused by differences in orientation event implementation between different mobile devices and different browsers.
[0061] (3) Establishing a verifiable correspondence between the camera's reference direction and the actual target on site. This invention uses the main direction point at the center of the reference image to represent the main line of sight of the fixed monitoring camera, and through target alignment at the center of the on-site image on the mobile terminal, horizontal screen overlay shooting, and dual image confirmation, establishes a correlation between the direction acquired by the mobile terminal and the same real-world target corresponding to the center of the reference image. Compared to simply reading the compass angle, this invention can provide image-based information for orientation data.
[0062] (4) Reduce the impact of hand shake and changes in posture at the moment of submission on the results. Before submission, this invention performs continuous stability checks on the reliable yaw, pitch, and roll, and combines the level status, recent window fluctuations, continuous stability duration, and verification at the moment of submission to control submission eligibility. If the mobile device is not level, the orientation angle fluctuates too much, the orientation event is interrupted, or there is significant movement at the moment of submission, the system will prohibit submission or wait for a stable state again, thereby reducing the probability of abnormal instantaneous readings entering the results.
[0063] (5) Improve the stability of the final orientation angle calculation. This invention uses circumferential averaging and outlier sample removal for circumferential angles such as yaw, and uses trimmed mean or similar robust statistical methods for pitch and roll to avoid directly taking the sensor reading of the last frame, thereby reducing the impact of angle crossing the 0° / 360° boundary, short-term jumps, magnetic field disturbances or occasional sampling anomalies on the final calibration value.
[0064] (6) Facilitates the removal of abnormal samples and comparison of multiple collections. By storing information such as the number of stable samples, the number of effective yaw samples, orientation quality, positioning accuracy and quality inspection images through a stable sampling queue, multiple submission records from the same camera can be compared to identify obviously outlier orientation angles or on-site images that do not meet the quality inspection requirements, thereby improving the manageability of batch calibration data.
[0065] (7) Improve the adaptability of system deployment and field use. This invention adopts a method of server-side pre-drawing of reference diagrams, mobile terminal webpage collection, and back-end recording and evidence storage, avoiding direct access of mobile terminals to camera real-time streams and reducing dependence on on-site networks, video protocols, and camera access permissions. At the same time, this invention can adjust the stability threshold, sample size, and quality inspection rules according to different mobile terminals, browsers, and on-site accuracy requirements, and has good implementation flexibility.
[0066] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0067] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a computer storage medium (ROM / RAM, magnetic disk, optical disk) for execution by the computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Therefore, the present invention is not limited to any particular hardware and software combination.
[0068] The above description, in conjunction with specific embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such deductions or substitutions should be considered within the scope of protection of the present invention.
Claims
1. A method for calibrating the orientation of a fixed monitoring device for a mobile terminal, characterized in that, Includes the following steps: The mobile device obtains the corresponding reference image based on the camera number of the camera to be calibrated, and determines the central main direction point and auxiliary quality inspection points based on the reference image; The mobile device's rear camera is invoked, and a semi-transparent reference image, a central main direction point, and auxiliary quality inspection points are overlaid on the camera preview screen. The center of the image is aligned with the real target object, and when the preset shooting conditions are detected, a scene image is captured. The reference image and the on-site image are compared and confirmed to be correct. After confirmation, the direction events of the camera to be calibrated are monitored based on the positioning permission and the direction sensor permission to obtain the reliable horizontal orientation angle. Based on the reliable horizontal orientation angle, attitude data is continuously collected within a set time window to determine whether the attitude data within the set time window meets the submission qualification. If so, a stable sampling queue is established based on the time window that meets the submission qualification, and the attitude data is processed by removing outliers and averaging to obtain the target horizontal orientation angle, thus completing the calibration and uploading the calibration record to the server. The server writes the calibration record into the database and generates quality inspection assets based on the reference map, site map, central main direction point and auxiliary quality inspection points, which are used to calibrate and verify the target horizontal orientation angle.
2. The method for orientation calibration of a fixed monitoring device for a mobile terminal according to claim 1, characterized in that, The mobile terminal obtains a corresponding reference image based on the camera number of the camera to be calibrated, including: The server pre-stores reference images of all fixed surveillance cameras, and the reference images are associated with camera numbers, scene status, reference image paths, and reference image hash values; The camera number is obtained from the surveillance camera to be calibrated, and the corresponding reference image is obtained from the server based on the camera number and returned to the mobile terminal.
3. The method for orientation calibration of a fixed monitoring device for a mobile terminal according to claim 1, characterized in that, The step of determining the central main direction point and auxiliary quality inspection points according to the reference diagram includes: The coordinates of the reference image are normalized, and the normalized center position is taken as the center point corresponding to the main line of sight of the camera image to obtain the center main direction point. Based on the stable target in the reference diagram, auxiliary quality inspection points are set at the four corners of the reference diagram.
4. The method for orientation calibration of a fixed monitoring device for a mobile terminal according to claim 1, characterized in that, The process of acquiring a scene image when preset shooting conditions are met includes: The mobile device's posture is detected. When the mobile device is in landscape soft lock mode, the center target is determined to be aligned based on the reference image, the central main direction point, and the auxiliary quality inspection points. If the images are aligned, it means that the preset shooting conditions are met, and the scene will be captured.
5. The method for orientation calibration of a fixed monitoring device for a mobile terminal according to claim 1, characterized in that, The comparison and confirmation of the reference diagram and the site diagram includes: Compare the reference image and the on-site image to determine whether the central main direction point of the two images is pressing on the same real target object, and whether the auxiliary quality inspection points and the overall image direction of the two images are within the preset error range. If the central main direction points of both objects press against the same real-world target, and the auxiliary quality inspection points and the overall image direction of both objects are within the preset error range, then the on-site diagram is confirmed to be correct. Conversely, re-collect site photos until the site photos are confirmed to be correct.
6. The method for orientation calibration of a fixed monitoring device for a mobile terminal according to claim 1, characterized in that, The process of listening to the orientation events of the camera to be calibrated based on positioning and orientation sensor permissions to obtain a reliable horizontal orientation angle includes: Based on location permissions and orientation sensor permissions, the orientation events of the camera to be calibrated are obtained, and the orientation events include the orientation source and the horizontal orientation angle. The reliability of the horizontal orientation angle is determined based on the direction source, wherein when the direction source is a compass direction field and an absolute direction, the corresponding horizontal orientation angle is determined to be a reliable horizontal orientation angle.
7. The method for orientation calibration of a fixed monitoring device for a mobile terminal according to claim 1, characterized in that, The determination of whether the attitude data within the set time window meets the submission eligibility criteria includes: If the attitude data within the set time window meets the following conditions: there is a reliable horizontal orientation angle; the orientation data is not interrupted within the set time window; the number of samples within the time window reaches a preset minimum value; the yaw angle or the original yaw angle's circular angle deviation within the time window does not exceed the yaw angle threshold; the fluctuation range of the pitch angle and roll angle does not exceed the preset fluctuation threshold; the mobile device is in landscape mode; the level indicator status meets preset conditions; and the current instantaneous yaw angle, pitch angle, and roll angle are within the set range of the center of the stable window, and the above stable states are continuously maintained for a preset duration, then the time window is considered a stable time window that meets the submission qualification.
8. The method for orientation calibration of a fixed monitoring device for a mobile terminal according to claim 1, characterized in that, The calibration record includes: camera number, calibration personnel information, reference map address, reference map, center main direction point, auxiliary quality inspection point coordinates, yaw angle, pitch angle, roll angle, mobile terminal positioning latitude and longitude, positioning accuracy, optional altitude information, direction source, direction quality, number of stable samples, number of effective yaw angle samples, site map, calibration notes, and browser capability information.
9. A system for calibrating the orientation of a fixed monitoring device for mobile terminals, characterized in that, A method for calibrating the orientation of a fixed monitoring device for a mobile terminal as described in any one of claims 1-8 includes: The reference image acquisition module is used by the mobile terminal to acquire the corresponding reference image based on the camera number of the camera to be calibrated, and to determine the central main direction point and auxiliary quality inspection points based on the reference image. The on-site image acquisition module is used to call the mobile terminal's rear camera and overlay a semi-transparent reference image, a central main direction point, and auxiliary quality inspection points on the camera preview screen. It aligns the center of the image with the real target object and acquires the on-site image when the preset shooting conditions are met. The reliable orientation angle acquisition module is used to compare and confirm the reference image and the on-site image. After confirming that there is no error, it listens for the orientation event of the camera to be calibrated based on the positioning permission and orientation sensor permission to obtain the reliable horizontal orientation angle. The stable window judgment module is used to continuously collect attitude data within a set time window based on the reliable horizontal orientation angle, and to determine whether the attitude data within the set time window meets the submission qualification. The calibration completion module is used to establish a stable sampling queue based on the time window when the attitude data meets the submission qualification, and to perform outlier removal and averaging on the attitude data to obtain the target horizontal orientation angle, complete the calibration, and upload the calibration record to the server. The calibration and verification module is used by the server to write the calibration records into the database and generate quality inspection assets based on the reference map, the site map, the central main direction point and the auxiliary quality inspection points, for calibration and verification of the target horizontal orientation angle.