Image adaptive method and device, storage medium and electronic equipment
By denoising, outlier removal, and data fusion of sensor data from PDA devices, combined with magnetic interference compensation, the image deviation problem caused by strong electromagnetic interference in substations was solved, achieving accurate alignment of perimeter images and improving inspection efficiency and safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-03-13
AI Technical Summary
During substation inspections, the sensors of PDA devices are affected by strong electromagnetic interference, causing the orientation displayed in the perimeter two-dimensional image to deviate from the actual geographical orientation on site, reducing inspection efficiency and increasing the risk of misjudgment.
By acquiring raw data from the accelerometer, gyroscope, and magnetometer on the PDA device, multi-scale wavelet decomposition and isolated forest model processing are performed to remove noise and outliers. Data fusion is then performed using Sigma point sampling and Kalman filtering to calculate the initial azimuth angle. Magnetic interference compensation is then performed based on the characteristics of the strong electromagnetic environment of the substation. Finally, image rotation is driven to align the perimeter image.
It effectively counteracts azimuth deviations caused by electromagnetic interference, improves inspection efficiency, reduces the risk of misjudgment, and ensures that the perimeter image is consistent with the actual geographical location.
Smart Images

Figure CN121660892A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image technology, and in particular to an image adaptation method, apparatus, storage medium, and electronic device. Background Technology
[0002] During routine inspections or construction monitoring of substations, inspectors typically use PDA devices to view two-dimensional images of the substation perimeter to help locate the site and assess the status of perimeter facilities. However, the presence of numerous strong electromagnetic interference sources within substations, such as transformers, high-voltage transmission lines, and switchgear, can affect the measurement accuracy of the sensors mounted on the PDA devices. This can lead to discrepancies between the orientation displayed on the perimeter two-dimensional image and the actual geographical location on site. Inspectors then need to frequently manually adjust the image orientation, which not only reduces inspection efficiency but also carries the risk of missed items or misjudgments due to misalignment. Summary of the Invention
[0003] In view of the above problems, this application provides an image adaptation method, apparatus, storage medium and electronic device.
[0004] To solve the above-mentioned technical problems, this application proposes the following solution:
[0005] In a first aspect, this application provides an image adaptive method, which includes: acquiring raw data from each sensor on a PDA device; performing fusion calculation on the raw data from each sensor to obtain an initial azimuth angle value of the PDA device; performing magnetic interference compensation on the initial azimuth angle value based on the characteristics of the strong electromagnetic environment of the substation to obtain an azimuth angle correction value; calculating the target rotation angle of the perimeter two-dimensional image using the azimuth angle correction value, and driving the perimeter image display component on the PDA device to perform a rotation operation to obtain a perimeter image consistent with the actual geographical location on site.
[0006] Secondly, this application provides an image adaptation device, which includes:
[0007] The acquisition module is used to acquire raw data from each sensor on the PDA device;
[0008] The fusion module is used to fuse and calculate the raw data from each sensor to obtain the initial azimuth angle value of the PDA device.
[0009] The correction module is used to perform magnetic interference compensation on the initial azimuth angle based on the characteristics of the strong electromagnetic environment of the substation, and obtain the azimuth angle correction value.
[0010] The adaptive module is used to calculate the target rotation angle of the perimeter 2D image based on the azimuth correction value, and drive the perimeter image display component on the PDA device to perform a rotation operation to obtain a perimeter image that is consistent with the actual geographical location on site.
[0011] To achieve the above objectives, according to a third aspect of this application, a storage medium is provided, the storage medium including a stored program, wherein, when the program is running, the device where the storage medium is located controls the execution of the image adaptation method of the first aspect described above.
[0012] To achieve the above objectives, according to a fourth aspect of this application, an electronic device is provided, the device including at least one processor, and at least one memory and bus connected to the processor; wherein the processor and memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the image adaptation method of the first aspect described above.
[0013] By employing the above-described technical solution, the technical solution provided in this application has at least the following advantages:
[0014] This application leverages the combined advantages of data from multiple sensors to initially determine equipment orientation references, thereby reducing the limitations of data from a single sensor. Based on this, and considering the strong electromagnetic environment characteristics of substations, magnetic interference compensation is applied to the initial azimuth angle value. This accurately addresses the impact of strong electromagnetic interference sources such as transformers and high-voltage transmission lines on sensor measurements. This design directly cancels out azimuth angle deviations caused by electromagnetic interference, eliminating the need for frequent manual adjustments to image orientation by inspection personnel. This improves inspection efficiency and reduces the risk of missed or misjudged inspections due to misalignment.
[0015] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0016] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0017] Figure 1 A flowchart illustrating an image adaptation method provided in an embodiment of this application is shown.
[0018] Figure 2 A schematic diagram of the structure of an image adaptive device provided in an embodiment of this application is shown;
[0019] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0020] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0021] In the embodiments of this application, the terms "first," "second," etc., do not have a logical or temporal dependency, nor do they limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another.
[0022] In this application, the term "at least one" means one or more, and the term "multiple" means two or more.
[0023] It should also be understood that the term “if” can be interpreted as “when” or “upon”, or “in response to determination” or “in response to detection”. Similarly, depending on the context, the phrase “if determination…” or “if detection [the stated condition or event]” can be interpreted as “when determination…” or “in response to determination…” or “when detection [the stated condition or event]” or “in response to detection [the stated condition or event]”.
[0024] During routine inspections or construction monitoring of substations, inspectors typically use PDA devices to view two-dimensional images of the substation perimeter to help locate the site and assess the status of perimeter facilities. However, substations contain numerous sources of strong electromagnetic interference, such as transformers, high-voltage transmission lines, and switchgear, which can affect the measurement accuracy of the sensors on the PDA devices. This can lead to discrepancies between the orientation displayed in the two-dimensional perimeter image and the actual geographical location on site. Inspectors then need to frequently manually adjust the image orientation, which not only reduces inspection efficiency but also risks omissions or misjudgments due to misalignment.
[0025] In view of this, this application provides an image adaptation method, which will be described in detail below with reference to the accompanying drawings. Figure 1 This is a flowchart illustrating an image adaptation method provided in this application. Specifically, it includes the following steps:
[0026] Step 110: Obtain the raw data from each sensor on the PDA device.
[0027] To meet the needs of substation inspections, PDA devices typically integrate multiple sensors for attitude and orientation sensing. Among these, an accelerometer collects raw acceleration data of the PDA device in three-dimensional space, reflecting the device's gravitational direction reference and linear motion state. A gyroscope collects raw angular velocity data of the PDA device around its three-dimensional coordinate axes, reflecting the rate of attitude change. A magnetometer collects raw geomagnetic intensity data of the environment in which the PDA device is located, providing an initial reference for geographical orientation. In practice, when inspection personnel bring the PDA device into the substation inspection area, they use the PDA device's hardware driver interface to call the aforementioned sensors in real time, collecting raw data from each sensor at a preset sampling frequency. The collected raw data is then temporarily stored in the PDA device's cache module to ensure data continuity and integrity.
[0028] In substation inspection scenarios, the sensors on PDA devices, such as accelerometers, gyroscopes, and magnetometers, are susceptible to interference from strong electromagnetic radiation, equipment vibration, and sudden changes in the inspector's handheld posture during raw data acquisition. This results in high-frequency noise (such as instantaneous voltage fluctuations caused by electromagnetic interference being transmitted to the sensor data) and sudden anomalies (such as magnetometer data jumps caused by electromagnetic pulses when near high-voltage switchgear). Directly using noisy and abnormal data for subsequent azimuth angle fusion calculations will significantly reduce the accuracy of the initial azimuth angle value and may even cause deviations in subsequent magnetic interference compensation. Therefore, after acquiring the raw data from each sensor, a preprocessing procedure is necessary to eliminate the influence of noise and anomalies. The following section details this preprocessing process.
[0029] First, the raw data from each sensor is subjected to multi-scale wavelet decomposition to separate noise from effective signals. Considering that sensor data (such as the gravity component signal from the accelerometer and the attitude change signal from the gyroscope) are mostly in the form of a superposition of low-frequency effective signals and high-frequency noise, this application selects wavelet basis functions with good time-frequency localization characteristics and determines the number of decomposition layers according to the sampling frequency of the sensor. Too few decomposition layers will not be able to fully separate high-frequency noise, while too many layers will easily lead to the high-frequency components of the effective signal being misjudged as noise. The specific decomposition process is as follows: the raw time-series data of a single-path sensor (such as the x-axis of the accelerometer) is input into the wavelet decomposition module, and the data is decomposed into multiple scales using the Mallat algorithm to obtain the low-frequency wavelet coefficients (corresponding to the effective signal components in the sensor data, such as the device gravity direction information reflected by the accelerometer and the steady attitude change information reflected by the gyroscope) and high-frequency wavelet coefficients (corresponding to noise components such as electromagnetic interference and vibration) of each layer. Subsequently, threshold truncation is performed on the high-frequency wavelet coefficients using an adaptive soft thresholding strategy based on noise levels (soft thresholding avoids signal abrupt changes caused by hard thresholding and is more suitable for smoothing and denoising sensor data): First, the noise level is estimated using the standard deviation of the top-level high-frequency coefficients after decomposition. Then, the threshold for each layer of high-frequency coefficients is determined based on this noise level. High-frequency coefficients with absolute values less than the threshold are set to zero, and those with absolute values greater than the threshold are subtracted from the threshold to suppress noise. After high-frequency coefficient processing, the processed high-frequency coefficients and the unprocessed low-frequency coefficients are input into the inverse wavelet transform module, and the denoised sensor data is reconstructed using the Mallat inverse algorithm. After this step, the high-frequency noise in the sensor data (such as ±0.2 m / s caused by electromagnetic interference) is significantly reduced. 2 Acceleration fluctuations and angular velocity fluctuations of ±0.05 rad / s can be effectively filtered out, and the data signal-to-noise ratio can be improved from the original 12dB to more than 28dB, ensuring the integrity and stability of the effective signal.
[0030] Next, the denoised sensor data is input into an isolated forest model composed of multiple isolated trees to identify and remove outliers from the data. In substation scenarios, sensors are prone to generating outliers due to sudden electromagnetic pulses (such as instantaneous electromagnetic fields generated during switch operation) and equipment collisions (such as accidental touches by inspection personnel using a handheld PDA). These outliers appear as discrete points that deviate greatly from the normal data distribution (such as magnetometer data suddenly jumping from 45μT to 120μT and lasting for 1-2 sampling cycles). If not removed, they will seriously interfere with subsequent azimuth angle calculations. The Isolation Forest model achieves rapid outlier identification by randomly partitioning the feature space. Its construction process is as follows: Each isolated tree is selected with 256 training data points, and 100-200 isolated trees are constructed to form a forest (the more trees, the stronger the stability of outlier identification; more than 100 trees can effectively avoid the randomness error of a single tree). For each isolated tree, a feature dimension (such as accelerometer y-axis data or gyroscope z-axis data) and a split value on that dimension are randomly selected (the split value is between the maximum and minimum values of the data in that dimension). The sample data is divided into two parts, and this splitting process is repeated until each leaf node contains only one sample or a preset tree depth is reached. When denoised sensor data is input, the average path length of each data point in all isolated trees is calculated (i.e., the number of splits the data point traverses from the root to the leaf node), and this average path length is converted into an outlier score (the outlier score ranges from 0 to 1; the shorter the average path length, the higher the outlier score, indicating that the data point is more likely to be an outlier). A preset anomaly score threshold is established. When the anomaly score of a data point exceeds this threshold, it is identified as an outlier and removed. This step can identify and remove more than 98% of sudden outliers, effectively preventing abnormal data from interfering with subsequent processes.
[0031] Finally, linear interpolation is used to fill the data gaps after outlier removal to ensure the temporal continuity of the sensor data. After outlier removal, missing time points will appear in the data sequence (e.g., if data at time t3 is identified as an outlier and removed, a gap will exist between the data at times t2 and t4). If data with gaps is used directly for subsequent calculations, it will lead to discontinuities or errors in the azimuth calculation. Linear interpolation fills the gaps based on the linear correlation between adjacent normal data points. The specific operation is as follows: First, locate the start and end positions of the data gap, that is, determine the nearest normal data point before the gap (denoted as time t). prev The data value is x prev The nearest normal data point after the gap (denoted as time t) next The data value is x next ); Calculate the time interval Δt = t between two normal data points. next -t prev and the data difference Δx=xn ext -xprev Based on the number of missing data points n within the gap (e.g., t) prev With t next With a two-sampling-period interval (n=2, corresponding to times t1 and t2), calculate the interpolated data value for each missing time: for any time t within the gap... i (t prev <t i <t next ), its data value x i =x prev +(t i -t prev )*(Δx / Δt). For example, t prev =100ms x prev =9.81m / s 2 (Accelerometer z-axis gravity component), t next =300ms x next =9.79m / s 2 The data value within the gap at t=200ms is x=9.81+(200-100)*(9.79-9.81) / (300-100)=9.80m / s 2 .
[0032] Step 120: Perform fusion calculation on the raw data from each sensor to obtain the initial value of the azimuth angle of the PDA device.
[0033] Because raw data from a single sensor has inherent limitations. For example, while a gyroscope can quickly respond to changes in device attitude, long-term measurements can lead to accumulated errors due to drift effects. An accelerometer, while determining a vertical reference through the gravitational component, is susceptible to dynamic interference such as hand-held vibrations of the PDA device and the bumps caused by the movement of inspection personnel. A magnetometer, while directly sensing geomagnetic information, can provide azimuth reference in areas of the substation without strong electromagnetic interference (such as the interference-free area at the start of an inspection), but struggles to cope with complex interference alone. Therefore, this application employs multi-sensor fusion calculation to combine the advantages of each sensor and reduce the error impact of a single sensor. The core idea of this fusion calculation is: based on the device motion and azimuth information reflected in the raw data of each sensor, a fusion logic suitable for attitude and azimuth estimation is used to collaboratively process the gravitational reference from the accelerometer, the attitude change from the gyroscope, and the geomagnetic reference information from the magnetometer, eliminating noise and interference components in the data from a single sensor, and finally calculating the initial azimuth angle of the PDA device. The initial azimuth value here specifically refers to the horizontal angle between the orientation of the PDA device's display screen and a certain reference direction in the geographic coordinate system. This initial value can initially reflect the geographic location of the PDA device.
[0034] Specifically, the raw sensor data from the PDA device includes accelerometer (3 axes, corresponding to linear acceleration in the x, y, and z directions), gyroscope (3 axes, corresponding to angular velocity around the x, y, and z axes), and magnetometer (3 axes, corresponding to geomagnetic intensity in the x, y, and z directions), totaling 9 dimensions of state parameters. Therefore, the fusion calculation's state vector dimension is set to 9 dimensions, denoted as x = [a x ,a y ,a z ,w x ,w y ,w z ,m x ,m y ,m z ] T (Where a is acceleration, w is angular velocity, and m is geomagnetic intensity). The error covariance matrix P is initialized as a 9×9 diagonal matrix, with the diagonal elements representing the measurement error variance of the raw data from each sensor. Based on the sensor's factory accuracy and substation field test data, the accelerometer measurement error variance is set to ((0.05m / s²). 2 ) 2 The gyroscope is set to (0.01 rad / s). 2 The magnetometer is set to ((2μT)). 2 Off-diagonal elements are set to 0 (assuming the measurement errors of the raw data from each sensor are independent). Sampling points are generated using the Sigma point sampling method adapted to multi-dimensional data. Based on the 9-dimensional state vector, (2*9+1=19) Sigma sampling points are generated, each sampling point x... i Through the mean of the state vector The result is calculated using the Cholesky decomposition of the error covariance matrix P (initially the instantaneous average of the raw data from each sensor) and the error covariance matrix P. The i-th column, The i-th column (where n = 9 is the state dimension and λ is the scaling factor).
[0035] Next, each sampling point is processed through state transition to obtain predicted sampling points. The predicted sampling points are then weighted to obtain the mean of the predicted state vector. The core of the state transition processing is based on the device's motion characteristics, mapping the current sampling point to the predicted state at the next moment. Considering the handheld motion characteristics of the PDA device during substation inspection, the state transition equation is set as follows: angular velocity sampling points update the attitude angle change through first-order integration; acceleration sampling points update the velocity increment through first-order integration after deducting the gravity component (estimated based on the initial attitude angle); and geomagnetic intensity sampling points remain unchanged temporarily due to the relatively stable geomagnetic environment in a short period. The 19 Sigma sampling points x i Substituting each value into the state transition equation, we obtain 19 predicted sampling points x. i -Weighted calculation of the mean of the predicted state vector At that time, assign corresponding weights to each prediction sampling point: initial sampling point x0 - weight Weights of the remaining sampling points Through formula The mean of the predicted state vector is calculated, which initially reflects the state estimate of the equipment at the next moment.
[0036] The predicted sampling points are processed to obtain observed sampling points. The mean of the observed vector is then calculated by weighting these observed sampling points. The purpose of the observation processing is to map the predicted sampling points to the actual observation space of the sensor, ensuring consistency with the observation dimension of the original sensor data. The observation equation is set as follows: the acceleration, angular velocity, and geomagnetic intensity parameters in the predicted sampling points are directly mapped to observed values, i.e., z... i =H*x i - The observation matrix H is a 9×9 identity matrix. The 19 prediction sampling points x... i - Substituting into the observation equation, we obtain 19 observation sampling points z. i Weighted calculation of the mean of the observation vector At that time, the same weight allocation strategy as the mean of the predicted state vector is adopted, through the formula... The calculated mean value is the theoretical observation value corresponding to the predicted state, which is used for subsequent comparison with the actual observation value.
[0037] The next step is to introduce an observation noise matrix and calculate the observation error covariance matrix by combining the deviation between the observed sampling points and the mean of the observed vector. The observation noise matrix R is a 9×9 diagonal matrix, and its diagonal elements are the observation noise variance of the original data of each sensor. Based on the electromagnetic environment test at the substation, the accelerometer observation noise variance is set to ((0.03m / s) 2 ) 2 The gyroscope is set to (0.008 rad / s). 2 The magnetometer is set to (1.5μT). 2 (This noise level includes the interference from the strong electromagnetic environment of the substation on the sensor), off-diagonal elements are set to 0. Calculate the deviation between the observed sampling points and the mean of the observed vector. Through formula Calculate the observation error covariance matrix P zz ,in To calculate the weights for the covariance, an observation noise matrix R is added to compensate for random noise during the observation process.
[0038] When calculating the cross-covariance matrix between the predicted state vector and the observed vector based on the deviations between the predicted sampling points and the mean of the predicted state vector, the deviations between the observed sampling points and the mean of the observed vector, and the weights of the sampling points, the deviation between the predicted sampling points and the mean of the predicted state vector is calculated first. Combined with the already calculated △z i Through formula Calculate the cross covariance matrix P xz This matrix reflects the correlation between the predicted state vector and the observed vector, and is a core parameter for subsequent calculation of the Kalman gain.
[0039] Next, the Kalman gain is calculated based on the cross-covariance matrix and the observation error covariance matrix. The Kalman gain is used to balance the confidence level between the predicted state and the observed value; the calculation formula is as follows: in Let P be the inverse of the observation error covariance matrix. To avoid numerical instability caused by direct inversion, the Cholesky decomposition method is used to decompose P. zz Decompose the problem and then solve it using forward and backward substitution. The final result is a 9×9 Kalman gain matrix K.
[0040] Subsequently, through the formula Calculate the prediction error covariance matrix This matrix reflects the uncertainty of the predicted state vector. When calculating the observation residual between the actual observations of each sensor and the mean of the observation vector, the actual observations z of each sensor are... meas The observation residual is the raw sensor data vector acquired in real time by the PDA device. The residual reflects the difference between the predicted and actual observations and serves as the basis for state correction.
[0041] The state correction Δx is calculated using the formula Δx = K·Δz. This correction dynamically adjusts the deviation of the predicted state vector based on the product of the observation residual and the Kalman gain. For example, when the actual magnetometer observation is too high due to electromagnetic interference, the element corresponding to the geomagnetic intensity in Δz will be positive. The element in the corresponding row of K will then convert this deviation into a state correction, reducing the value of the geomagnetic intensity in the predicted state. Calculate the updated state vector This vector integrates information from the predicted state and the actual observations, compared to... Its accuracy in estimating equipment condition is significantly improved. This is achieved through the formula... Calculate the updated error covariance matrix This matrix reflects the uncertainty of the updated state vector. Finally, in the updated state vector... In this context, the azimuth parameter is derived from both the geomagnetic intensity component and the attitude angle. Based on the magnetometer's m... x m y The components, combined with the attitude angles (roll and pitch angles) obtained by gyroscope integration, are used to calculate the azimuth angle using the formula ψ = arctan2(m). y ·cosφ-m z ·sinφ,m x ·cosθ+m y ·sinφ·sinθ+m z The azimuth angle ψ is derived from cosφ and sinθ, and this value is the initial azimuth angle of the PDA device.
[0042] Through the above-mentioned fusion calculation and state update steps, the advantages of the original data of each sensor of the PDA device can be fully utilized, the influence of single sensor error and substation environmental interference can be effectively reduced, and the initial value of the azimuth angle can be accurately obtained, providing key angular basis for the azimuth alignment of the perimeter image in the entire image adaptive method.
[0043] Step 130: Perform magnetic interference compensation on the initial azimuth angle based on the characteristics of the strong electromagnetic environment of the substation to obtain the azimuth angle correction value.
[0044] The strong electromagnetic environment of a substation is a key factor affecting the accuracy of azimuth angle. During operation, equipment such as transformers, high-voltage busbars, and circuit breakers within a substation generate strong alternating or constant magnetic fields that vary with the equipment's location and operating status. These magnetic fields are superimposed on the Earth's magnetic field, causing significant deviations in the geomagnetic data collected by the magnetometer, thus leading to a discrepancy between the initial azimuth angle value and the actual geographical location. Therefore, this application designs a compensation strategy specifically for the characteristics of the strong electromagnetic environment in substations. First, based on the equipment layout information of the substation, the location of the main strong electromagnetic interference sources within the inspection area (such as the area where the main transformer is located, the area of the high-voltage switchgear cluster) and the interference patterns (such as the characteristic that the interference intensity decreases with increasing distance from the interference source) are identified. Based on this characteristic, the deviation component caused by strong electromagnetic interference in the initial azimuth angle value is identified. For example, when a PDA device approaches a known interference source, the magnetic interference intensity in the area is determined based on the interference model of the interference source, thereby determining the proportion of the initial azimuth angle value affected by this interference. Subsequently, a compensation algorithm is used to eliminate this interference component, correcting and adjusting the initial azimuth angle value to finally obtain the corrected azimuth angle value. This correction value can effectively offset the impact of the strong electromagnetic environment of the substation on sensor measurements and accurately reflect the current true geographical location of the PDA device.
[0045] Specifically, at any inspection location in the substation, the measured value M collected by the magnetometer is... measEssentially, it refers to the interference-free geomagnetic vector M0 at that location (the actual vector of the Earth's magnetic field at that location, which can be obtained through geomagnetic mapping data of the area where the substation is located; for example, if a substation is located near 30° North latitude, its horizontal component of the interference-free geomagnetic vector is approximately 23 μT, and its vertical component is approximately 40 μT) and the magnetic interference vector M at that location. dist The vector sum of the interference magnetic field vectors generated by substation equipment (the direction of which is related to the magnetic field distribution of the interference source; for example, the direction of the interference magnetic field of the main transformer is mostly along the axis of its core), i.e., M. meas =M0+M dist +ε), where ε is the magnetometer measurement noise. To quantify the degree of deviation among the three, a compensation objective function is constructed with the goal of minimizing the sum of squares of the differences between the measured value and the 'unaffected geomagnetic vector + magnetic interference vector'. The specific expression is as follows: Where N is the preset number of sampling data points, M meas,k M represents the measured value of the magnetometer at the k-th sampling point. 0,k The interference-free geomagnetic vector of the kth sampling point (if the PDA device moves slowly, M in a short time) 0,k M can be considered a constant value. dist,k Let M be the magnetic interference vector at the k-th sampling point. The physical meaning of this objective function is: by adjusting M... dist The value of is chosen so that the sum of the interference-free geomagnetic vector and the magnetic interference vector approximates the measured value of the magnetometer as closely as possible, thereby achieving an accurate estimation of the magnetic interference vector.
[0046] Secondly, the layout of electrical equipment in a substation is usually predetermined, and the magnetic interference characteristics of different types of equipment vary. For example, the magnetic interference range of a main transformer is typically 5-15 meters, with an interference vector magnitude of approximately 3-10 μT. The interference range of a 35kV high-voltage switchgear is approximately 2-5 meters, with an interference vector magnitude of approximately 1-5 μT. The interference range of a 10kV busbar bridge is approximately 1-3 meters, with an interference vector magnitude of approximately 0.5-3 μT. Based on this, an initial value for the magnetic interference vector is preset. The specific method is as follows: First, determine the distance between the current inspection location and each known interference source using the positioning module of the PDA device (e.g., 8 meters from main transformer #1 and 3 meters from high-voltage switchgear #2); then, based on the type and distance of the interference source, query the preset "equipment type-distance-interference vector" mapping table to determine the initial magnitude of the magnetic interference vector at the current location (e.g., the initial magnitude of main transformer #1 at a distance of 8 meters is 4 μT); finally, based on the direction of the magnetic field of the interference source (e.g., if the direction of the main transformer core axis is east-west, then the initial direction of the interference vector is set to east-west), determine... The three-dimensional components (e.g., x-axis for east-west, y-axis for north-south, z-axis for perpendicular to the ground) can be used to set the initial vector to [4,0,0]μT. The iterative learning rate η needs to balance the iteration convergence speed and stability. If η is too large, the iteration process is prone to oscillations and difficult to converge; if η is too small, the iteration convergence speed is too slow, affecting real-time performance. Considering the computing power of PDA devices in substation scenarios (usually quad-core or octa-core processors with a main frequency of 1.5-2.5GHz), η is set to 0.01-0.05 (e.g., 0.03). This range can ensure convergence within 100-200 iterations while avoiding oscillations.
[0047] Subsequently, the magnetic interference vector is iteratively updated using the gradient descent method. The iteration stops and the final magnetic interference vector is determined when the deviation between two adjacent iterations is less than a preset threshold. The core idea of the gradient descent method is: along the objective function J(M)... dist ) for M dist Update M by negative gradient direction dist The objective function value is gradually decreased until convergence. The specific iterative process is as follows: 1. Calculate the gradient of the objective function in the t-th iteration. For the objective function J(M) dist Please provide information about M. dist The partial derivatives of can be obtained. in, 1. The magnetic interference vector in the t-th iteration. 2. Update the magnetic interference vector: the magnetic interference vector in the (t+1)-th iteration. That is, adjust M along the negative gradient direction. dist This reduces the objective function value. 3. Calculate the deviation between two adjacent iterations: This deviation reflects the degree of convergence of the iteration. 4. Determine if convergence has occurred: A preset deviation threshold δ is set. If... Then the iteration is considered to have converged, and the iteration is stopped. Determined as the final magnetic interference vector If convergence is not achieved, return to step 1 to continue iterating.
[0048] Finally, the process involves calculating the gravity vector based on accelerometer data, combining the measured values from the magnetometer with the final magnetic interference vector to obtain the compensated geomagnetic vector, and then correcting the initial azimuth angle using the arctangent correlation calculation method to obtain the corrected azimuth angle value. First, the gravity vector G is calculated: the accelerometer of the PDA device collects three-dimensional acceleration data A. acc This data includes the equipment's dynamic acceleration (such as the vibration acceleration when inspection personnel walk) and gravitational acceleration (i.e., the components of the gravity vector G). The influence of dynamic acceleration is removed by moving average filtering, resulting in acceleration data A containing only the gravitational component. gravity Then the gravity vector G = A gravity (Because the magnitude of gravitational acceleration is approximately 9.8 m / s²)2 Since the direction is perpendicular to the ground and downwards, the modulus of G is approximately 9.8 m / s². 2 The direction can reflect the tilt state of the PDA device. Next, the compensated geomagnetic vector M is calculated. comp Based on the above-determined measured value M of the magnetometer meas With the final magnetic interference vector Eliminating interference effects through vector subtraction, i.e. This vector has been freed from the influence of strong electromagnetic interference from the substation and can be approximated as the true geomagnetic vector of the current location. Its magnitude and direction are closer to the interference-free geomagnetic vector M0, providing a reliable geomagnetic reference for azimuth correction. The initial azimuth value is corrected using the arctangent correlation calculation method: the azimuth angle is essentially the horizontal angle between the PDA device's orientation and geographic true north, and needs to be calculated based on the gravity vector G and the compensated geomagnetic vector M0. comp Tilt correction is performed, and the geomagnetic component on the horizontal plane is extracted. Let the roll angle of the PDA device be φ and the pitch angle be θ. Then, the projected component of the compensated geomagnetic vector on the horizontal plane is: The corrected azimuth angle ψ is calculated based on the horizontal projection component using the arctangent function. corr (i.e., azimuth correction value), the formula is:
[0049] The above-mentioned magnetic interference compensation process can effectively eliminate the influence of the strong electromagnetic environment of the substation on the initial value of the azimuth angle, and obtain an accurate azimuth angle correction value. This provides key technical support for the subsequent alignment of the perimeter two-dimensional image with the actual geographical location on site based on the correction value, ensuring that inspection personnel can view the accurate perimeter image through PDA devices in any area of the substation.
[0050] Step 140: Calculate the target rotation angle of the perimeter two-dimensional image based on the azimuth correction value, drive the perimeter image display component on the PDA device to perform a rotation operation, and obtain a perimeter image that is consistent with the actual geographical location on site.
[0051] During substation inspections, even with accurate azimuth correction values obtained through magnetic interference compensation, directly adjusting the perimeter 2D image based solely on the azimuth angle can still lead to spatial misalignment between the perimeter image and the actual geographical location due to changes in the PDA's handheld position (e.g., movement of the equipment due to personnel walking) or tilt (e.g., the screen deviating from a horizontal position when held). For example, if the image is rotated only by the azimuth angle when the PDA is tilted, the image will display the correct orientation but will not match the actual spatial location. Therefore, this application determines the current position and attitude parameters of the PDA based on sensor preprocessing data, calculates the target rotation angle using the azimuth correction value, and finally drives the display component to perform a rotation operation, ensuring complete alignment between the perimeter image and the actual geographical location.
[0052] Specifically, after obtaining the azimuth correction value, the current position and attitude parameters of the PDA device are determined based on the preprocessed data from each sensor. The position parameters specifically refer to the relative coordinates of the PDA device in the local coordinate system of the substation (e.g., with the inspection starting point as the origin, the x-axis pointing along the main road of the substation, the y-axis perpendicular to the main road, and the z-axis perpendicular to the ground, denoted as (x...). p ,y p ,z p The attitude parameters are used to characterize the spatial position of the equipment on site. The attitude parameters refer to the equipment's three-dimensional attitude angles (roll angle φ, the angle of rotation around the x-axis, reflecting the equipment's left and right tilt; pitch angle θ, the angle of rotation around the y-axis, reflecting the equipment's forward and backward tilt; yaw angle...). The rotation angle around the z-axis (which is related to the azimuth correction value) is used to characterize the spatial attitude of the device. The determination of these position and attitude parameters requires combining the kinematic characteristics of the sensor data with observation constraints.
[0053] The following describes the specific implementation method for determining the current position and attitude parameters of a PDA device based on the preprocessed data from each sensor.
[0054] The first step involves calculating the attitude angle change based on the preprocessed angular velocity data, and calculating the linear acceleration after subtracting the gravitational component from the preprocessed acceleration data. The velocity increment and displacement increment are obtained through time integration. These attitude angle changes, velocity increments, and displacement increments are accumulated to obtain the initial position and attitude parameters. The preprocessed angular velocity data refers to the angular velocities (ω) around the x, y, and z axes output by the gyroscope. x ,w y ,w z When calculating the change in attitude angle, the trapezoidal integral method is used, which is the change in roll angle within a certain time period Δt (e.g., a sensor sampling period of 10ms). Similarly, the pitch angle change Δθ and the yaw angle change Δψ can be obtained. These changes are then compared with the initial attitude angles (when the equipment is placed horizontally at the start of the inspection, the initial attitude angles are set as φ0=0°, θ0=0°, ψ0=ψ). init,0 Accumulate the initial attitude angle φ. init =φ0+∑△φ,θ init =θ0+∑△θ,ψ init =ψ0 + ∑△ψ. For position parameters, the preprocessed acceleration data is the accelerometer output (a x ,a y ,a z The gravitational component needs to be subtracted first. This is based on the initial attitude angle φ. init ,θ init Calculate the component of gravitational acceleration in the device coordinate system (g) x =g·sinθ init ,gy =-g·sinφ init ·cosθ init ,g z =-g·cosφ init ·cosθ init Where g = 9.8 m / s 2 If the linear acceleration a is given by the given condition, then the linear acceleration a is given by the given condition. x,lin =a x -g x ,a y,lin =a y -g y ,a z,lin =a z -g z Then, the velocity increment is obtained by integrating the linear acceleration using a trapezoidal integral (e.g., ...). The current speed v is obtained by accumulating the speed increment. x =∑△v x ,v y =∑△v y ,v z =∑△v z Finally, the displacement increment is obtained by integrating the velocity. The initial position parameter (x) is obtained by accumulating displacement increments. init ,y init ,z init (The initial position is set to the inspection start point coordinates (0,0,0)).
[0055] The second step involves constructing observation constraints based on preprocessed data from the accelerometer and magnetometer. These constraints characterize the deviations of the initial position and attitude parameters from the reference directions of the gravity and geomagnetic fields. The core of constructing these observation constraints is utilizing the fixed reference characteristics of the gravity and geomagnetic fields. The gravity field direction is always perpendicular to the ground and downwards (in the local coordinate system of the substation, the components of the gravity reference direction are fixed at (0,0,-g)). The geomagnetic field reference direction is the interference-free geomagnetic vector for that area (e.g., the geomagnetic vector M measured in the interference-free area of the substation). ref =(M x,ref M y,ref M z,ref (Pre-stored in the PDA device). For the accelerometer's constraints: based on the initial attitude angle φ... init ,θ init The accelerometer preprocessing data A in the device coordinate system can be used. acc =(a x ,a y ,a z Convert to component A in the local coordinate system acc,local This component should be related to the gravity vector (0,0,-g) + the device acceleration vector A in the local coordinate system. mov,localConsistent, because the inspection personnel walk at a relatively slow speed, the acceleration vector A mov,local Since the amplitude is small, the constraint can be simplified to A. acc,local The absolute value of the deviation from (0,0,-g) is less than 0.5 m / s. 2 Regarding the constraints of the magnetometer: Similarly, the preprocessed magnetometer data M in the device coordinate system... meas =(m x ,m y ,m z The initial attitude angle is converted into the component M in the local coordinate system. meas,local This component should be related to the geomagnetic field reference vector M. ref Consistent, considering the residual weak interference in the substation, the constraint condition is set to M. meas,local The absolute value of the deviation between and is less than 1 μT. These two constraints together constitute the observation verification standard for the initial position and attitude parameters; deviations exceeding the range indicate that there is an integral error in the initial parameters.
[0056] The third step involves iteratively adjusting the initial position and attitude parameters based on observation constraints by minimizing the deviation, thereby eliminating the accumulated error during the integration process. This application employs the least squares method to construct the deviation objective function. Taking attitude parameter adjustment as an example: let the adjusted attitude angle be φ. adj =φ init +△φ adj ,θ adj =θ init +△θ adj , (△φ adj ,△θ adj (For attitude adjustment), the accelerometer data is converted into components A in the local coordinate system. acc,local,adj Let the objective function be J = [A acc,local,adj -(0,0,-g)] 2 +[M meas,local,adj -M ref ] 2 By finding the minimum value of the objective function, Δφ adj ,△θ adj The adjusted attitude angle φ is obtained. adj ,θ adj For the position parameters, since the displacement integration error mainly comes from accelerometer vibration interference, it can be re-integrated by combining the linear acceleration after attitude adjustment. Substituting the adjusted attitude angle into the gravity component, the corrected linear acceleration 'a' is obtained. x,lin,adj ,a y,lin,adj ,a z,lin,adj By re-integrating, the velocity increment and displacement increment are obtained, and then the adjusted position parameter (x) is obtained. adj ,y adj ,z adjDuring the iterative adjustment process, the deviation of the observation constraints needs to be recalculated after each adjustment. If the deviation does not decrease, the step size of the adjustment amount is adjusted (e.g., by adjusting Δφ). adj The step size is reduced from 0.1° to 0.05° until the deviation gradually converges.
[0057] The fourth step involves setting the adjusted position and attitude parameters as the current position and attitude parameters of the PDA device when the deviation is less than a preset threshold. The preset thresholds are set based on the accuracy requirements of substation inspections: for attitude parameter deviations, the roll and pitch angle deviation thresholds are set to 0.5° (a deviation exceeding 0.5° will cause significant tilting after image rotation), and the yaw angle deviation threshold is set to 0.3° (to match the accuracy of the azimuth correction value). The position parameter deviation threshold is set to 0.1 meters (in substation inspections, a 0.1-meter position deviation will not affect the spatial matching between the perimeter image and the site). The specific judgment method is: calculate the observation constraint deviation ||A| corresponding to the adjusted attitude angle. acc,local,adj -(0,0,-g)‖and‖M meas,local,adj -M ref If all values are less than the constraint deviation thresholds of the accelerometer and magnetometer (0.5 m / s²), 2 1μT), and the adjustment deviation of the attitude angle itself (‖φ) adj -φ init ||、||θ adj -θ init ||x|| < 0.5°, heading angle deviation < 0.3°, and position parameter adjustment deviation (||x||) < 0.3°. adj -x init If the deviation is less than 0.1 meters, then the deviation is considered to meet the requirements. adj ,y adj ,z adj ) and (φ adj ,θ adj ,ψ adj )(ψ adj The adjusted heading angle (in conjunction with the azimuth correction value) serves as the current position and attitude parameters.
[0058] Next, using a preset reference azimuth as a reference, and combining the position and attitude parameters with the azimuth correction value, the deviation angle between the current azimuth of the PDA device and the preset reference azimuth is calculated, and the deviation angle is determined as the target rotation angle of the perimeter two-dimensional image. The preset reference azimuth adapts to the fixed geographic reference of the substation scenario, typically set as a direction with clear geographic significance within the substation. For example, the orientation of the main gate of the substation's main control building can be used as the reference azimuth (this direction is pre-determined through substation geographic mapping data and preset as the positive y-axis direction of the local coordinate system in the PDA device), or the geographic true north direction can be directly used (pre-set after calibration using geomagnetic data from an interference-free area). When calculating the deviation angle, the display plane of the perimeter two-dimensional image is first compensated for based on the roll and pitch angles in the attitude parameters. Because there is an angle between the image display plane and the horizontal geographic plane when the PDA device is tilted, the spatial projection direction of the image is first corrected using attitude parameters to ensure that subsequent azimuth angle comparisons are based on the same horizontal reference. Then, the position parameter (x... p ,y p ,z p Confirm the current substation area where the equipment is located (e.g., if the equipment is located east and west of the No. 1 main transformer, the on-site geographical reference corresponding to the same azimuth angle is consistent, and there is no need to adjust the position to avoid the influence of the deviation angle). Finally, compare the current azimuth of the PDA equipment after attitude compensation (i.e., the azimuth correction value ψ). corr ) and preset reference orientation (ψ) ref ), through the formula △ψ=ψ corr -ψ ref Calculate the deviation angle Δψ. If Δψ is positive, it indicates that the device's current orientation is offset clockwise relative to the reference orientation, and the target rotation angle is clockwise Δψ; if it is negative, it is counterclockwise |Δψ|. For example, the preset reference orientation is geographic north ψ. ref =0°, azimuth correction value ψ ref =30°, then the deviation angle △ψ = 30°, and the target rotation angle is 30° clockwise, ensuring that the north direction of the image after rotation is completely consistent with the actual north direction on site.
[0059] Finally, a rotation command containing the target rotation angle is sent to the perimeter image display component on the PDA device, driving the display component to perform a rotation operation on the perimeter 2D image by the corresponding angle. The perimeter image display component of the PDA device specifically includes display hardware (such as an LCD or OLED screen), a display driver module, and an image rendering engine (responsible for pixel-level rotation calculations). When sending the rotation command, the PDA device's control module first converts the target rotation angle into a parameter format recognizable by the display driver (such as an angle value in radians, or an angle code preset by the driver module), and then sends the command to the display driver module through the hardware interface. After receiving the command, the display driver module calls the image rendering engine to perform rotation processing on the perimeter 2D image. The rendering engine uses a bilinear interpolation algorithm to resample the rotated pixels to avoid jagged edges in the image (the substation perimeter image contains details such as fence lines and equipment markings; bilinear interpolation ensures that these details remain clearly discernible after rotation); after the rotation processing is complete, the driver displays the processed image. For example, when the target rotation angle is 30° clockwise, the rendering engine first determines the rotation center point of the image (usually the image center point, ensuring the image is centered after rotation). Then, it performs a rotation transformation on the coordinates of each pixel in the image (e.g., after rotating the original pixel coordinates (x, y) by 30° clockwise, the new coordinates (x′, y′) = (cos30°·x + sin30°·y, -sin30°·x + cos30°·y). Finally, it supplements the grayscale / color values of the transformed pixels through bilinear interpolation to complete the rotation and display. After this process, the display direction of the perimeter 2D image perfectly matches the actual geographical location on site. Inspection personnel can hold a PDA device at any location in the substation and see that the "perimeter fence direction" and "inspection point location" in the image are consistent with the actual geographical location observed on site, allowing for intuitive judgment of the site location without manual adjustment.
[0060] It is understood that, in order to achieve the functions in the above embodiments, the computer device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and method steps described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0061] Furthermore, as a response to the above Figure 1The implementation of the method embodiment shown in this application provides an image adaptive device. The embodiment of this device corresponds to the foregoing method embodiments. For ease of reading, this embodiment will not repeat the details of the foregoing method embodiments one by one, but it should be understood that the device in this embodiment can correspondingly implement all the contents of the foregoing method embodiments. Specifically, as shown... Figure 2 As shown, the image adaptation device 200 includes:
[0062] The acquisition module 210 is used to acquire raw data from each sensor on the PDA device;
[0063] The fusion module 220 is used to perform fusion calculations on the raw data from each sensor to obtain the initial value of the azimuth angle of the PDA device;
[0064] Correction module 230 is used to perform magnetic interference compensation on the initial azimuth angle based on the characteristics of the strong electromagnetic environment of the substation, and obtain the azimuth angle correction value;
[0065] The adaptive module 240 is used to calculate the target rotation angle of the perimeter two-dimensional image based on the azimuth correction value, and drive the perimeter image display component on the PDA device to perform a rotation operation to obtain a perimeter image that is consistent with the actual geographical location on site.
[0066] Furthermore, such as Figure 2 As shown, the acquisition module 210 is also used to perform multi-scale wavelet decomposition on the raw data of each sensor to obtain wavelet coefficients in different frequency bands; to perform threshold truncation on the wavelet coefficients in the high frequency band, and to perform inverse wavelet transform on the processed wavelet coefficients to reconstruct the denoised sensor data; to input the denoised sensor data into an isolated forest model composed of multiple isolated trees to determine the anomaly score of each data point; when the anomaly score of a data point exceeds a preset anomaly score threshold, the anomalies exceeding the preset anomaly score threshold are removed, and the data gaps after removing the anomalies are filled by linear interpolation to obtain the preprocessed data.
[0067] Furthermore, such as Figure 2As shown, the fusion module 220 is specifically used to generate sampling points based on the dimension and error covariance matrix of the raw data from each sensor; to obtain predicted sampling points through state transition processing of each sampling point, and to calculate the mean of the predicted state vector by weighting the predicted sampling points; to obtain observed sampling points through observation processing of the predicted sampling points, and to calculate the mean of the observed vector by weighting the observed sampling points; to introduce the observation noise matrix, and to calculate the observation error covariance matrix based on the deviation between the observed sampling points and the mean of the observed vector; to calculate the cross covariance matrix between the predicted state vector and the observed vector based on the deviation between the predicted sampling points and the mean of the predicted state vector, the deviation between the observed sampling points and the mean of the observed vector, and the weight of the sampling points; to solve for the Kalman gain based on the cross covariance matrix and the observation error covariance matrix; to update the predicted state vector and the prediction error covariance matrix by combining the actual observed values of each sensor and the Kalman gain, and to extract the initial azimuth angle value from the updated state vector.
[0068] Furthermore, such as Figure 2 As shown, the fusion module 220 is specifically used to calculate the observation residual between the actual observed values of each sensor and the mean of the observation vector; multiply the Kalman gain and the observation residual to obtain the state correction amount; add the state correction amount to the mean of the predicted state vector to obtain the updated state vector; correct the prediction error covariance matrix based on the Kalman gain, the observation error covariance matrix, and the transpose of the Kalman gain to obtain the updated error covariance matrix; and extract the parameter value of the corresponding azimuth angle from the updated state vector as the initial value of the azimuth angle of the PDA device.
[0069] Furthermore, such as Figure 2 As shown, the correction module 230 is specifically used to construct a magnetic interference compensation objective function based on the deviation relationship between the magnetometer measured value, the interference-free geomagnetic vector, and the magnetic interference vector; to preset the initial value of the magnetic interference vector based on the known location of electromagnetic equipment in the substation, and to set the iteration learning rate; to iteratively update the magnetic interference vector using the gradient descent method, and to stop the iteration and determine the final magnetic interference vector when the deviation of the magnetic interference vector obtained from two adjacent iterations is less than a preset threshold; to calculate the gravity vector based on the accelerometer data, and to obtain the compensated geomagnetic vector by combining the magnetometer measured value and the final magnetic interference vector; and to correct the initial value of the azimuth angle using the arctangent correlation calculation method to obtain the azimuth angle correction value.
[0070] Furthermore, such as Figure 2As shown, the adaptive module 240 is specifically used to determine the current position and attitude parameters of the PDA device based on the preprocessed data from each sensor; using a preset reference orientation as a reference, and combining the position and attitude parameters with the azimuth angle correction value, it calculates the deviation angle between the current orientation of the PDA device and the preset reference orientation, and determines the deviation angle as the target rotation angle of the perimeter two-dimensional image; it sends a rotation command containing the target rotation angle to the perimeter image display component on the PDA device, driving the display component to perform a rotation operation of the corresponding angle on the perimeter two-dimensional image.
[0071] Furthermore, such as Figure 2 As shown, the adaptive module 240 is specifically used to calculate the attitude angle change based on the preprocessed angular velocity data, calculate the linear acceleration after subtracting the gravity component from the preprocessed acceleration data, obtain the velocity increment and displacement increment through time integration, accumulate the attitude angle change, velocity increment, and displacement increment to obtain the initial position and attitude parameters; construct observation constraints based on the preprocessed data from the accelerometer and magnetometer, the constraints characterizing the deviation of the initial position and attitude parameters from the reference directions of the gravitational field and geomagnetic field; based on the observation constraints, iteratively adjust the initial position and attitude parameters by minimizing the deviation to eliminate the accumulated error during the integration process; when the deviation of the adjusted position and attitude parameters is less than a preset threshold, the adjusted position and attitude parameters are used as the current position and attitude parameters of the PDA device.
[0072] Optionally, the image adaptation device may be an electronic device with data processing capabilities, or a functional module within the electronic device, without limitation.
[0073] For example, the electronic device can be a server, which can be a single server or a server cluster consisting of multiple servers. As another example, the electronic device can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, and other terminal devices. As yet another example, the electronic device can also be a recording device, video surveillance equipment, etc. This application does not impose any special limitations on the specific form of the electronic device.
[0074] The following example uses an image adaptation device as an electronic device, such as... Figure 3 As shown, Figure 3 The hardware structure of an electronic device 300 provided in this application.
[0075] like Figure 3 As shown, the electronic device 300 includes a processor 310, a communication line 320, and a communication interface 330.
[0076] Optionally, the electronic device 300 may also include a memory 340. The processor 310, memory 340, and communication interface 330 can be connected via a communication line 320.
[0077] The processor 310 can be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 310 can also be any other device with processing capabilities, such as a circuit, device, or software module, without limitation.
[0078] In one example, processor 310 may include one or more CPUs, for example Figure 3 CPU0 and CPU1 in the CPU.
[0079] As an optional implementation, the electronic device 300 may include multiple processors, for example, in addition to processor 310, it may also include processor 370. A communication line 320 is used to transmit information between the components included in the electronic device 300.
[0080] Communication interface 330 is used for communication with other devices or other communication networks. These other communication networks can be Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), etc. Communication interface 330 can be a module, circuit, transceiver, or any device capable of enabling communication.
[0081] The memory 340 is used to store instructions. These instructions can be computer programs.
[0082] The memory 340 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and / or instructions; it may also be a random access memory (RAM) or other type of dynamic storage device capable of storing information and / or instructions; it may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, etc., without limitation.
[0083] It should be noted that the memory 340 can exist independently of the processor 310, or it can be integrated with the processor 310. The memory 340 can be used to store instructions, program code, or some data, etc. The memory 340 can be located inside or outside the electronic device 300, without restriction.
[0084] The processor 310 is configured to execute instructions stored in the memory 340 to implement the communication method provided in the following embodiments of this application. For example, when the electronic device 300 is a terminal or a chip in a terminal, the processor 310 can execute instructions stored in the memory 340 to implement the steps performed by the sending end in the following embodiments of this application.
[0085] As an optional implementation, the electronic device 300 also includes an output device 350 and an input device 360. The output device 350 can be a display screen, speaker, or other device capable of outputting data from the electronic device 300 to the user. The input device 360 can be a keyboard, mouse, microphone, joystick, or other device capable of inputting data into the electronic device 300.
[0086] It should be pointed out that, Figure 3 The structure shown does not constitute a limitation on the electronic device, except... Figure 3 In addition to the components shown, the electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0087] The image adaptation device and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of image adaptation devices and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0088] This application provides a storage medium storing a program that, when executed by a processor, implements the image adaptation method.
[0089] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0090] In a typical configuration, the device includes one or more processors (CPUs), memory, and a bus. The device may also include input / output interfaces, network interfaces, etc.
[0091] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM, and memory includes at least one memory chip. Memory is an example of computer-readable media.
[0092] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0093] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0094] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0095] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. An image adaptive method, characterized in that, The method includes: Acquire raw data from each sensor on the PDA device; The initial azimuth angle of the PDA device is obtained by fusing and calculating the raw data from each sensor. Based on the characteristics of the strong electromagnetic environment of the substation, magnetic interference compensation is performed on the initial value of the azimuth angle to obtain the corrected value of the azimuth angle. The target rotation angle is calculated based on the azimuth correction value, and the perimeter image display component on the PDA device is driven to perform a rotation operation to obtain a perimeter image that is consistent with the actual geographical location on site.
2. The method according to claim 1, characterized in that, After acquiring the raw data from each sensor, the method further includes: The raw data from each sensor were subjected to multi-scale wavelet decomposition to obtain wavelet coefficients for different frequency bands. Threshold truncation is performed on the high-frequency wavelet coefficients, and inverse wavelet transform is performed on the processed wavelet coefficients to reconstruct the denoised sensor data. The denoised sensor data is input into an isolated forest model composed of multiple isolated trees to determine the anomaly score for each data point. When the abnormal score of a data point exceeds a preset abnormal score threshold, the abnormal values exceeding the preset abnormal score threshold are removed, and the data gaps after removing the abnormal values are filled by linear interpolation to obtain the preprocessed data.
3. The method according to claim 2, characterized in that, The raw data from each sensor is fused and calculated to obtain the initial azimuth angle value of the PDA device, including: Sampling points are generated based on the dimensions and error covariance matrix of the raw data from each sensor; Each sampling point is processed by state transition to obtain predicted sampling points, and the predicted sampling points are weighted to obtain the mean of the predicted state vector. The predicted sampling points are processed by observation to obtain observed sampling points, and the observed sampling points are weighted to obtain the mean of the observed vector. An observation noise matrix is introduced, and the observation error covariance matrix is calculated by combining the deviation between the observation sampling points and the mean of the observation vector. Based on the deviation between the predicted sampling point and the mean of the predicted state vector, the deviation between the observed sampling point and the mean of the observed vector, and the weight of the sampling point, calculate the cross-covariance matrix between the predicted state vector and the observed vector. The Kalman gain is calculated based on the cross covariance matrix and the observation error covariance matrix. By combining the actual observations from each sensor with the Kalman gain, the predicted state vector and the prediction error covariance matrix are updated, and the initial azimuth value is extracted from the updated state vector.
4. The method according to claim 3, characterized in that, By combining the actual observations from each sensor with the Kalman gain, the predicted state vector and the prediction error covariance matrix are updated. The initial azimuth value is extracted from the updated state vector, including: Calculate the observation residual between the actual observed values of each sensor and the mean of the observation vector; The state correction is obtained by multiplying the Kalman gain with the observation residual. The updated state vector is obtained by adding the state correction amount to the mean of the predicted state vector. Based on the Kalman gain, the observation error covariance matrix, and the transpose of the Kalman gain, the prediction error covariance matrix is corrected to obtain the updated error covariance matrix. Extract the parameter value of the corresponding azimuth angle from the updated state vector and use it as the initial azimuth angle value of the PDA device.
5. The method according to any one of claims 1-4, characterized in that, Based on the characteristics of the strong electromagnetic environment of the substation, magnetic interference compensation is performed on the initial azimuth angle value to obtain the corrected azimuth angle value, including: A magnetic interference compensation objective function is constructed based on the deviation relationship between the measured values of the magnetometer, the interference-free geomagnetic vector, and the magnetic interference vector. Based on the known locations of electromagnetic equipment in the substation, an initial value for the magnetic interference vector is preset, and an iterative learning rate is set. The magnetic interference vector is iteratively updated using the gradient descent method. When the deviation between two adjacent iterations of the magnetic interference vector is less than a preset threshold, the iteration is stopped and the final magnetic interference vector is determined. The gravity vector is calculated based on accelerometer data. The compensated geomagnetic vector is obtained by combining the measured value of the magnetometer with the final magnetic interference vector. The initial value of the azimuth angle is corrected by the arctangent correlation calculation method to obtain the corrected azimuth angle value.
6. The method according to claim 5, characterized in that, Based on the azimuth correction value, the target rotation angle of the perimeter two-dimensional image is calculated, and the perimeter image display component on the PDA device is driven to perform a rotation operation to obtain a perimeter image consistent with the actual geographical location on site, including: The current position and attitude parameters of the PDA device are determined based on the preprocessed data from each sensor. Using a preset reference orientation as a reference, and combining the position and attitude parameters and the azimuth correction value, the deviation angle between the current orientation of the PDA device and the preset reference orientation is calculated, and the deviation angle is determined as the target rotation angle of the perimeter two-dimensional image. A rotation command containing the target rotation angle is sent to the perimeter image display component on the PDA device, driving the display component to perform a rotation operation on the perimeter two-dimensional image by the corresponding angle.
7. The method according to claim 6, characterized in that, The current position and attitude parameters of the PDA device are determined based on the preprocessed data from each sensor, including: The attitude angle change is calculated based on the preprocessed angular velocity data, and the linear acceleration is calculated after subtracting the gravitational component from the preprocessed acceleration data. The velocity increment and displacement increment are obtained by time integration. The initial position and attitude parameters are obtained by accumulating the attitude angle change, velocity increment, and displacement increment. Observational constraints are constructed by combining the preprocessed data from accelerometers and magnetometers. These constraints characterize the deviations of the initial position and attitude parameters from the reference directions of the gravitational field and geomagnetic field. Based on the observation constraints, the initial position and attitude parameters are iteratively adjusted by minimizing the deviation to eliminate the accumulated error during the integration process; When the deviation between the adjusted position and attitude parameters is less than the preset threshold, the adjusted position and attitude parameters will be used as the current position and attitude parameters of the PDA device.
8. An image adaptive device, characterized in that, The device includes: The acquisition module is used to acquire raw data from each sensor on the PDA device; The fusion module is used to fuse and calculate the raw data from each sensor to obtain the initial azimuth angle value of the PDA device. The correction module is used to perform magnetic interference compensation on the initial azimuth angle based on the characteristics of the strong electromagnetic environment of the substation, so as to obtain the corrected azimuth angle value. An adaptive module is used to calculate the target rotation angle of the perimeter two-dimensional image based on the azimuth correction value, and drive the perimeter image display component on the PDA device to perform a rotation operation to obtain a perimeter image that is consistent with the actual geographical location on site.
9. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to perform the image adaptation method as described in any one of claims 1-7.
10. An electronic device, characterized in that, The device includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the image adaptation method as described in any one of claims 1-7.