Method and apparatus for automated testing of flight instruments based on picture difference detection

By synchronously sending drive data to the flight simulation instrument and the original instrument, and corresponding to the screen in real time and performing automated difference detection, the problems of low efficiency and human factor influence in traditional testing methods are solved, and efficient and accurate automated testing of flight simulation instruments is achieved.

CN120448278BActive Publication Date: 2026-05-19BEIJING REALFLY AVIATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING REALFLY AVIATION TECH CO LTD
Filing Date
2025-05-21
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Traditional flight simulation instrument testing methods rely on manual inspection, which is inefficient, has insufficient coverage, and is easily affected by human factors, making it difficult to detect subtle differences and reproduce logically complex scenarios.

Method used

By simultaneously sending the same drive data to both the flight simulation instrument and the original instrument, the system dynamically corresponds to the screen in real time, extracts the area to be tested, performs grayscale conversion, pixel difference calculation, difference threshold comparison, and morphological processing, and automatically detects screen differences to achieve automated testing.

Benefits of technology

It improves testing efficiency and accuracy, enables batch testing of screens, accurately filters out problem scenarios, facilitates problem reproduction and modification, and supports multi-level testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448278B_ABST
    Figure CN120448278B_ABST
Patent Text Reader

Abstract

The application relates to a flight simulation instrument automatic testing method and device based on picture difference detection, which comprises the following steps: sending the same driving data to a flight simulation instrument and an original instrument; extracting a picture area to be tested generated by the flight simulation instrument and the original instrument according to the driving data; performing difference detection analysis and processing on the two extracted picture areas to be tested, and saving the processing results; and performing data analysis and reproduction by using the processing results to realize automatic testing of the flight simulation instrument. The application integrates advanced image processing and difference detection technology. The test software automatically traverses various limit parameters, different data combinations and other running conditions, realizes efficient and accurate comparison and analysis between a flight simulation instrument picture and an original instrument picture, and improves the efficiency and accuracy of flight simulation instrument display consistency evaluation of a tester.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of flight instrument testing technology, specifically relating to an automated testing method and apparatus for flight instruments based on image difference detection. Background Technology

[0002] The realism and accuracy of flight simulation instruments significantly impact the quality of a high-level flight simulator. Ensuring the realism and accuracy of the appearance, color, position, and logic of the flight simulation instrument system during its development has long been a challenge for testers. Traditional flight simulation instrument testing methods typically rely on manual inspection and subjective judgment, resulting in low testing efficiency, insufficient test coverage, and susceptibility to subjective human influence. Traditional methods rely on manually observing the differences between the original and simulated images by inputting the same data into the flight simulation instruments and the original instruments, thus determining whether the appearance, color, position, and logic of each instrument's display elements are consistent. Firstly, subtle differences in the images are difficult to detect, requiring testers to spend a significant amount of time comparing each set of images. Secondly, comparisons can only be made on a limited number of typical scenarios; otherwise, the workload for testers would explode. Finally, for logically complex test scenarios, when differences occur, testers often struggle to accurately record the patterns of the problems, making it difficult for developers to reproduce and resolve issues even when they are discovered.

[0003] Existing technology (CN118733453A) discloses a method for testing the content display of an instrument panel based on test cases; acquiring test screenshots of the corresponding content display effect of the vehicle's instrument panel; comparing the test screenshots with the standard display image corresponding to the target test case, analyzing similarity information, and outputting the target test result corresponding to the test command based on the relationship between the processing result and a threshold. This method uses a pre-prepared standard display image to compare with the test screen generated by the instrument panel under test. However, the standard display image is pre-made or set and is a static image. Changes such as hardware / software upgrades or appearance adjustments to the test instrument panel will prevent testing, requiring updates to the standard display image. This will increase testing costs and lead to inaccurate testing. Summary of the Invention

[0004] To overcome the problems existing in the prior art, the present invention provides an automated testing method and apparatus for flight instruments based on image difference detection, which is used to overcome the current defects.

[0005] An automated testing method for flight simulation instruments based on image difference detection, the method comprising the following steps:

[0006] S1. Simultaneously send the same driving data to the flight simulation instrument and the original instrument. Under the same driving data, the flight simulation instrument and the original instrument achieve a real-time dynamic one-to-one correspondence between their screens under each set of input conditions.

[0007] S2. Extract the test screen area generated by the flight simulation instrument and the original instrument based on the drive data;

[0008] S3. Perform difference detection analysis and processing on the two extracted test image regions to obtain the processing results;

[0009] S4. Perform data analysis and reproduction on the processing results to achieve automated testing of flight simulation instruments.

[0010] In addition to the aspects described above and any possible implementation, a further implementation is provided in which the driving data in S1 is generated by a data generator that generates the driving data based on historical generated parameter data and their combinations.

[0011] In addition to the aspects and any possible implementations described above, a further implementation is provided, wherein S2 specifically includes: S21. Consistently deploying the flight simulation instrument screen and the original instrument screen according to the same scale and size;

[0012] S22. Set the screen capture interval, and capture the dynamic screen of the flight simulation instrument and the original instrument dynamic screen generated by the driving data to obtain the screen image;

[0013] S23. Extract the area of ​​the screen to be tested from the screen image.

[0014] In addition to the aspects and any possible implementations described above, a further implementation is provided, wherein S3 specifically includes:

[0015] S31. Convert the two test areas into grayscale images;

[0016] S32. Subtract the pixel values ​​at the same coordinates in the two grayscale images to obtain the difference pixel values;

[0017] S33. Compare the difference pixel values ​​with a set threshold, perform binarization processing, and obtain a binarized image;

[0018] S34. Denoise the binarized image and perform contour detection to draw the contours of the difference regions.

[0019] In addition to the aspects described above and any possible implementations, a further implementation is provided, wherein the grayscale image conversion formula is:

[0020] in, The pixel values ​​at coordinates (x,y) represent the grayscale image of the test area of ​​the flight simulation instrument or the grayscale image of the test area of ​​the original instrument. R(x,y), G(x,y), and B(x,y) are the pixel values ​​of the red component, green component, and blue component of the test area of ​​the flight simulation instrument or the test area of ​​the original instrument at coordinates (x,y), respectively.

[0021] In addition to the aspects described above and any possible implementation, a further implementation is provided in which the formula for calculating the difference pixel value in S32 is: ,

[0022] in, This represents the pixel value at coordinates (x, y). and These are the pixel values ​​at coordinates (x, y) for the grayscale image of the original instrument and the grayscale image of the flight simulation instrument, respectively.

[0023] In addition to the aspects described above and any possible implementations, a further implementation is provided in which the binarization process uses the following formula:

[0024]

[0025] in: It represents the pixel value at coordinates (x, y) in the binarized image. It is the difference pixel value at coordinates (x,y), and T is the preset threshold.

[0026] The present invention also provides an automated testing device for flight simulation instruments based on image difference detection. The device is used to implement the method and includes the following modules:

[0027] The sending module is used to simultaneously send the same drive data to both the flight simulation instrument and the original instrument.

[0028] The extraction module is used to extract the test screen area generated by the flight simulation instrument and the original instrument based on the driving data;

[0029] The analysis and processing module is used to perform difference detection analysis and processing on the two extracted test regions to obtain the processing results.

[0030] The analysis and reproduction module is used to perform data analysis and reproduction on the processing results, thereby realizing automated testing of flight simulation instruments.

[0031] The present invention also provides an electronic device, the electronic device comprising:

[0032] Memory, which stores executable instructions;

[0033] A processor that executes the executable instructions in the memory to implement the method.

[0034] The present invention also provides a computer storage medium storing a computer program, the computer program being executed by a processor to implement the method described.

[0035] Beneficial effects of the present invention

[0036] This invention discloses an automated testing method for flight simulation instruments based on image difference detection. The method includes the following steps: simultaneously sending the same driving data to both the flight simulation instrument and the original instrument; extracting the test image regions generated by the flight simulation instrument and the original instrument based on the driving data; performing difference detection analysis and processing on the extracted two test image regions, and saving the processing results; and using the processing results for data analysis and reproduction to achieve automated testing of the flight simulation instrument. This invention integrates advanced image processing and difference detection technologies. By automating the testing software through various extreme parameters and different data combinations, it achieves efficient and accurate comparison and analysis between the flight simulation instrument image and the original instrument image, thereby improving the efficiency and accuracy of testers in assessing the consistency of flight simulation instrument displays. The software's automated detection and result recording functions can record data for problematic situations, facilitating the reproduction and modification of problematic scenarios by development engineers. The present invention has the following advantages: 1) The difference detection can accurately mark the differences between two images, which is fast and accurate, and does not require manual comparison by testers, saving a lot of time; 2) The automated program can test images in batches, quickly skipping flight simulation instruments that have no problems, and can accurately screen out problematic test scenarios, which is convenient for problem reproduction and modification; 3) By modifying the threshold, the tolerance limit for differences can be adjusted, thereby realizing automatic testing at multiple levels such as image element level, area effect level, and logic level. Attached Figure Description

[0037] Figure 1 This is a flowchart of the method of the present invention;

[0038] Figure 2 This is a schematic diagram of the original instrument's test area according to the present invention;

[0039] Figure 3 This is a schematic diagram of the test area of ​​the flight simulation instrument of the present invention;

[0040] Figure 4 This is a schematic diagram of the binarized image of the present invention;

[0041] Figure 5A schematic diagram showing the results of difference calculation between images from the original instrument and the flight simulation instrument;

[0042] Figure 6 This is a graph showing the results of the difference comparison;

[0043] Figure 7 (a) and (b) in the figure are comparison diagrams of the larger and smaller threshold values ​​of the present invention, respectively;

[0044] Figure 8 This is a schematic diagram illustrating the effect of the expansion operation of the present invention;

[0045] Figure 9 This is a schematic diagram illustrating the effect of the corrosion operation in this invention. Detailed Implementation

[0046] To better understand the technical solution of this invention, the content of this invention includes, but is not limited to, the specific embodiments described below. Similar technologies and methods should be considered within the scope of protection of this invention. To make the technical problems to be solved, the technical solutions, and advantages of this invention clearer, a detailed description will be provided below in conjunction with the accompanying drawings and specific embodiments.

[0047] It should be understood that the embodiments described in this invention are merely some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0048] This invention provides an automated testing method for flight simulation instruments based on image difference detection, the method comprising the following steps:

[0049] S1. Simultaneously send the same driving data to the flight simulation instrument and the original instrument. Under the same driving data, the flight simulation instrument and the original instrument achieve a real-time dynamic one-to-one correspondence between their screens under each set of input conditions.

[0050] S2. Extract the test screen area generated by the flight simulation instrument and the original instrument based on the drive data;

[0051] S3. Perform difference detection analysis and processing on the two extracted test regions to obtain the processing results;

[0052] S4. Perform data analysis and reproduction on the processing results to achieve automated testing of flight simulation instruments.

[0053] In this invention, the flight simulation instrument, as the instrument under test, is a self-developed flight instrument system capable of simulating real flight and displaying corresponding flight parameters in real time under various input data. Its accuracy and stability need to be verified; therefore, it requires testing to ensure complete consistency with the original instrument's display under all test conditions, thus verifying its accuracy and reliability. The original instrument, to be replicated, serves as a reference instrument. During testing, the flight simulation instrument and the original instrument, under the same driving data, achieve a real-time dynamic one-to-one correspondence between their displays under each set of input conditions. The original instrument provides theoretically correct or fully verified flight parameter displays to ensure high reliability of the test data. In this invention, it serves as a reference standard during the flight simulation instrument testing process. Through comparative analysis, it verifies whether the flight simulation instrument can accurately present display results consistent with the original instrument under the same input conditions.

[0054] Specifically, such as Figure 1 As shown, the specific steps of this invention include: 1. Generating driving data; 2. Instrument screen acquisition and processing; 3. Difference detection, analysis and processing; 4. Data analysis and reproduction stage. The specific process of each step is described below:

[0055] 1. Generate driver data:

[0056] The driving data is generated by a data generator. The data generator's role is to construct one or more structures containing information about the display parameters of the flight instruments, ensuring that the flight simulation instruments and the original instruments operate with consistent input data, thus enabling the testing of various display states of the flight simulation instruments. Alternatively, the data generator can load previously saved results to reproduce the test results. Here, the primary flight display (PFD) is used as the flight simulation instrument, and its parameter structure is used as an example for illustration. This structure contains fields of key flight parameters displayed on the primary flight display (PFD), including but not limited to the parameters described in Table 1.

[0057] Table 1. Relevant parameters of the main flight instruments

[0058]

[0059] The working principle of the data generator is as follows:

[0060] The data generator operates in two modes: parameter generation mode and parameter reading mode.

[0061] (1) Parameter generation mode: The data generator automatically generates data according to the range of each parameter, including two methods: traversal generation and random generation. Among them, traversal generation follows the parameter range, starting from the minimum value and increasing sequentially with a fixed step size until the maximum value, thereby ensuring that the parameter values ​​tested cover all possible situations, especially boundary values ​​and extreme cases. By covering all possible parameters from the minimum to the maximum value range, the data generator enables the flight simulation instrument to simulate various states during flight after input. Subsequently, by performing a comparative analysis of the flight simulation instrument and the original instrument, it is ensured that the display logic of the flight simulation instrument is consistent with the corresponding display of the original instrument as a prescribed standard, thereby providing a guarantee for the comprehensiveness and reliability of the test.

[0062] Taking Altitude (barometric altitude) in Table 1 as an example: Parameter: Altitude (barometric altitude), unit: feet; Range: 1000~1500; Step size: 1 foot; Generation process: starting from 1000, incrementing by 1 each time until 1500; Generation sequence: 1000, 1001, 1002, 1003, ..., 1500.

[0063] Random generation involves generating a certain number of data points randomly within a parameter range, with each data point generated independently and without any pattern. This method more closely resembles the dynamic fluctuations of the real flight environment and helps verify the stability of flight simulation instruments under nonlinear and irregular inputs.

[0064] Taking Altitude (barometric altitude) in Table 1 as an example: Parameter: Altitude (barometric altitude), unit: feet; Range: 1000–1500; Generation strategy: Randomly generate 500 values; Result (example): 1050, 1002, 1166, 1356, ... Since the data is randomly generated, the values ​​may differ each time. This generated data is used as input for flight simulation instrument parameters to comprehensively test the display function of the flight simulation instruments.

[0065] Therefore, the data in parameter generation mode is complete test data automatically created by the data generator based on the set range and frequency rules, which is then used to verify the functional performance of the flight simulation instrument in the full range of flight conditions.

[0066] (2) The parameter reading method is a mode in which the data generator generates driving data by loading existing test data from saved historical files. The core of this mode is to reproduce past test scenarios, which is especially suitable for the following situations: Reproducing historical tests: Reproducing logically complex test scenarios to check the problem location or confirm that the repaired results meet expectations; Comparative analysis: Combining the historical output data of the flight simulation instrument to verify the display differences between the flight simulation instrument and the original instrument in a specific scenario; Or debugging and optimization: Performing backtracking and repair tests at the fault point. The saved historical data, as shown in Table 1, is data constructed by the data generator and determined by difference analysis to have a difference value greater than or equal to a set threshold. The historical data read is the data in the saved test records, which is used to specifically reproduce the problem and conduct in-depth analysis.

[0067] Here is an example of reading historical files:

[0068] Timestamp T1: Altitude=0, Airspeed=145

[0069] Timestamp T2: Altitude=1000, Airspeed=145

[0070] Timestamp T3: Altitude=2000, Airspeed=145.

[0071] The data generator employs a parameter combination mode to combine the values ​​of multiple parameters, generating various combinations of parameters to form complex, multi-dimensional test data. This data is used to simulate the multi-parameter interactions between flight states and environments and flight simulation instruments in real-world conditions. This mode supports both traversing the limit values ​​of each parameter and covering a wide range of possible multi-parameter interactions.

[0072] Take two parameters, Altitude (barometric altitude) and Airspeed (indicating airspeed), as an example:

[0073] Parameter 1: Altitude (barometric altitude), generated using traversal, ranging from 0 to 10,000, with a step size of 1,000;

[0074] Parameter 2: Airspeed (indicating airspeed), randomly generated, ranging from 0 to 380;

[0075] The generation process is as follows: iterate through Altitude from 0 to 10,000, increasing by 1,000 each time; for each Altitude value, randomly generate an Airspeed value.

[0076] The combined results generated by the above process are shown below:

[0077] (Altitude=0, Airspeed=145)

[0078] (Altitude=1000, Airspeed=350)

[0079] (Altitude=2000, Airspeed=100)….

[0080] This combination method can simulate complex flight conditions, such as low altitude and low speed, and high altitude and high speed.

[0081] For more complex flight conditions, parameter combinations can be multi-parameter combinations. Take, for example, three parameters: Altitude (barometric altitude), Vertical Speed, and Pitch (tilt angle):

[0082] Parameter 1: Altitude, ranging from 5,000 to 10,000, with a step size of 1,000.

[0083] Parameter 2: Vertical Speed, ranging from -6,000 to 6,000, randomly generated.

[0084] Parameter 3: Pitch, ranging from -30° to 30°, randomly generated.

[0085] The resulting combination is as follows:

[0086] (Altitude=5000, Vertical Speed=1500, Pitch=12)

[0087] (Altitude=6000, Vertical Speed=-3000, Pitch=-8)

[0088] (Altitude=7000, Vertical Speed=4500, Pitch=5)….

[0089] Each combination corresponds to a specific flight state, such as climb, descent, or attitude adjustment. Therefore, the data generator, through comprehensive combinations, can cover test scenarios in a multi-dimensional parameter space.

[0090] The data generator's data synchronization transmission method: Based on a preset parameter structure, the data generator dynamically generates driving data for single or multiple parameter combinations according to parameter ranges and generation rules through a parameter generation mode. This generation process includes traversal generation (covering all values ​​within the parameter range) and / or random generation (randomly selecting multiple values ​​within the range) to simulate various flight states and input conditions, or loading generated test data from saved historical files through a data reading mode for problem reproduction, verification of repair results, or comparative analysis of display differences. The driving data is simultaneously sent by the data generator to both the flight simulation instrument and the original instrument, ensuring that the two sets of instruments operate synchronously under the same data input. Precise control of the transmission time and interval avoids display differences caused by time discrepancies.

[0091] Through these operating modes of the data generator, the data generator can generate driving data that comprehensively traverses all parameter values ​​and / or parameter combinations input to the flight simulation instrument and the original instrument. This significantly improves the testing efficiency and coverage of various display states of the flight simulation instrument during testing, and can comprehensively discover and record the differences between the flight simulation instrument and the original instrument, which helps to locate and solve problems in a timely manner.

[0092] 2. Instrument screen acquisition and processing:

[0093] Extract the test screen area from the flight simulation instrument and the corresponding screen area displayed in the original instrument. The two areas are shown below. Figure 2 and Figure 3 As shown.

[0094] a. A consistent visual deployment

[0095] First, the display screens of the flight simulation instruments and the original instruments are set to the same scale and size, for example, by deploying them on the target computer, to ensure that a consistent area to be detected is provided for subsequent processing.

[0096] b. Set the image capture interval

[0097] To balance the demands of real-time performance with data processing volume, a screenshot is taken every second. This process captures the screen image on the computer, ensuring that the dynamic changes of both the flight simulation instrument screen and the original instrument screen are captured.

[0098] c. ROI region extraction

[0099] This invention employs image processing technology to precisely extract two designated Regions of Interest (ROIs) from captured screen images. These ROIs are identical test areas in both the flight simulator instrument and the original instrument. The corresponding display area in the original instrument is also included as a test area. The image processing technology used here is a mature existing technology and will not be elaborated further. The identical conditions used during extraction include, but are not limited to, the flight simulator instrument and the original instrument having the same scale and size; the two extracted ROIs being of the same size and position, and having the same region of interest (e.g., the area displaying the speed indicator). In other words, a certain area in the flight simulator instrument corresponds one-to-one with the corresponding area in the original instrument, matching in both position and size scale. Furthermore, the input conditions of the flight simulator instrument and the original instrument are identical at the same time.

[0100] 3. Difference Detection, Analysis and Processing

[0101] Since the data generator sends the same drive data to both the flight simulator instrument and the original instrument simultaneously, theoretically, the flight simulator instrument and the original instrument should display completely identical images if there are no coding errors in the flight simulator instrument. Therefore, by detecting the differences, inconsistencies between the flight simulator instrument and the original instrument can be found, thereby allowing for the investigation of whether there are coding errors in the flight simulator instrument software.

[0102] When performing difference detection on the two extracted ROI regions, the steps are as follows:

[0103] a. Convert to grayscale:

[0104] The two extracted Regions of Interest (ROIs) are transformed to obtain two corresponding grayscale images. This step simplifies the image data by removing color information and retaining only brightness information, thereby reducing computational complexity and improving processing speed.

[0105] The formula for grayscale conversion is as follows:

[0106] (1)

[0107] in: This represents the pixel value at coordinates (x, y) of the grayscale image obtained by converting the test area of ​​the flight simulation instrument or the corresponding original instrument screen area, where x and y are the position coordinates of the pixel in the image; R(x,y), G(x,y) and B(x,y) are the pixel values ​​of the red component, green component and blue component of the test area of ​​the flight simulation instrument or the corresponding original instrument screen area at coordinates (x,y), respectively.

[0108] b. Pixel comparison:

[0109] The grayscale image of the tested area of ​​the flight simulation instrument is compared with the corresponding original grayscale image of the instrument area. This step uses the pixel difference method, which directly subtracts the pixel values ​​at the same coordinates in the two grayscale images algebraically.

[0110] The specific calculation method of pixel difference is as follows: For two grayscale images, the pixel values ​​at corresponding pixel positions are extracted, and then a difference operation is performed. Since pixel values ​​in grayscale images are integers between 0 and 255, the result of the difference operation may be negative. Therefore, the absolute value of the result is taken to avoid a negative result. The calculation result is as follows: Figure 5 As shown, the calculation formula is as follows:

[0111] (2)

[0112] in, The pixel value at coordinates (x,y) is the difference pixel value, which is the difference image formed by the grayscale images of the original instrument and the flight simulation instrument. and These are the pixel values ​​at coordinates (x, y) for the grayscale images of the original instrument and the flight simulation instrument, respectively. The original instrument image, This is an image from a flight simulation instrument.

[0113] This invention uses the pixel difference method as an example, but other image processing methods such as convolution can also be used to perform the difference operation on the pixels of two images. This invention does not limit this method.

[0114] c. Set a difference threshold (binarization):

[0115] The difference threshold T is a preset value; in this invention, T is set to 10. By setting this threshold, the pixel values ​​of the difference image are... Binarization is performed to make the difference regions more obvious, thereby facilitating the control of detection sensitivity. For example... Figure 4 The binarized image shown is a result of this process. Figure 4 and Figure 5 The white parts represent the original instrument images. and flight simulation instrument images The areas of significant difference between these two images indicate that the content at these pixel locations is significantly different, thus appearing as ghosting. The ghosted areas represent the detected differences between the two images. For example... Figure 7 As shown, when the threshold is set relatively low, the original instrument image can be detected. and flight simulation instrument images The system is more sensitive to subtle differences between images; however, when the threshold is set too high, only significant differences can be detected, while subtle differences will be ignored. Therefore, by setting an appropriate threshold T according to actual needs, testers and developers can effectively help each other more accurately identify and detect differences between the images of two instruments, thereby ensuring the reliability and accuracy of the simulation system. The binarization formula used is as follows:

[0116] (3)

[0117] in: It is the pixel value at coordinates (x, y) of the binarized image; The difference in pixel values ​​at coordinates (x, y); T is a preset threshold.

[0118] when When the difference pixel value at coordinates (x, y) is greater than or equal to T, The value is 1, and this value of 1 is in the difference image. The middle area appears as a bright area; when When the difference pixel value at coordinates (x, y) is less than T, The value is 0, and this 0 value is in the difference image. This appears as a dark area. In the following description, it will be... The image is described as a binarized image.

[0119] d. Morphological operations (opening and closing operations) and drawing the outline of the difference region.

[0120] In this step, the obtained binarized image is optimized. First, morphological opening and closing operations are used to remove the binarized image. The noise in the image is filled with small holes to smooth the edges. Next, contour detection is performed on the smoothed image to obtain a morphologically optimized binarized image. In the morphologically optimized binarized image, all external contour points are detected and fitted to the minimum bounding rectangle. Then, the original instrument image is compared with this image. The bounding boxes of these differing areas are marked on the chart, thus visually demonstrating the differences between the flight simulation instruments and the original instruments. This method allows for the clear location and visualization of all differences between the flight simulation instruments and the original instruments, as shown in the following figure. Figure 6 As shown. Figure 6 and Figure 7 To Figure 4 or Figure 5The effect of adding borders to areas with concentrated ghosting in the image is used to indicate areas with significant differences. Ghosting occurs because the displayed content of the two images from the two instruments is misaligned, resulting in some areas appearing as noticeable "ghosting" or having blurred edges when calculating pixel differences.

[0121] This invention uses image binarization processing to transform the original instrument image... The foreground and background are clearly segmented. The binarized image provides fundamental information for subsequent processing, clearly distinguishing the foreground (difference region) and background. Next, morphological operations, such as opening and closing operations, are used to further optimize the quality of the binarized image to remove noise, fill holes, and smooth region boundaries. The morphologically processed result is used as input for contour detection. In the contour detection stage, foreground regions in the morphologically processed binarized image are located, and all external contour points are extracted. Based on these contour points, the contour points of each region are fitted to a minimum bounding rectangle, generating the coordinates of the four vertices of the rectangle. Subsequently, these rectangles are drawn onto the original instrument image. Above, the boundaries of the differing areas are marked with a prominent color (such as red or other colors) to make the differences visually clear. Through this series of processing steps, all differences between the original instrument image and the flight simulation instrument image can be displayed intuitively and accurately, facilitating observation and analysis of the differences. Because the original instrument image... Since there is a pixel-level correspondence between the binary image and the original instrument image, the rectangular coordinates of the difference regions extracted from the binary image can be directly mapped to the original instrument image. Mark it on.

[0122] The opening and closing operations employ dilation and erosion operations, as detailed below:

[0123] set up The structural template, which is the rectangle described earlier, is defined here as a 3*3 pixel rectangle template with only 0 and 1 values.

[0124] Dilation operation: Using a dilation calculation method, a 3x3 pixel rectangular template is applied to the binarized image. Move pixel by pixel. For binarized images. Each position If rectangular template Any pixel within the binarized image If the foreground (value 1) overlaps, then set The pixel value at that location is foreground, i.e., a value of 1; otherwise, set... The pixel value at that location is the background, i.e., 0. Dilation can effectively fill in the gaps in a binarized image. Small holes in the image are filled, the edges of the foreground area are expanded, and broken parts in the foreground are connected, making the processed image smoother and more complete, as shown in the image below. Figure 8 As shown.

[0125] Binarized image and for The set of integers, Z. quilt Expansion, denoted as Then expansion is defined as:

[0126] (4)

[0127] Indicates will The center of the image is placed pixel position The result is as follows Figure 8 As shown.

[0128] Erosion operation: Using erosion calculation methods, a 3*3 pixel rectangular template is etched onto the binarized image. Move pixel by pixel. For binarized images. Each position If all pixels within the rectangular template are completely contained within the binarized image In the foreground (value 1), then set The pixel value at that location is foreground (1); otherwise, it will be... The pixel value at that location is set to background (0). Erosion can effectively remove the binarized image. The fine noise in the image is reduced, the foreground area is minimized, the edges of the processed image are smoother, and narrowly connected foreground parts are separated, as shown in the following figure. Figure 9 As shown.

[0129] and for The set, quilt Corrosion, denoted as Corrosion is then defined as:

[0130] (5)

[0131] Indicates will The center of the image is placed pixel position superior.

[0132] The opening operation involves erosion followed by dilation. quilt Perform the opening operation, denoted as Its definition is:

[0133] (6)

[0134] If the closing operation is performed by first expanding and then eroding, then... quilt The closing operation is denoted as Its definition

[0135] (7)

[0136] In the formula, This indicates a corrosion operation. This indicates an expansion operation.

[0137] d. Save results

[0138] For cases where the pixel values ​​of the difference images exceed the threshold T in the aforementioned steps, it indicates a significant difference in the display between the original instrument and the flight simulation instrument, requiring further manual investigation and repair. Therefore, all information regarding this situation needs to be saved for subsequent manual processing by testers or developers. Conversely, for values ​​below the threshold T, the test is considered normal or has a negligible deviation, thus requiring no further processing. This indicates that the flight simulation instrument and the original instrument display are consistent, and the flight simulation instrument is considered normal and has passed this test. This step automatically filters and distinguishes between inconsistent and consistent cases by setting a threshold, thereby reducing the workload of manual processing.

[0139] For inconsistencies exceeding a threshold T, this test indicates a problem with the flight simulation instrument. The data generated during this test is recorded and saved, including but not limited to: screenshots of the original instrument and the flight simulation instrument, their differences, and the driving data generated by the data generator and input to both instruments. This driving data includes, but is not limited to, driving parameters or structural parameters and set thresholds. These records enable developers to accurately reproduce the problem.

[0140] 4. Data Analysis and Reproduction Phase

[0141] After testing, the data analysis and reproduction phase begins. Saved test results are used as historical data. A data generator reads the driver parameters or structure parameters stored in this historical data to reproduce the problem scenario. This allows development engineers to quickly reproduce the problem situation, facilitating accurate diagnosis and correction, and deepening understanding of the root cause. It provides precise problem reproduction scenarios for subsequent testing, significantly improving problem localization and resolution efficiency. This process reduces the workload of manual analysis during testing; testers and developers only need to re-reproduce the saved problematic situations for evaluation, judgment, and modification, thereby reducing the workload of manual testing.

[0142] This invention employs a real, original instrument (i.e., an instrument unit manufactured by the original manufacturer, recognized and trusted by the industry or users, and used in a real aircraft) as a dynamic comparison benchmark, and simultaneously drives the original instrument and the simulated instrument to perform automated comparative testing. Using these two types of instruments for testing has the following advantages:

[0143] On the one hand, this invention achieves a real-time dynamic one-to-one correspondence between the screens of the original instrument and the flight simulation instrument by synchronously sending equivalent drive data to both. The resulting standard screen is directly derived from the real-time display of the original instrument, truly reflecting the actual display effect achieved by the original instrument's hardware and internal software under specific drive inputs, thus ensuring that the comparison benchmark is completely consistent with the actual usage scenario of the flight simulation instrument. Regardless of how the input data changes, the system can adaptively complete the comparison, fundamentally overcoming the limitations of existing technologies that rely on pre-generated or obtained static standard images, which cannot adapt to complex test scenarios such as multi-parameter linkage and dynamic operating conditions.

[0144] On the other hand, this method eliminates the need for manual maintenance and updating of the standard image library. The original instrument's image can always be synchronized with the flight simulation instrument, automatically adapting to changes in equipment such as hardware and software upgrades or appearance adjustments. This eliminates the need for manual repair or rebuilding of a large image library, ensuring the test benchmark remains strictly consistent with the flight simulation instrument, significantly reducing maintenance costs and the risk of misjudgments due to untimely maintenance. Furthermore, because this invention uses actual images generated by two real instruments as the comparison benchmark, it effectively accommodates natural differences in hardware details such as display resolution, color scheme, and font, greatly improving the scientific rigor and robustness of the test results and significantly reducing false alarms and missed detections caused by environmental changes or minor hardware differences.

[0145] Finally, the method of the present invention compares the images generated in real time by the flight simulation instrument and the original instrument, thus ensuring accurate comparison or alignment of the images. There is no problem of comparison probability. That is, the subsequent work is carried out only after considering whether the two are accurately compared. Therefore, the comparison accuracy of the present invention can be regarded as 100%. This is different from the prior art, which requires aligning the test screenshot of the vehicle and the standard display image corresponding to the target test case, and then performing subsequent processing based on the alignment probability.

[0146] Furthermore, this invention enables automatic difference detection across multiple levels, including static images, dynamic transitions, animation displays, and complex logical linkages. During each test, all abnormal events are simultaneously recorded along with the original drive data and real-time images from both instruments, providing robust data support for subsequent problem analysis, tracing, and historical reproduction. This significantly improves the efficiency of problem localization and repair in complex scenarios, solving the problem that traditional standard image-based techniques struggle to automatically track and reproduce problems under highly dynamic and complex operating conditions.

[0147] In summary, by introducing real original instruments under the same dynamic driving as the comparison benchmark, this invention overcomes many limitations of the prior art, significantly improves the comprehensiveness, scientific nature and engineering application value of automated testing of flight simulation instruments, and has broad industry applicability.

[0148] As an embodiment of the present invention, the present invention also discloses an automated testing device for flight simulation instruments based on image difference detection. The device is used to implement the method and includes the following modules:

[0149] The sending module is used to simultaneously send the same drive data to both the flight simulation instrument and the original instrument.

[0150] The extraction module is used to extract the test screen area generated by the flight simulation instrument and the original instrument based on the driving data;

[0151] The analysis and processing module is used to perform difference detection analysis and processing on the two extracted test regions to obtain the processing results.

[0152] The analysis and reproduction module is used to perform data analysis and reproduction on the processing results, thereby realizing automated testing of flight simulation instruments.

[0153] As an embodiment of the present invention, the present invention also discloses an electronic device, the electronic device comprising:

[0154] Memory, which stores executable instructions;

[0155] A processor that executes the executable instructions in the memory to implement the method of the present invention.

[0156] As an embodiment of the present invention, the present invention also discloses a computer storage medium storing a computer program, which is executed by a processor to implement the method described in the present invention.

[0157] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0158] The foregoing description illustrates and describes several preferred embodiments of the present invention. However, as previously stated, it should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept described herein through the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. An automated testing method for flight simulation instruments based on image difference detection, characterized in that, The method includes the following steps: S1. Simultaneously send the same driving data to the flight simulation instrument and the original instrument. Under the same driving data, the flight simulation instrument and the original instrument achieve a real-time dynamic one-to-one correspondence between their screens under each set of input conditions. The driving data is generated by a data generator. The data generator constructs one or more structures containing information on the display parameters of the flight instrument; or, the data generator loads the saved results to reproduce the test results. The data generator employs two working modes: parameter generation mode and parameter reading mode. In parameter generation mode, the data generator automatically generates data based on the range of each parameter, including two methods: traversal generation and random generation. The process involves iterating through the parameter range, starting from the minimum value and increasing sequentially with a fixed step size until the maximum value is reached. Random generation involves randomly generating a certain number of data points within a parameter range, with each data point generated independently and without any pattern. The parameter reading method involves the data generator loading existing test data from a saved historical file to generate the driving data; S2. Extract the test screen area generated by the flight simulation instruments and the original instruments based on the drive data, specifically including: S21. The flight simulation instrument screen and the original instrument screen shall be deployed in a consistent manner with the same scale and size; S22. Set the screen capture interval, and capture the dynamic screen of the flight simulation instrument and the original instrument dynamic screen generated by the driving data to obtain the screen image; S23. Extract the area of ​​the screen to be tested from the screen image; S3. Perform difference detection analysis and processing on the two extracted test image regions to obtain the processing result. S3 specifically includes: S31. Convert both of the test image regions into grayscale images; S32. Subtract the pixel values ​​at the same coordinates in the two grayscale images to obtain the difference pixel values; S33. Compare the difference pixel values ​​with a set threshold, perform binarization processing, and obtain a binarized image; S34. Denoise the binarized image and perform contour detection to draw the contours of the difference regions; S4. Perform data analysis and reproduction on the processing results to achieve automated testing of flight simulation instruments.

2. The method according to claim 1, characterized in that, The grayscale conversion formula is as follows: , in: The pixel values ​​at coordinates (x,y) represent the grayscale image of the test area of ​​the flight simulation instrument or the grayscale image of the test area of ​​the original instrument. R(x,y), G(x,y), and B(x,y) are the pixel values ​​of the red component, green component, and blue component of the test area of ​​the flight simulation instrument or the test area of ​​the original instrument at coordinates (x,y), respectively.

3. The method according to claim 1, characterized in that, The formula for calculating the difference pixel value in S32 is as follows: , in, This represents the pixel value at coordinates (x, y). and These are the pixel values ​​at coordinates (x, y) for the grayscale image of the original instrument and the grayscale image of the flight simulation instrument, respectively.

4. The method according to claim 1, characterized in that, The formula used for binarization is as follows: , in: It represents the pixel value at coordinates (x, y) in the binarized image. It is the difference pixel value at coordinates (x,y), and T is the preset threshold.

5. An automated testing device for flight simulation instruments based on image difference detection, characterized in that, The apparatus is used to implement the method according to any one of claims 1-4, and includes the following modules: The sending module is used to simultaneously send the same drive data to both the flight simulation instrument and the original instrument. The extraction module is used to extract the test screen area generated by the flight simulation instrument and the original instrument based on the driving data; The analysis and processing module is used to perform difference detection analysis and processing on the two extracted test regions to obtain the processing results. The analysis and reproduction module is used to perform data analysis and reproduction on the processing results, thereby realizing automated testing of flight simulation instruments.

6. An electronic device, characterized in that, The electronic device includes: Memory, which stores executable instructions; A processor that executes the executable instructions in the memory to implement the method of any one of claims 1-4.

7. A computer storage medium, characterized in that, The medium stores a computer program, which is executed by a processor to implement the method described in any one of claims 1-4.