Automatic test system and method for state switching of electronic rearview mirror
By using automated testing systems and methods, the problems of low efficiency and poor accuracy in the state switching test of CMS electronic rearview mirrors have been solved. The automated switching of system state and field of view state and image quality assessment have been realized, improving testing efficiency and the accuracy and objectivity of results.
Patent Information
- Application Number
- CN202511067116.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-07
AI Technical Summary
In the existing technology, the manual testing operation for switching the state of the CMS electronic rearview mirror is cumbersome and inefficient. The test results lack accuracy and objectivity and are easily affected by subjective human factors.
An automated testing system and method for switching the state of an electronic rearview mirror is provided. The system integrates parameter configuration, state control, data monitoring and anomaly handling modules on a host computer, combined with a programmable power supply and bus tools, to achieve automated switching of system state and field of view state and real-time data acquisition. Image processing algorithms are used to evaluate the field of view state and imaging quality.
Significantly improve testing efficiency, ensure the accuracy and objectivity of test results, avoid human error and missed detections, and generate consistent and reproducible test results.
Smart Images

Figure CN120907781A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automotive electronic testing, in particular to an automatic testing system and method for state switching of an electronic rearview mirror. BACKGROUND
[0002] Under the background of rapid development of automotive electronics and intelligence, the technology of automotive streaming media rearview mirror is continuously matured, which promotes the commercialization of CMS electronic rearview mirror. As a new generation of automotive vision system, the CMS electronic rearview mirror overturns the operation mode of the traditional optical rearview mirror with the combination of “camera + monitor” - the external camera collects the images of the surrounding environment of the vehicle in real time, which are displayed clearly on the in-vehicle display screen after being optimized by the image processing unit (IPU). Compared with the traditional rearview mirror, it not only effectively solves the problems of large blind area, high wind resistance, high beam glare and limited vision in bad weather, but also integrates blind area monitoring and obstacle warning through sensor fusion technology, which greatly improves the driving safety and comfort, and has become the future development trend of automotive vision system. With the wide application of CMS (Camera Monitor System, electronic rearview mirror), the importance of its testing link is increasingly prominent.
[0003] In the prior art, related patents have studied the testing of electronic rearview mirror from the aspects of function verification, calibration optimization, performance testing and test process optimization, but none of them involve the testing of state switching of electronic rearview mirror.
[0004] At present, the manual testing of state switching of CMS electronic rearview mirror has many drawbacks. The tester needs to manually send protocol messages for state switching, and needs to monitor the state conversion process in real time, evaluate the image display quality, and record the state switching delay. This process is not only tedious and inefficient, but also in long-term repetitive work, the tester is prone to visual fatigue and decreased attention, which may lead to missed detection or misjudgment of key parameters, and seriously affect the accuracy and integrity of the test results. In addition, due to the difference in picture angle under different vision states, when manually evaluating the vision range and clarity, the subjective standards are not unified, which makes the test results lack objectivity and repeatability. Therefore, it is urgent to develop an automatic testing scheme with automatic state switching, real-time data acquisition and accurate parameter analysis function, which is of great significance to ensure the scientificity and reliability of the test results.
[0005] The above problems are urgent to be solved. SUMMARY
[0006] The present application aims to overcome at least one technical problem in the prior art, and provides an automatic testing system and method for state switching of an electronic rearview mirror.
[0007] In one aspect, the embodiment of the present application provides an automatic test system for state switching of an electronic rearview mirror, the test system comprising: an upper computer and an electronic rearview mirror; the upper computer is integrated with a parameter configuration module, a state control module, a data monitoring and exception handling module, and a result display and atlas generation module; the parameter configuration module is configured to set state switching timing, cycle limit value, and multiple thresholds, the thresholds including one or a combination of current threshold, marker line coordinate threshold, and MTF value threshold; the state control module is configured to control power-on and power-off of the electronic rearview mirror, and to control switching of system state and field state of the electronic rearview mirror; the data monitoring and exception handling module is configured to: when the electronic rearview mirror is in system state switching, compare the received power supply current information of the electronic rearview mirror with the preset current threshold to determine whether there is an exception in state switching function; when the electronic rearview mirror is in working state, locate the marker line pixel coordinates of the test image based on the preset image processing algorithm for the image video stream information of the test image card collected by the electronic rearview mirror, and compare the marker line pixel coordinates with the preset marker line coordinate threshold to determine whether there is an exception in field state switching; and when the electronic rearview mirror is in working state, quantize the image definition based on the preset image processing algorithm for the image video stream information of the test image card collected by the electronic rearview mirror, and compare the image definition with the preset MTF value threshold to determine whether there is an exception in imaging quality under different field states; and the result display and atlas generation module is configured to display the test result and generate an atlas.
[0008] Further, the test system further comprises a program-controlled power supply and a bus tool; one end of the program-controlled power supply is in communication connection with the electronic rearview mirror, and the other end is in communication connection with the state control module, and is configured to realize power-on and power-off control of the electronic rearview mirror based on the SCPI protocol instruction sent by the state control module; one end of the bus tool is in communication connection with the electronic rearview mirror, and the other end is in communication connection with the state control module, and is configured to realize system state switching and field state switching of the electronic rearview mirror based on the specific protocol packet sent by the state control module.
[0009] Further, the data monitoring and abnormality processing module further integrates a state switching function judgment module, a field of view range detection module, an image definition evaluation module, and an abnormality processing module; the state switching function judgment module is configured to compare the current data sent by the program-controlled power supply with a preset current threshold value, and determine that the state switching function is abnormal when the current data exceeds the preset current threshold value range; the field of view range detection module is configured to, when the electronic rearview mirror is in a working state, locate the marker line pixel coordinates based on a color space feature extraction algorithm on the image video stream information of the test chart collected by the electronic rearview mirror, and determine that the field of view state switching is abnormal when the marker line pixel coordinates are not within a preset marker line coordinate threshold value range; the image definition evaluation module is configured to, when the electronic rearview mirror is in a working state, quantize the image definition based on a modulation transfer function calculation model on the image video stream information of the test chart collected by the electronic rearview mirror, and determine that the imaging quality is abnormal when the modulation transfer function calculation value is less than a preset MTF value threshold value; and the abnormality processing module is configured to automatically record and store relevant data when the state switching function, the field of view state switching function, and / or the imaging quality is abnormal.
[0010] Further, the field of view range detection module is configured to: perform nonlinear mapping processing on the image video stream information of the test chart by using an HSV color space segmentation algorithm, and separate the marker line region of the test image; detect and fit the straight line features of the marker line by using a Hough transform algorithm, and obtain the sub-pixel level pixel coordinates thereof; and dynamically compare the pixel coordinate values calculated in real time with a preset marker line coordinate threshold value range, and if the detection value exceeds the threshold value range, it indicates that the current field of view range deviates from the reference field of view under normal working conditions, and it is determined that the field of view range is abnormal.
[0011] Further, the image definition evaluation module is configured to: based on a Fourier transform-based MTF value fast calculation method, realize quantitative evaluation of the image definition of the electronic rearview mirror, including: extracting the edge region of the image information of the test chart; performing Fourier transform on the edge gray scale distribution to obtain a spatial frequency response curve; taking the mean value of the frequency band in the curve as the MTF value; and if the MTF value is less than the MTF value threshold value, it is determined that the image definition is abnormal.
[0012] Further, the abnormality processing module is configured to, when there is an abnormality, automatically record an abnormality log, and intercept a corresponding video segment and store the video segment in association with the abnormality log, the abnormality log including an abnormal working condition time sequence and parameters.
[0013] Further, the result shows that the atlas generation module is used to extract abnormal events from abnormal logs, count abnormal times in real time, classify fault information according to a time axis, and generate a fault time-category atlas containing a rack number, a date, a time, and an abnormal type; when multiple devices are tested, different colors, legends, and / or layers are used for differentiation.
[0014] Further, the system state includes one or a combination of a sleep state, a standby state, and a working state; the view state includes one or a combination of a driving state, a steering state, and a reversing state; when the electronic rearview mirror is in the working state, the state control module switches the view state by sending a specific protocol message.
[0015] Further, the electronic rearview mirror includes a display screen and a camera; the camera is used to collect image information of a test card placed in a view range of the camera, and the image information contains a marker line; and the display screen is used to display the image information collected by the camera.
[0016] In a second aspect, an embodiment of the present application provides an automatic test method for state switching of an electronic rearview mirror, which is applied to the automatic test system for state switching of the electronic rearview mirror. The test method includes the following steps: S1, configuring test parameters by a parameter configuration module, including one or a combination of state switching timing, cycle limit value, current threshold, marker line coordinate threshold, MTF value threshold, and state switching response time; S2, controlling a program-controlled power supply to supply power to the electronic rearview mirror by a state control module, and sending a protocol message to the electronic rearview mirror by a bus tool to trigger switching of a system state and a view state; S3, continuously monitoring output current of the program-controlled power supply after state switching, and determining whether there is an abnormality in system state switching function according to a preset current threshold; S4, when the electronic rearview mirror is in a working state, locating marker line pixel coordinates of a test image based on a preset image processing algorithm on image video stream information of a test card collected by the electronic rearview mirror, comparing the marker line pixel coordinates with a preset marker line coordinate threshold, and determining whether there is an abnormality in view state switching; S5, when the electronic rearview mirror is in the working state, quantifying image definition based on a preset image processing algorithm on the image video stream information of the test card collected by the electronic rearview mirror, comparing the image definition with a preset MTF value threshold, and determining whether there is an abnormality in imaging quality under different view states; S6, if there is an abnormality in the state switching function, the view state switching function, and / or the imaging quality, automatically associating and storing abnormal video clips and log data; and S7, repeatedly executing steps S2 to S6 until a preset cycle number is reached, generating a time-category atlas of state switching abnormalities, and ending the test.
[0017] In yet another aspect, the present application also provides a computer readable storage medium having one or more instructions stored therein for causing a computer to perform the above-mentioned automated test method for switching state of electronic rearview mirror.
[0018] In yet another aspect, the present application provides an electronic device comprising a memory and a processor; the memory has at least one program instruction stored therein; the processor implements the above-mentioned automated test method for switching state of electronic rearview mirror by loading and executing the at least one program instruction.
[0019] The present application has the following advantages: (1) Operation efficiency is improved: the system and the field of view state are switched by the bus tool to automatically send messages, replacing manual operation, while integrating real-time data acquisition and parameter analysis functions, without the need for artificial full-process monitoring and recording, avoiding tedious processes and repetitive labor, greatly shortening the test cycle, meeting the testing needs of large scale and high frequency, and significantly improving the test efficiency.
[0020] (2) The result accuracy is guaranteed: the system state is judged by the program-controlled power supply to accurately monitor the current, and the image processing technology is used to extract the marker line coordinates and calculate the MTF value to evaluate the field of view state, and the whole process is executed by the automatic program, avoiding the key parameter missing and misjudgment caused by visual fatigue and decreased attention of artificial, ensuring the completeness of test data and the accuracy and reliability of the result.
[0021] (3) The evaluation objectivity is enhanced: the image marker line coordinates and the MTF value are analyzed by using the quantitative algorithm, and the preset threshold is used as the unified judgment standard, abandoning the fuzziness and randomness of artificial subjective evaluation, and no matter how the test batch and the operator change, consistent and reproducible test results can be output, greatly enhancing the objectivity and credibility of the test conclusion. BRIEF DESCRIPTION OF DRAWINGS
[0022] The present application will be further described below in conjunction with the drawings and examples.
[0023] Figure 1 is a structural schematic diagram of an automated test system for switching state of electronic rearview mirror provided by embodiment 1 of the present application.
[0024] Figure 2 is a schematic diagram of environment building of an automated test system for switching state of electronic rearview mirror provided by embodiment 1 of the present application.
[0025] Figure 3 is a schematic diagram of system state and field of view state switching provided by embodiment 1 of the present application.
[0026] Figure 4is a work flow chart of an automatic test system for electronic rearview mirror state switching provided by Embodiment 1 of the present application.
[0027] Figure 5 is a measurement result map diagrammatic view provided by Embodiment 1 of the present application.
[0028] Figure 6 is a flow chart of an automatic test method for electronic rearview mirror state switching provided by Embodiment 2 of the present application.
[0029] Figure 7 is a partial block diagram of an electronic device provided by Embodiment 4 of the present application. DETAILED DESCRIPTION
[0030] Before the exemplary embodiments are discussed in more detail, it should be mentioned that some of the exemplary embodiments are described as processes or methods depicted as flow charts. While the processes are described in serial fashion, many of the operations can be performed in parallel, concurrently or even simultaneously. In addition, the order of the operations can be re-arranged. The processes can be terminated when their operations are completed, but can also have additional steps not included in the figure. The processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0031] It should be understood that, although the terms "first", "second" etc. can be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element without departing from the scope of the example embodiments. The term "and / or" as used herein includes any and all combinations of one or more of the associated associated items.
[0032] The present application will now be described in detail with reference to the drawings. The diagram is a simplified schematic diagram which schematically illustrates the basic structure of the present application, and thus only shows the components relevant to the present application.
[0033] For the convenience of understanding, the professional terms appearing in the following embodiments are explained here: MTF value: (Modulation Transfer Function) is a numerical value for evaluating the sharpness, contrast and resolution of a lens. The MTF value is a numerical value between 0 and 1, indicating the ability of the lens to restore reality. The larger the numerical value (closer to 1), the stronger the restoring ability of the lens.
[0034] Embodiment 1 For the convenience of understanding, the working principle of the system is described before the detailed description of the embodiments of the present application: the present embodiment aims to solve the problems of low operation efficiency, poor result accuracy and insufficient evaluation objectivity in the manual test of electronic rearview mirror state switching in the prior art, and provides an automatic test system and method for electronic rearview mirror state switching. By building a specific test environment, using the host computer to integrate parameter configuration, state control, data monitoring and exception handling, result display and atlas generation modules, cooperating with bus tools, program-controlled power supply and other equipment, the automatic test of electronic rearview mirror system state (sleep, standby, work) and field of view state (driving, steering, reversing) switching is realized. During the test process, the bus tool automatically sends messages to complete state switching, the program-controlled power supply monitors the current to judge the system state, and the image processing technology is used to extract the marker line coordinates and calculate the MTF value to evaluate the field of view state. The whole process is automatically executed, and finally the unified and reproducible test results are output through the quantitative algorithm and the preset threshold, so as to improve the test efficiency, ensure the result accuracy and enhance the evaluation objectivity.
[0035] The specific implementation is as follows: As shown in Figure 1 , it is a structure diagram of an automatic test system for electronic rearview mirror state switching provided by the present application.
[0036] As an example, the test system comprises a host computer 1 and an electronic rearview mirror 2; the host computer 1 is integrated with a parameter configuration module 10, a state control module 11, a data monitoring and exception handling module 12 and a result display and atlas generation module 13; the parameter configuration module 10 is used to set the state switching time sequence, the cycle limit value and a plurality of threshold values, the threshold values including one or a combination of the current threshold value, the marker line coordinate threshold value and the MTF value threshold value; the state control module 11 is used to control the power-on and power-off of the electronic rearview mirror, and to control the switching of the system state and the field of view state of the electronic rearview mirror; the data monitoring and exception handling module 12 is used to: when the electronic rearview mirror is in system state switching, compare the received power supply current information of the electronic rearview mirror with the preset current threshold value to judge whether there is an abnormality in the state switching function; when the electronic rearview mirror is in the working state, locate the marker line pixel coordinates of the test image based on the preset image processing algorithm, compare the image video stream information of the test image card collected by the electronic rearview mirror with the preset marker line coordinate threshold value to judge whether there is an abnormality in the field of view state switching; and when the electronic rearview mirror is in the working state, quantize the image definition based on the preset image processing algorithm, compare the image video stream information of the test image card collected by the electronic rearview mirror with the preset MTF value threshold value to judge whether there is an abnormality in the imaging quality under different field of view states; the result display and atlas generation module 13 is used to display the test results and generate the atlas.
[0037] In some possible implementation manners, the system further comprises a programmable power supply 3 and a bus tool 4; one end of the programmable power supply 3 is in communication connection with the electronic rearview mirror 2, and the other end is in communication connection with the state control module 11, and the programmable power supply 3 is configured to, based on an SCPI protocol instruction sent by the state control module 11, realize power-on and power-off control of the electronic rearview mirror 2; one end of the bus tool 4 is in communication connection with the electronic rearview mirror 2, and the other end is in communication connection with the state control module 11, and the bus tool 4 is configured to, based on a specific protocol message sent by the state control module 11, realize system state switching and field state switching of the electronic rearview mirror 2. Figure 2 The system is shown in a test environment: the CMS is mainly composed of a camera 20 and a display screen 21, the camera 20 is responsible for collecting the field of view picture, and the display screen 21 is used for real-time presentation of the image content. A chessboard test card is placed in the field of view range of the left and right cameras 20, and a red marker line is arranged at the lower edge of the chessboard test card. The upper computer 1 is connected to the programmable power supply 3 through a network cable, realizes power-on and power-off control and current reading based on the SCPI protocol, and is connected to the bus tool 4 through a USB interface, and is used for sending specific protocol messages to complete the switching operation of the CMS system and the field state. In order to reduce the difficulty of image processing, the illumination conditions of the test environment can be controlled to avoid the influence of complex illumination on the detection results.
[0038] In some possible implementation manners, the system further comprises a programmable power supply 3 and a bus tool 4; one end of the programmable power supply 3 is in communication connection with the electronic rearview mirror 2, and the other end is in communication connection with the state control module 11, and the programmable power supply 3 is configured to, based on an SCPI protocol instruction sent by the state control module 11, realize power-on and power-off control of the electronic rearview mirror 2; one end of the bus tool 4 is in communication connection with the electronic rearview mirror 2, and the other end is in communication connection with the state control module 11, and the bus tool 4 is configured to, based on a specific protocol message sent by the state control module 11, realize system state switching and field state switching of the electronic rearview mirror 2.
[0039] Preferably, the system state comprises one or a combination of a sleep state, a standby state and a working state; the field state comprises one or a combination of a driving state, a turning state and a reversing state; when the electronic rearview mirror is in the working state, the state control module realizes the switching of the field state by sending a specific protocol message. Specifically, in combination with Figure 3 As shown in the state switching mechanism, the sleep state is converted into the standby state by sending a wake-up message 1, the standby state enters the working state by sending an ignition message 2, the working state returns to the standby state by sending a sleep message 3, and the standby state stops sending all messages and returns to the sleep state after waiting for a specific time 4. In the working state, the turning state is switched by sending a turning message 6, the reversing state is switched by sending an R gear message 7, and the driving state is entered by default in other cases 5. In the actual project implementation process, for various states, the state switching trigger conditions (such as signal threshold, timing logic, etc.) and switching delay indicators (including maximum allowable delay and synchronization accuracy requirements) are defined by standardized processes. Therefore, when performing the state switching operation, the differentiated switching conditions (covering hardware state feedback, protocol instruction interaction, environmental parameter verification, etc.) need to be adaptively added based on the project requirement specification (SRS), to ensure that the state migration process meets the system design architecture and functional safety requirements.
[0040] In some possible embodiments, the parameter configuration module 10 is configured to set state switching timing, cycle limit value, and multiple thresholds, including one or a combination of current threshold, marker line coordinate threshold, and MTF value threshold. Specifically, the parameter configuration module 10 can set state switching timing (including sequence, interval time, cycle limit value) and various thresholds (current threshold, marker line coordinate threshold, MTF threshold, state transition response time). Among them, the current threshold is usually 0A in the sleep state, 0.1A-1A in the standby state, and 2A-3A in the working state; the image threshold is calculated by the normal working condition of the CMS; the state switching timing includes: system state switching sequence: sleep state, standby state, working state, standby state, sleep state; field of view state switching sequence: driving state, steering state, reversing state, driving state; the interval time between state switching is set to 0.5-2s, and the cycle is set to 10-100 times. It should be noted that the specific values of the above thresholds are not limited here, and different values can be changed based on actual needs in actual application.
[0041] In some possible embodiments, the data monitoring and abnormality processing module 12 further integrates a state switching function judgment module 120, a field of view range detection module 121, an image definition evaluation module 122, and an abnormality processing module 123; the state switching function judgment module 120 is configured to compare the current data sent by the program-controlled power supply 3 with the preset current threshold, and determine that the state switching function is abnormal when the current data exceeds the preset current threshold range; the field of view range detection module 121 is configured to, when the electronic rearview mirror 2 is in the working state, locate the marker line pixel coordinates based on a color space feature extraction algorithm on the image video stream information of the test chart collected by the electronic rearview mirror 2, and determine that the field of view state switching is abnormal when the marker line pixel coordinates are not within the preset marker line coordinate threshold range; the image definition evaluation module 122 is configured to, when the electronic rearview mirror 2 is in the working state, quantize the image definition based on a modulation transfer function calculation model on the image video stream information of the test chart collected by the electronic rearview mirror 2, and determine that the imaging quality is abnormal when the modulation transfer function calculation value is less than the preset MTF value threshold; and the abnormality processing module 123 is configured to automatically record and store related data when the state switching function, the field of view state switching function, and / or the imaging quality are abnormal.
[0042] Preferably, the data monitoring and anomaly handling module 12 has dual core functions: First, it performs real-time closed-loop monitoring of the output current of the programmable power supply. When the current parameter deviates from the preset threshold range, it automatically triggers the log storage mechanism to record the timing and parameters of the abnormal operating conditions. Second, after the CMS enters the working mode, it pushes the camera video stream based on the FFmpeg streaming media protocol. The host computer calls the OpenCV computer vision library to carry out the image processing flow—locating the pixel coordinates of the marker line through the color space feature extraction algorithm to determine the effectiveness of the field of view state switching; and quantifying the image sharpness using the modulation transfer function (MTF) calculation model to verify the imaging quality under different field of view states. If the marker line coordinates or MTF index exceed the threshold boundary, it will trigger the video segment extraction and associated storage with the anomaly log, providing a complete data backtracking chain for subsequent fault diagnosis.
[0043] Preferably, the field of view detection module 121 is used to: perform nonlinear mapping processing on the image video stream information of the test card using the HSV color space segmentation algorithm to separate the marker line region of the test image; combine the Hough transform algorithm to detect and fit the straight line features of the marker line to obtain its sub-pixel level pixel coordinates; dynamically compare the pixel coordinate values calculated in real time with the preset marker line coordinate threshold range; if the detected value exceeds the threshold range, it indicates that the current field of view deviates from the reference field of view under normal working conditions, and is judged as an abnormal field of view. Specifically, the workflow of the field of view detection module 121 includes: converting the video frame to the HSV color space, locating the marker line region by red channel threshold segmentation; applying Hough line detection to the segmented region, fitting the marker line edge and calculating its sub-pixel level coordinates; if the coordinate value deviates from the preset marker line coordinate threshold range by more than 10%, it is judged as an abnormal field of view.
[0044] Preferably, the image sharpness assessment module 122 is used for: a rapid MTF value calculation method based on Fourier transform to achieve a quantitative assessment of the image sharpness of the electronic rearview mirror, including: extracting the edge regions of the image information of the test chart; performing a Fourier transform on the edge grayscale distribution to obtain a spatial frequency response curve; taking the mean value of the mid-frequency band of the curve as the MTF value; if the MTF value is less than the MTF value threshold, the image sharpness is determined to be abnormal. The mid-frequency band is selected as 10-50 lp / mm.
[0045] Preferably, the anomaly handling module 123 is used to automatically record an anomaly log when an anomaly occurs, and to extract the corresponding video segment and store it in association with the anomaly log. The anomaly log includes the anomaly condition timing and parameters. Specifically, it extracts a 5-second video stream before and after the anomaly occurs, and stores the anomaly time point, current value, marker line coordinates, MTF value, and corresponding protocol message in association. The anomaly count is then updated in real time on the host computer.
[0046] In some feasible implementations, the result display and graph generation module 13 is used to extract abnormal events from the abnormal log, display the number of abnormalities in real time, classify fault information according to the time axis, and generate a fault time-category graph containing rack number, date, time, and abnormality type. The data structure of the abnormal events can be: events={"current": "10" "type": "current abnormality" "rack id": "A01"}, and the abnormality types include: current abnormality, marker line coordinate abnormality, and MTF value abnormality. When multiple devices are tested, different colors, legends, and / or layers are used for differentiation. Specifically, the result display and graph generation module 13 displays the number of state switching abnormalities in real time and classifies the fault information according to the time axis, generating a graph such as... Figure 5 The fault time-category graph shown facilitates the analysis of fault patterns. If multiple CMS systems need to be verified simultaneously, bench number, location, and other information can be incorporated into the graph. Using the time axis as a baseline, different colors, legends, or layers can be used to distinguish the fault type and occurrence time of each bench's corresponding CMS, enabling visualized comparison and precise traceability of test data from multiple devices. This testing system, through modular design and multi-technology collaboration, achieves automated testing and accurate evaluation of CMS state transitions.
[0047] In some feasible implementations, combined with Figure 4As shown, the test process starts with the parameter configuration of the host computer. After clicking "Start", the host computer first controls the program-controlled power supply to turn on the power supply, and then triggers the CMS to perform state switching through the bus tool. After each state switching, it is continuously monitored until the preset state switching response time is reached. At this time, the current data of the program-controlled power supply is read, and according to the current threshold corresponding to different states (sleep, standby, work) (sleep 0A, standby 0.1A-1A, work 2A-3A), it is judged whether the state switching is normal. When the CMS is in the working state, the system will activate the real-time visual detection process: through the FFmpeg streaming media server to establish a low-latency RTSP push stream channel, and use the H.264 / HEVC encoding protocol to realize the efficient transmission of the camera raw data; the host computer end is based on the OpenCV computer vision library to build a double-thread processing architecture, the main thread is responsible for video stream decoding and frame buffer management, and the auxiliary thread executes parallel image processing tasks. In the field of view range detection process, the system processes the image through the HSV color space segmentation algorithm for nonlinear mapping, accurately separates the red marker line area of the chessboard test card, and then combines the Hough transform algorithm to detect and fit the straight line features of the marker line to obtain its sub-pixel level pixel coordinates. The dynamically compared coordinate values calculated in real time with the preset standard range, if the detection value exceeds the threshold range, it indicates that there is a deviation between the current field of view range and the reference field of view under normal working conditions, which can be determined as abnormal field of view range; on the other hand, based on the MTF value fast calculation method of Fourier transform, the quantification evaluation of the CMS image definition is realized, if the MTF value exceeds the threshold, it is determined that the image definition is abnormal. When the above-mentioned abnormalities occur, the corresponding video and log are automatically saved, and the abnormal number is refreshed in real time on the host computer interface to intuitively show the abnormal frequency in the test process, so that the test personnel can master the test progress in time. The above-mentioned process is executed in a loop until the limit value of the cycle number set in the parameter configuration is reached, and finally the test result atlas is generated, and the program-controlled power supply is turned off to end the test.
[0048] For ease of understanding, the working process of the above-mentioned system is described here with specific examples: assuming that a batch of electronic rearview mirrors are tested for "after the system state is switched to the working state, the field of view state is switched among driving, turning and reversing", the specific process is as follows: The environment and parameters are prepared as follows Figure 2 Build the environment: place a chessboard card with red marker lines in the left and right camera fields of view of the electronic rearview mirror, and control the stable light. The host computer parameter configuration: the state switching interval is set to 5 seconds, the cycle number is 5 times; current threshold (sleep 0A, standby 0.1-1A, work 2-3A); marker line coordinate threshold (based on the standard coordinate range of normal driving / turning / reversing field of view); MTF value threshold 0.5 (calculated under normal working conditions).
[0049] Test execution step: the host computer controls the program-controlled power supply to start, the bus tool sends a wake-up message, and the electronic rearview mirror switches from hibernation (current 0A) to standby (current 0.5A, meets the 0.1-1A threshold, and is determined to be normal). Send the ignition message, switch to the working state (current 2.5A, meets the 2-3A threshold, and is determined to be normal), and trigger the field of view state test. First cycle: by default, enter the driving state, and the camera collects images. The host computer receives the video stream through FFmpeg, and the OpenCV auxiliary thread processes: extracts the red marker line coordinates (falls within the preset driving field of view range), calculates the MTF value 0.6 (> 0.5 threshold), and determines that the field of view and imaging are normal. Send the steering message, switch to the steering state: the marker line coordinates meet the steering field of view standard, the MTF value is 0.55, and it is normal. Send the R-gear message, switch to the reverse state: the marker line coordinates meet the reverse field of view standard, the MTF value is 0.52, and it is normal. Repeat 4 cycles, and in the third cycle of the steering state, the MTF value is 0.48 (< 0.5 threshold), the system automatically intercepts the video in this period and records the log (time, bench number, and abnormal type "insufficient clarity"). The test result result display module generates a graph, displays 1 abnormality in 5 cycles, and clearly labels the abnormal time and type. The test period is shortened by 60% compared to manual testing, and the abnormality determination is based on quantitative data without subjective bias.
[0050] In the above embodiment, the test flow arrangement engine based on the state machine model automatically schedules the bus tool, the program-controlled power supply, and the image processing module to work cooperatively, realizes full-process automation from state switching to data collection, aligns and analyzes the real-time current data of the program-controlled power supply and the image processing result (marker line coordinates, MTF value) in time stamp, constructs a multi-dimensional feature vector space, and realizes accurate determination of state switching. In combination with HSV color space segmentation and Hough transform algorithm, the marker line (such as red boundary) is accurately extracted under complex lighting conditions. The MTF value fast calculation method based on Fourier transform evaluates the image quality and outputs objective quantitative detection result. When any parameter of current, coordinate, and MTF value exceeds the threshold, the associated storage of video stream and test log is automatically triggered, and an abnormal event graph containing space-time information is generated. The test efficiency is greatly improved, the result accuracy is guaranteed, the evaluation objectivity is enhanced, and the large-scale test demand is met.
[0051] It is worth mentioning that each module involved in the embodiment is a logical unit, which can be a physical unit, a part of a physical unit, or a combination of multiple physical units in actual application. In addition, in order to highlight the innovative part of the present application, units not closely related to solving the technical problems proposed in the present application are not introduced in the embodiment, but this does not mean that there are no other units in the embodiment.
[0052] Example 2 Referring to Figure 6 , the flow chart of the automatic test method for the electronic rearview mirror state switching provided by the embodiment of the application.
[0053] As an example, the method is applied to the automatic test system for the electronic rearview mirror state switching described in Embodiment 1, and the test method comprises: Step S1, configuring test parameters through a parameter configuration module, including one or a combination of state switching timing, cycle limit value, current threshold, marker line coordinate threshold, MTF value threshold and state switching response time.
[0054] Step S2, controlling a program-controlled power supply to supply power to the electronic rearview mirror through a state control module, and sending a protocol message to the electronic rearview mirror through a bus tool to trigger the switching of the system state and the field of view state.
[0055] Step S3, continuously monitoring the output current of the program-controlled power supply after the state switching, and determining whether the system state switching function is abnormal according to the preset current threshold.
[0056] Step S4, when the electronic rearview mirror is in a working state, locating the marker line pixel coordinates of the test image based on a preset image processing algorithm according to the image video stream information of the test chart collected by the electronic rearview mirror, and comparing the marker line pixel coordinates with the preset marker line coordinate threshold to determine whether the field of view state switching is abnormal.
[0057] Step S5, when the electronic rearview mirror is in a working state, quantifying the image definition based on a preset image processing algorithm according to the image video stream information of the test chart collected by the electronic rearview mirror, comparing the image definition with the preset MTF value threshold, and determining whether the imaging quality under different field of view states is abnormal.
[0058] Step S6, if the state switching function, the field of view state switching function and / or the imaging quality are abnormal, automatically associating and storing abnormal video clips and log data.
[0059] Step S7, cyclically executing steps S2 to S6 until the preset cycle limit is reached, generating a time-category atlas of state switching abnormalities and ending the test.
[0060] It can be found that the present embodiment is a method embodiment corresponding to the first embodiment, and the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in the present embodiment. In order to reduce repetition, they will not be described here. Correspondingly, the related technical details mentioned in the present embodiment can also be applied in the first embodiment.
[0061] Embodiment 3 The embodiment of the present application further provides a storage medium, and the storage medium stores the electronic rearview mirror state switching automation test method. The program of the electronic rearview mirror state switching automation test is executed by the processor to realize the steps of the electronic rearview mirror state switching automation test method as described above. Since the storage medium adopts all the technical solutions of the above embodiments, it has all the beneficial effects brought by the technical solutions of the above embodiments, which will not be repeated here.
[0062] Embodiment 4 Please refer to Figure 7 The embodiment of the present application further provides an electronic device, which comprises a memory and a processor. The memory stores at least one program instruction. The processor loads and executes the at least one program instruction to realize the electronic rearview mirror state switching automation test method provided in the embodiment 2.
[0063] The memory 702 and the processor 701 are connected by a bus. The bus can include any number of interconnected buses and bridges, which connect one or more processors 701 and memories 702 and various circuits together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, and thus will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, which provide a unit for communicating with various other devices on a transmission medium. The data processed by the processor 701 is transmitted on a wireless medium through an antenna, and further, the antenna also receives data and transmits the data to the processor 701.
[0064] The processor 701 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. The memory 702 can be used to store data used by the processor 701 in performing operations.
[0065] The above-mentioned are only embodiments of the present application, and the common knowledge of specific structures and characteristics in the scheme is not described too much herein. The ordinary skilled person in the art knows all the ordinary technical knowledge in the field of the present application before the application date or the priority date, can know all the prior art in the field, and has the ability to apply conventional experimental means before that date. The ordinary skilled person in the art can perfect and implement the present scheme under the guidance of the present application, combined with their own ability. Some typical known structures or known methods should not be an obstacle for the ordinary skilled person in the art to implement the present application. It should be noted that, for those skilled in the art, without departing from the structure of the present application, a number of modifications and improvements can be made, which should also be considered as the protection scope of the present application. The scope of protection of the present application should be subject to the content of its claims, and the specific implementation mode and the like in the specification can be used to explain the content of the claims.
Claims
1. An automated testing system for switching states of an electronic rearview mirror, characterized in that, The test system comprises a host computer and an electronic rearview mirror; The host computer is integrated with a parameter configuration module, a state control module, a data monitoring and exception handling module, and a result display and atlas generation module; The parameter configuration module is configured to set state switching timing, cycle limit value, and multiple thresholds, wherein the thresholds include one or a combination of current threshold, marker line coordinate threshold, and MTF value threshold; The state control module is configured to control power-on and power-off of the electronic rearview mirror, and to control switching of system state and field of view state of the electronic rearview mirror; The data monitoring and exception handling module is configured to: When the electronic rearview mirror is in system state switching, compare the received power supply current information of the electronic rearview mirror with the preset current threshold to determine whether the state switching function is abnormal; When the electronic rearview mirror is in working state, locate the marker line pixel coordinates of the test image based on the preset image processing algorithm for the image video stream information of the test image card collected by the electronic rearview mirror, and compare the marker line pixel coordinates with the preset marker line coordinate threshold to determine whether the field of view state switching is abnormal; and When the electronic rearview mirror is in working state, quantize the image definition based on the preset image processing algorithm for the image video stream information of the test image card collected by the electronic rearview mirror, and compare the image definition with the preset MTF value threshold to determine whether the imaging quality under different field of view states is abnormal; The result display and atlas generation module is configured to display test results and generate atlases.
2. The automated test system of electronic mirror status switching according to claim 1, characterized in that, The test system further comprises a program-controlled power supply and a bus tool; One end of the program-controlled power supply is in communication connection with the electronic rearview mirror, and the other end is in communication connection with the state control module, and is configured to realize power-on and power-off control of the electronic rearview mirror based on the SCPI protocol instruction sent by the state control module; One end of the bus tool is in communication connection with the electronic rearview mirror, and the other end is in communication connection with the state control module, and is configured to realize system state switching and field of view state switching of the electronic rearview mirror based on the specific protocol message sent by the state control module.
3. The automated test system of claim 2, wherein, The data monitoring and exception handling module is further integrated with a state switching function judgment module, a field of view range detection module, an image definition evaluation module, and an exception handling module; The state switching function judgment module is configured to compare the current data sent by the program-controlled power supply with the preset current threshold, and determine that the state switching function is abnormal when the current data exceeds the preset current threshold range; The field of view range detection module is configured to, when the electronic rearview mirror is in working state, locate the marker line pixel coordinates based on a color space feature extraction algorithm for the image video stream information of the test image card collected by the electronic rearview mirror, and determine that the field of view state switching is abnormal when the marker line pixel coordinates are not within the preset marker line coordinate threshold range; The image definition evaluation module is configured to, when the electronic rearview mirror is in the working state, quantize image definition based on a modulation transfer function calculation model by processing image video stream information of a test chart collected by the electronic rearview mirror, and determine that imaging quality is abnormal when a modulation transfer function calculation value is less than a preset MTF value threshold; The abnormality processing module is configured to automatically record and store relevant data when the state switching function, the field of view state switching function, and / or the imaging quality is abnormal.
4. The automated test system of claim 3, wherein, The field of view range detection module is configured to: perform nonlinear mapping processing on the image video stream information of the test chart by using an HSV color space segmentation algorithm, and separate a marker line region of the test image; detect and fit straight line features of the marker line by using a Hough transform algorithm, and obtain sub-pixel level pixel coordinates of the marker line; perform dynamic comparison between the pixel coordinates calculated in real time and a preset marker line coordinate threshold range, and if the detection value exceeds the threshold range, it is determined that there is a deviation between the current field of view range and the reference field of view under normal working conditions, and it is determined that the field of view range is abnormal.
5. The automated test system of claim 3, wherein, The image definition evaluation module is configured to: realize quantitative evaluation of image definition of the electronic rearview mirror by using a fast MTF value calculation method based on Fourier transform, including: extracting an edge region of image information of the test chart; performing Fourier transform on edge gray scale distribution to obtain a spatial frequency response curve; taking a mean value of a frequency band of the curve as an MTF value; if the MTF value is less than the MTF value threshold, it is determined that the image definition is abnormal.
6. The automated test system of claim 3, wherein, The abnormality processing module is configured to automatically record abnormal logs when there is an abnormality, and to store video clips corresponding to the abnormal logs in association with the abnormal logs, the abnormal logs including abnormal working condition time sequences and parameters.
7. The automated test system of electronic mirror status switching according to claim 6, characterized in that, The result display and atlas generation module is configured to extract abnormal events from the abnormal logs, display the number of abnormal events in real time, classify fault information according to a time axis, and generate a fault time-category atlas containing a rack number, a date, a time, and an abnormal type. Different colors, legends, and / or layers are used to distinguish different devices when multiple devices are tested.
8. The automated test system of electronic mirror state switching according to claim 1, wherein, The system state includes one or a combination of a hibernation state, a standby state, and a working state; The field of view state includes one or a combination of a driving state, a turning state, and a reversing state; When the electronic rearview mirror is in the working state, the state control module realizes switching of the field of view state by sending a specific protocol message.
9. The automated test system of electronic mirror state switching according to claim 1, wherein, The electronic rearview mirror includes a display screen and a camera. The camera is configured to collect image information of a test chart placed in a field of view range of the camera, and the image information includes a marker line. The display screen is configured to display image information collected by the camera.
10. An automatic test method for electronic mirror state switching, the method being applied in the automatic test system for electronic mirror state switching according to any one of claims 1-9, characterized in that, The test method includes: Step S1: configuring test parameters by using a parameter configuration module, including one or a combination of a state switching time sequence, a cycle limit value, a current threshold, a marker line coordinate threshold, an MTF value threshold, and a state switching response time; Step S2: controlling a program-controlled power supply to supply power to the electronic rearview mirror by using a state control module, and sending a protocol message to the electronic rearview mirror by using a bus tool to trigger switching of the system state and the field of view state; Step S3, continuously monitoring the output current of the program-controlled power supply after the state switching, judging whether the system state switching function is abnormal according to the preset current threshold value; Step S4, when the electronic rearview mirror is in the working state, the image video stream information of the test graph card collected by the electronic rearview mirror is located based on the preset image processing algorithm, the pixel coordinates of the test image are compared with the preset mark line coordinate threshold value, and whether the field state switching is abnormal is judged; Step S5, when the electronic rearview mirror is in the working state, the image video stream information of the test graph card collected by the electronic rearview mirror is quantified based on the preset image processing algorithm, the image definition is compared with the preset MTF value threshold value, and whether the imaging quality under different field states is abnormal is judged; Step S6, if the state switching function, the field state switching function and / or the imaging quality are abnormal, automatically associate and store the abnormal video clips and log data; Step S7, cyclically execute steps S2 to S6 until the preset cycle number is reached, generate a time-category atlas of state switching abnormalities and end the test.