Indicator lamp test method and device and electronic equipment

Through image processing technology, the position of indicator lights is calibrated and image information is analyzed, and the problem of inefficient indicator light testing in the prior art is solved, and efficient detection of multiple irregularly distributed indicator lights and saving labor costs are achieved.

CN119828037APending Publication Date: 2025-04-15FULIAN PRESION ELECTRONICS (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311324462.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-12
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the prior art, the test efficiency of indicator lights is low, especially when the number of indicator lights is large and the distribution is irregular, the manual visual detection efficiency is low, making it difficult to achieve efficient testing.

Method used

The position of the indicator light is precalibrated by image processing technology, and the target position of the indicator light in the monitoring video is determined using the template image, and the image information is analyzed to obtain the flickering frequency and duty cycle, thereby determining the working state of the indicator light.

Benefits of technology

It improves the efficiency of indicator light testing, reduces the need for manual inspection, saves labor costs, and realizes efficient detection of irregularly distributed indicator lights.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119828037A_ABST
    Figure CN119828037A_ABST
Patent Text Reader

Abstract

The invention provides an indicator light testing method and device and electronic equipment. The indicator light testing method comprises the steps that a monitoring video of an indicator light working on the electronic equipment is received; based on a template image, determining a target position of the indicating lamp in each frame of image in the monitoring video, the template image comprising a position mark of the indicating lamp; acquiring image information of the indicating lamp at the target position according to the position mark; determining the flicker frequency and the duty ratio of the indicator lamp according to the image information; and determining the working state of the indicator lamp according to the flicker frequency and the duty ratio. According to the invention, the camera at any position can be used for monitoring the working state of the indicator lamp from any angle, and the indicator lamps at multiple irregular positions can be positioned in advance before the indicator lamp is tested, so that the indicator lamp testing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of equipment testing, and in particular to an indicator light testing method, device and electronic equipment. Background Art

[0002] Currently, there are many indicator lights on electronic devices to indicate the working status of the electronic devices. Before testing the electronic devices, it is necessary to test the status of the indicator lights to confirm whether the functions of the indicator lights are normal. In this way, the working status of the electronic device can be confirmed according to the working status of the indicator lights. At present, since the number and position of the indicator lights on different electronic devices are different, and the distribution position of the indicator lights on the electronic devices may be irregular, the working status of the indicator lights is usually detected by manual visual inspection. However, this method of manual testing of the indicator lights is inefficient. Summary of the invention

[0003] In view of the above content, it is necessary to propose an indicator light testing method, device and electronic equipment, which can pre-calibrate the position of the indicator light through image processing technology, can simultaneously identify multiple irregularly distributed indicator lights, and then detect the working status of the indicator lights, thereby improving the efficiency of indicator light testing at irregular positions.

[0004] The present application provides an indicator light testing method, which is applied to an electronic device, wherein the indicator light is installed on an electronic device, and the electronic device is communicatively connected to the electronic device, and the method includes: receiving a monitoring video of the indicator light when working on the electronic device; determining a target position of the indicator light in each frame image of the monitoring video based on a template image, wherein the template image includes a position mark of the indicator light; acquiring image information of the indicator light at the target position according to the position mark; determining a flashing frequency and a duty cycle of the indicator light according to the image information; and determining a working state of the indicator light according to the flashing frequency and the duty cycle.

[0005] It can be seen from the above technical solution that the present application first determines the target position of the indicator light in the monitoring video by marking the position of the indicator light in the template image, and then analyzes the image information at the target position during the test to obtain the flashing frequency and duty cycle of the indicator light, which can improve the efficiency of the indicator light test; thereafter, the test result of the indicator light is determined by judging whether the flashing frequency of the indicator light meets the first condition and judging whether the duty cycle meets the second condition. There is no need for manual visual inspection of the indicator light, which can save labor costs and further improve the efficiency of the indicator light test.

[0006] In some embodiments, the method for obtaining the template image includes: acquiring a target image including the indicator light; locating the position of the indicator light in the target image to obtain the target position; and recording the position mark in the target image through the target position to obtain the template image.

[0007] In some embodiments, when the target image is any frame image in the surveillance video, the positioning of the indicator light in the target image to obtain the target position includes: determining any frame image adjacent to the target image in the surveillance video as a test image; determining all pixels in the target image as first pixels, and determining all pixels in the test image as second pixels; determining the brightness value of each of the first pixel points, and determining the brightness value of each of the second pixel points; calculating the brightness difference between the first pixel points and the second pixel points with the same coordinates; if the brightness difference is greater than a preset threshold, determining the coordinates of the first pixel point corresponding to the brightness difference in the target image as the target position.

[0008] In some embodiments, locating the position of the indicator light in the target image to obtain the target position includes: determining the pixel value of each first pixel point in the target image; if the pixel value is within a preset pixel value range, determining the coordinates of the first pixel point corresponding to the pixel value in the target image as the target position.

[0009] In some embodiments, after obtaining the template image by recording the position mark in the target image at the target position, the method further includes: sending the template image including the position mark to a terminal communicatively connected to the electronic device; receiving position calibration confirmation information sent by the terminal; if the confirmation information indicates that the calibration is passed, receiving a monitoring video of the indicator light working on the electronic device.

[0010] In some embodiments, the method further includes: if the confirmation information indicates that the calibration fails, repositioning the indicator light in the target image.

[0011] In some embodiments, determining the working state of the indicator light according to the flashing frequency and the duty cycle includes: if the flashing frequency satisfies a first condition and the duty cycle satisfies a second condition, determining that the indicator light is in a normal working state, wherein the first condition includes that the absolute error between the flashing frequency and the preset flashing frequency does not exceed a preset first difference, and the second condition includes that the absolute error between the duty cycle and the preset duty cycle does not exceed a preset second difference.

[0012] In some embodiments, the duty cycle is the ratio of the time that the indicator light is in the on state per unit time in the surveillance video to the unit time.

[0013] An embodiment of the present application also provides an indicator light testing device, which includes: a receiving unit, used to receive a monitoring video of the indicator light when it is working; a determination unit, used to determine the target position of the indicator light in each frame image of the monitoring video based on a pre-stored template image, wherein the template image includes a position mark of the indicator light in the template image; an acquisition unit, used to acquire image information of the indicator light at the target position; the determination unit is also used to determine the flashing frequency and duty cycle of the indicator light based on the image information; the determination unit is also used to determine the working state of the indicator light based on the flashing frequency and the duty cycle.

[0014] An embodiment of the present application further provides an electronic device, comprising: a memory storing at least one instruction; and a processor executing the instruction stored in the memory to implement the indicator light testing method.

[0015] An embodiment of the present application further provides a computer-readable storage medium, wherein at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in an electronic device to implement the indicator light testing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic diagram of an application scenario of the indicator light testing method involved in this application.

[0017] Figure 2 It is a flow chart of an embodiment of the indicator light testing method involved in the present application.

[0018] Figure 3 It is a schematic diagram of transmitting a template image including position marks provided by an embodiment of the present application.

[0019] Figure 4 This is a schematic diagram of determining a starting frame in a surveillance video provided by an embodiment of the present application.

[0020] Figure 5 It is a schematic diagram of determining the flashing period of an indicator light provided by an embodiment of the present application.

[0021] Figure 6 This is a template image acquisition flow chart provided in an embodiment of the present application.

[0022] Figure 7 This is a target location acquisition flow chart provided in an embodiment of the present application.

[0023] Figure 8This is a target location acquisition flow chart provided by another embodiment of the present application.

[0024] Fig. 9 It is a functional module diagram of a preferred embodiment of the indicator light testing device involved in the present application.

[0025] Fig.10 It is a structural schematic diagram of an electronic device of a preferred embodiment of the indicator light testing method involved in the present application. DETAILED DESCRIPTION

[0026] In order to more clearly understand the purpose, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other. In the following description, many specific details are set forth to facilitate a full understanding of the present application, and the embodiments described are only a part of the embodiments of the present application, rather than all of the embodiments.

[0027] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used herein in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0029] The embodiment of the present application provides an indicator light testing method, which can be applied to one or more electronic devices. The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, etc.

[0030] An electronic device can be any electronic product that can interact with a customer, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0031] The electronic device may also include a network device and / or a client device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.

[0032] The network where the electronic device is located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.

[0033] like Figure 1 As shown, the indicator light testing method provided by the present application can be applied to an electronic device 100, the electronic device 100 is connected to a camera 101 for communication, the camera 101 is used to monitor an electronic device 102 equipped with an indicator light, and the electronic device 102 has at least one indicator light. In the embodiment of the present application, the number of indicator lights is 3, for example Figure 1 Indicator light 103, indicator light 104 and indicator light 105. Among them, Figure 1 The white circles shown in represent the indicator lights 103 and 105, and are used to indicate that the indicator lights 103 and 105 are in the on state. Figure 1 The black circle shown in represents the indicator light 104, which is used to indicate that the indicator light 104 is in the off state. Generally, before confirming the working state of the electronic device 102 through the working states of the indicator lights 103, 104 and 105, it is necessary to first test whether the indicator lights 103, 104 and 105 can work normally during the operation of the electronic device 102. In an embodiment of the present application, the indicator lights in the electronic device 102 are monitored in real time by the camera device 101 to obtain a monitoring video, and the monitoring video is sent to the electronic device 100. Then, the electronic device 100 determines the target position of the indicator light in each frame of the monitoring video according to the pre-stored template image, and judges the working state of the indicator light in the electronic device 102 according to the image information at the position mark, wherein the template image includes the position mark of the indicator light.

[0034] It should be noted that after obtaining the template image with the position mark, the electronic device 100 also sends the template image to the terminal 106 to facilitate the staff to calibrate the position mark in the template image through the terminal 106.

[0035] like Figure 2 FIG. 1 is a flow chart of a preferred embodiment of the indicator light testing method of the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0036] S20, receiving a monitoring video of the indicator light working on the electronic device.

[0037] In one embodiment of the present application, before receiving the surveillance video, the electronic device controls the operation of the electronic device by sending a control instruction to the electronic device, so that the indicator light on the electronic device enters a working state.

[0038] In one embodiment of the present application, an electronic device including an indicator light is monitored in real time by a camera device, and a monitoring video of the indicator light working on the electronic device is obtained in real time. The on or off state of the indicator light can represent the working state of the electronic device. For example, when the electronic device is a transformer with a power indicator light, when the power indicator light is on, it indicates that the transformer is powered on, and when the power indicator light is off, it indicates that the transformer is not powered on. For another example, when the electronic device is a computer motherboard with a central processing unit (CPU) self-test indicator light, when the self-test indicator light flashes at a preset frequency, it is used to represent that the CPU in the computer motherboard is self-testing, and when the power indicator light is off, it is used to represent that the CPU in the computer motherboard is not self-testing.

[0039] In this way, by real-time monitoring of the electronic device including the indicator light and continuously observing the working status of the indicator light on the electronic device, data support can be provided for subsequent evaluation of the working status of the indicator light.

[0040] S21, determining a target position of the indicator light in each frame of the surveillance video based on a template image, wherein the template image includes a position mark of the indicator light.

[0041] In one embodiment of the present application, before evaluating the working status of the indicator light, the target position of the indicator light in each frame of the monitoring video can be determined based on the template image. In this way, in the subsequent analysis process of the working status of the indicator light, the working status of the indicator light can be obtained by analyzing the image information at the target position in each frame of the image. There is no need to analyze all the image information in each frame of the image, thereby improving the efficiency of the indicator light testing.

[0042] In one embodiment of the present application, a method for obtaining a position mark of an indicator light includes: obtaining a pixel value of each pixel point in a pre-stored target image; if the pixel value is within a preset pixel value range, determining that the coordinates of the pixel point corresponding to the pixel value in the target image are the target position; and obtaining a template image by recording the position mark in the target image through the target position.

[0043] In this embodiment, the target image can be any video frame in the surveillance video captured by the camera device, or it can be a separate surveillance image obtained by photographing the electronic device by the camera device before obtaining the surveillance video. This application does not limit this.

[0044] In this embodiment, the image recognition model is used to identify the indicator light in the target image, the input of the image recognition model is the target image, and the output of the image recognition model is the target image with multiple candidate detection frames, and each candidate frame corresponds to a confidence level, which is used to characterize the probability that the pixel point in the candidate frame is an indicator light. The image recognition model can be a FOMO model.

[0045] Exemplarily, when the confidence level corresponding to a candidate frame is 99%, the probability that the pixel point in the candidate detection frame is an indicator light is 99%.

[0046] In this embodiment, when the confidence of the candidate detection frame is greater than the preset confidence, it indicates that the pixel point in the candidate detection frame is an indicator light, and the position of the detection frame in the target image can be determined as the target position of the indicator light. When the detection frame contains one pixel point, the target position is the coordinate of the pixel point in the target image; when the detection frame contains multiple pixels, the target position is the coordinate of all pixels in the detection frame.

[0047] Exemplarily, if the preset confidence level is 85%, when the confidence level of the candidate detection frame is 90%, the position of the candidate detection frame in the target image is the target position of the indicator light.

[0048] In an embodiment of the present application, the template image is obtained by recording a position mark in the target image through the target position.

[0049] In this way, the target position of the indicator light in the target image is first identified, and then the position mark of the indicator light is determined according to the target position. In the subsequent indicator light testing process, the target position of the indicator light in each frame image can be determined by the position mark, and the image information at the target position can be analyzed, which can improve the efficiency of the indicator light testing.

[0050] In one embodiment of the present application, after obtaining the template image by recording the position mark in the target image through the target position, the method further includes: sending the template image including the position mark to a terminal that is communicatively connected to the electronic device; receiving position calibration confirmation information sent by the terminal; if the confirmation information indicates that the calibration is passed, receiving a monitoring video of the indicator light when working on the electronic device.

[0051] In this embodiment, in order to calibrate the position mark in the template image to ensure that the position mark in the template image can accurately represent the position of the indicator light, the template image containing the position mark can be transmitted to a terminal that is communicatively connected to the electronic device so as to calibrate the template position mark. The terminal can be a host computer, a mobile phone, a tablet computer, etc., which is not limited in this application.

[0052] In this embodiment, the template image containing the position mark can be transmitted by wired transmission or wireless transmission, wherein the wireless transmission includes Bluetooth transmission, and the wired transmission includes I2C port transmission and URAT port transmission.

[0053] like Figure 3 As shown, the camera device 301 monitors the electronic device 303 with the indicator light 302 in real time, obtains the position mark of the indicator light 302 in the template image, and the electronic device 304 is connected to the camera device 301 for communication, and obtains the template image with the position mark of the indicator light 302 collected by the camera device 301; the terminal 305 can be connected to the electronic device 304 for wireless communication through a wireless transmission module (not shown), and can also be connected to the electronic device 304 for wired communication through an I2C port or a UART port. The electronic device 304 transmits the template image containing the position mark of the indicator light 302 collected by the camera 301 to the terminal 305. The staff can view the position mark of the indicator light in the template image through the terminal 305. When the staff determines that the position mark of the indicator light 302 is accurate, the indicator light test can be continued.

[0054] In an embodiment of the present application, the method further includes: if the confirmation information indicates that the calibration fails, relocating the position of the indicator light in the target image.

[0055] like Figure 3 As shown, when the staff determines that the position mark of the indicator light 302 is inaccurate, the electronic device 304 can repeat steps S20 to S21 to reposition the position mark of the indicator light 302 in the template image.

[0056] In one embodiment of the present application, after the electronic device obtains the target position of the indicator light within the imaging range, the device to which the indicator light belongs receives the instruction sent by the host computer, enters the working state according to the instruction, and the indicator light starts to flash. Each of the operating instructions corresponds to a standard state of the indicator light, that is, when the device to which the indicator light belongs runs according to different instructions, the indicator light has different flashing frequencies and duty cycles. The duty cycle refers to the proportion of the time that the indicator light is on in a preset period to the preset period.

[0057] S22: Acquire image information of the indicator light at the target position according to the position mark.

[0058] In one embodiment of the present application, in order to confirm the working status of the indicator light, the image information of the indicator light at the target position can be confirmed based on the position mark, and the working status of the indicator light can be determined based on the change of the image information, and the image information includes at least the brightness value of the pixel point at the target position.

[0059] For example, when the brightness value at the target position is high, it indicates that the indicator light is in the on state, and when the brightness value at the target position is low, it indicates that the indicator light is in the off state. Further, the working state of the indicator light can be determined according to the number and frequency of conversions between the on state and the off state of the indicator light.

[0060] S23, determining a flashing frequency and a duty cycle of the indicator light according to the image information.

[0061] In one embodiment of the present application, in order to test the working state of the indicator light, the working parameters of the indicator light can be determined according to the image information, wherein the image information at least includes the brightness value at the target position in each frame of the monitoring video; the working parameters of the indicator light at least include the flashing frequency and the duty cycle.

[0062] In one embodiment of the present application, the duty cycle is the ratio of the duration of the indicator light being on in a unit time in the surveillance video to the unit time. For example, when the unit time is 10 seconds, and the total duration of the indicator light being on in the 10 seconds of the surveillance video is 5 seconds, the duty cycle of the indicator light is 0.5.

[0063] In one embodiment of the present application, the monitoring video includes multiple video frames, and the method for determining the flashing frequency and duty cycle of the indicator light includes: obtaining the brightness value at the target position in each of the video frames, wherein each of the video frames corresponds to a timestamp; determining the flashing frequency and duty cycle of the indicator light according to the brightness value and the timestamp.

[0064] In this embodiment, the monitoring video refers to the monitoring video of the indicator light captured by the camera within a preset time length, and the monitoring video includes multiple video frames, each video frame is used to represent the image information within the imaging range of the camera, and each video frame corresponds to a timestamp, which is used to represent the moment when the video frame is captured.

[0065] In this embodiment, the image information at the target position in the video frame is the image information corresponding to the indicator light within the camera imaging range. For the target position in each video frame, when the brightness value at the target position is within the preset brightness value range, it means that the indicator light is on; when the brightness value at the target position is not within the preset brightness value range, it means that the indicator light is off. When the target position contains one pixel, the brightness value of the pixel is used as the brightness value of the target position; when the target position contains multiple pixels, the average of the brightness values ​​of the multiple pixels is used as the brightness value of the target position.

[0066] In one embodiment of the present application, when the brightness value at the target position in a certain video frame is greater than the brightness value at the target position in the previous frame, and the difference in brightness values ​​is greater than a preset threshold, the video frame is marked as a start frame; when the brightness value at the target position in a certain video frame is greater than the brightness value at the target position in the next frame, and the difference in brightness values ​​is greater than a preset threshold, the video frame is marked as a stop frame; when the difference between the brightness value at the target position in a certain video frame and the brightness value at the target position in any start frame or any stop frame is less than or equal to a preset threshold, the video frame is determined to be a light-on frame; when the difference between the brightness value at the target position in a certain video frame and the brightness value at the target position in any start frame or any stop frame is greater than a preset threshold, the video frame is determined to be an off frame.

[0067] In one embodiment of the present application, the flashing period of the indicator light is calculated according to the timestamps of any two adjacent start frames; and the flashing frequency of the indicator light is determined according to the flashing period.

[0068] like Figure 4 As shown, the T axis is used to represent the time axis of the surveillance video, and the Y axis is used to represent the brightness value at the target position of each video frame in the surveillance video. The surveillance video includes a light-on frame 401 and a light-on frame 402, and a light-off frame 403 and a light-off frame 404. Since the previous video frame of the light-on frame 401 is the light-off frame 403, the light-on frame 401 is marked as the starting frame; for another example, the previous video frame of the light-on frame 402 is the light-off frame 404, so the light-on frame 402 is marked as the starting frame.

[0069] In this embodiment, since the start frame represents the change of the indicator light from the off state to the on state, a flashing cycle of the indicator light can be determined according to the timestamps corresponding to any two adjacent start frames. At the beginning of the flashing cycle, the indicator light changes from off to on, and after being on for a period of time, it goes off again. At the end of the flashing cycle, the indicator light changes from off to on again to enter the next flashing cycle.

[0070] like Figure 5 As shown, the T axis is used to represent the time axis of the monitoring video, and the Y axis is used to represent the brightness value at the target position of each video frame in the monitoring video. Among them, the starting frame 501 and the starting frame 502 are two adjacent starting frames, and the timestamp corresponding to the starting frame 501 is 503, and the timestamp corresponding to the starting frame 502 is 504. The time difference between the timestamp 503 and the timestamp 504 is a flashing cycle 505 of the indicator light.

[0071] In this embodiment, after obtaining the flashing cycle of the indicator light, the unit of the flashing cycle can be converted into seconds, and the ratio of 1 second to the flashing cycle can be calculated to obtain the flashing frequency of the indicator light, which is used to represent the number of times the indicator light flashes within 1 second.

[0072] For example, when a flashing cycle of the indicator light is 0.08 seconds, the flashing frequency Freq of the indicator light is:

[0073]

[0074] In one embodiment, the method for determining the duty cycle of the indicator light according to the brightness value and the timestamp includes: calculating the ratio of the number of the lighted frames to the total number of all the video frames in the monitoring video to obtain the duty cycle of the indicator light.

[0075] In this embodiment, the duty cycle is the ratio of the time that the indicator light is in the lighting state per unit time in the monitoring video to the unit time.

[0076] Exemplarily, when the number of lit frames is 8 and the surveillance video contains a total of 14 video frames, the duty cycle Rito of the indicator light is:

[0077]

[0078] In this way, by analyzing the image information in the monitoring video, the flashing frequency and duty cycle of the indicator light are obtained, thereby avoiding the problem of low testing efficiency when the indicator light is tested by human visual inspection.

[0079] S24, determining the working state of the indicator light according to the flashing frequency and the duty cycle.

[0080] In an embodiment of the present application, the flashing frequency and duty cycle of the indicator light can represent the working state of the indicator light. When the flashing frequency and duty cycle of the indicator light both meet a certain preset condition, it indicates that the working state of the indicator light is normal.

[0081] In one embodiment of the present application, determining the working state of the indicator light according to the flashing frequency and the duty cycle includes: if the flashing frequency satisfies a first condition and the duty cycle satisfies a second condition, determining that the indicator light is in a normal working state, wherein the first condition includes that the absolute error between the flashing frequency and a preset flashing frequency does not exceed a preset first difference, and the second condition includes that the absolute error between the duty cycle and a preset duty cycle does not exceed a preset second difference.

[0082] Among them, the preset flashing frequency and the preset duty cycle refer to: the flashing frequency and duty cycle that the indicator light should have after the electronic device receives the operation instruction sent by the electronic device and starts to run, and the preset flashing frequency and the preset duty cycle correspond to the control instruction sent by the electronic device.

[0083] For example, an electronic device sends a control instruction A to an electronic device to control an indicator light in the electronic device to enter a working state. If the preset flashing frequency corresponding to the control instruction A is 12.8 Hz and the preset duty cycle is 0.5, when the flashing frequency of the indicator light is 12.5 Hz and the duty cycle is 0.57, and when the preset first difference is 1 Hz and the preset second difference is 0.1, since the flashing frequency of the indicator light satisfies the first condition and the duty cycle of the indicator light satisfies the second condition, the working state of the indicator light is normal.

[0084] For another example, an electronic device sends a control instruction B to an electronic device to control an indicator light in the electronic device to enter a working state. If the preset flashing frequency corresponding to the control instruction B is 12.8 Hz and the preset duty cycle is 0.5, when the flashing frequency of the indicator light is 13.8 Hz and the duty cycle is 0.67, and when the preset first difference is 1 Hz and the preset second difference is 0.1, since the flashing frequency of the indicator light does not meet the first condition and the duty cycle of the indicator light does not meet the second condition, the working state of the indicator light is abnormal.

[0085] like Figure 6 As shown in FIG. 1 , it is a flow chart of template image acquisition provided by an embodiment of the present application. Figure 6 The template image acquisition process shown in the figure specifically includes:

[0086] S60, collecting a target image including the indicator light.

[0087] In this embodiment, the target image can be any video frame in the surveillance video captured by the camera device, or it can be a separate surveillance image obtained by photographing the electronic device by the camera device before obtaining the surveillance video. This application does not limit this.

[0088] S61, locating the position of the indicator light in the target image to obtain the target position.

[0089] In this embodiment, the target position includes coordinates of at least one pixel point, and each of the coordinates is used to represent the position of the indicator light within the imaging range of the camera device.

[0090] S62, recording the position mark in the target image through the target position to obtain the template image.

[0091] In this embodiment, the position mark in the target image is recorded based on the target position to obtain a template image, wherein the position mark in the template image is used to provide position information of the indicator light during the positioning process.

[0092] Exemplarily, if the target position of the indicator light in the target image is (10, 10), the position mark in the template image is also (10, 10); if the target position of the indicator light in the target image includes multiple coordinates, namely (10, 10), (10, 11), (11, 10), and (11, 11), the position mark in the template image also includes multiple coordinates, namely (10, 10), (10, 11), (11, 10), and (11, 11).

[0093] like Figure 7 As shown in FIG. 1 , it is a target position acquisition flow chart provided by an embodiment of the present application. When the target image is any frame image in the monitoring video, as Figure 7 The target location acquisition process shown in the figure specifically includes:

[0094] S70: Determine any frame of image adjacent to the target image in the surveillance video as a test image.

[0095] In one embodiment of the present application, the indicator light changes from an off state to an on state within a first preset time length when the device to which it belongs is powered on. Therefore, when the target image is any frame image in the surveillance video, the target position of the indicator light in the target image can be obtained by identifying the area with a high brightness change in the surveillance video. Exemplarily, the first preset time length can be 5 seconds.

[0096] In one embodiment of the present application, in order to determine the brightness change of each pixel in the surveillance video, it is first possible to determine that any frame image adjacent to the target image in the surveillance video is a test image, wherein the test image can be the subsequent frame image of the target image in the surveillance video, or it can be the previous frame image of the target image in the surveillance video, and the present application does not limit this.

[0097] S71, determining that all pixels in the target image are first pixels, and determining that all pixels in the test image are second pixels.

[0098] S72: Determine the brightness value of each of the first pixel points, and determine the brightness value of each of the second pixel points.

[0099] In one embodiment of the present application, since both the target image and the test image are digital images, the pixel values ​​of each of the first pixel and the second pixel have three channels, namely, an R channel, a G channel, and a B channel. In order to obtain the brightness value of the first pixel and the second pixel, the values ​​of the three channels can be converted into gray values ​​to represent the brightness value of the first pixel or the second pixel. The way of converting the values ​​of the three channels R, G, and B into gray values ​​satisfies the following relationship:

[0100] gray=0.299*R+0.578*G+0.114*B

[0101] Among them, gray represents the grayscale value of the first pixel or the second pixel, and its value range is (0, 255); R, G, and B represent the R channel value, G channel value, and B channel value of the pixel respectively, and the value range of the three channel values ​​is (0, 255).

[0102] Exemplarily, when the pixel value of a first pixel in the target image includes R=100, G=50, and B=150, the grayscale value of the first pixel is calculated as follows:

[0103] gray=0.299*100+0.578*50+0.114*150=75.9

[0104] In one embodiment of the present application, the grayscale value of a pixel may be used as the brightness value of the pixel.

[0105] S73: Calculate the brightness difference between the first pixel point and the second pixel point having the same coordinates.

[0106] In one embodiment of the present application, a brightness difference between a first pixel point and a second pixel point having the same coordinates may be calculated to represent a brightness change at the pixel point in the surveillance video.

[0107] For example, when the coordinates of a first pixel point in the target image are the 10th row and the 10th column, the coordinates of a second pixel point in the test image are the 10th row and the 10th column, and the brightness value of the first pixel point is 75.9, and the brightness value of the second pixel point is 254, then the brightness difference at the 10th row and the 10th column is 178.1.

[0108] S74: If the brightness difference is greater than a preset threshold, determine the coordinates of the first pixel point corresponding to the brightness difference in the target image as the target position.

[0109] In one embodiment of the present application, when the brightness difference is greater than a preset threshold, it indicates that the brightness change at the coordinate is high, and the coordinates of the first pixel point corresponding to the brightness difference in the target image can be used as the target position of the indicator light in the target image.

[0110] Exemplarily, when the preset threshold is 100 and the pixel difference at the 10th row and 10th column in the target image is 178.1, the coordinates (10, 10) of the first pixel point corresponding to the brightness difference in the target image can be used to characterize the target position of the indicator light in the target image.

[0111] like Figure 8 As shown in FIG. 1 , it is a target position acquisition flow chart provided by another embodiment of the present application. Figure 8 The target location acquisition process shown in the figure specifically includes:

[0112] S80: Determine the pixel value of each first pixel in the target image.

[0113] In one embodiment of the present application, since the target image is a digital image, the pixel value of each first pixel has three channels, namely, R channel, G channel and B channel. Therefore, the pixel value of the first pixel can be in a three-dimensional vector format, for example, the pixel value of the first pixel can be [5, 200, 5].

[0114] S81: If the pixel value is within a preset pixel value range, determine the coordinates of a first pixel point corresponding to the pixel value in the target image as the target position.

[0115] In this embodiment, the indicator light may present different colors when it is on, for example, red, green, blue, etc. Therefore, a pixel value range may be pre-set according to the color of the indicator light, and then the pixel value of each pixel point in the target image is identified, and it is determined whether the pixel value is within the preset pixel value range. If the pixel value of the pixel point is within the preset pixel value range, it indicates that the pixel value of the pixel point is the same as the color of the indicator light, and the coordinates of the pixel point in the target image may be further marked as the target position of the indicator light.

[0116] Exemplarily, if the indicator light is green, the preset pixel value range can be: [0 < R < 10, 10 < G < 256, 0 < B < 10].

[0117] In an embodiment of the present application, if the pixel value of a certain pixel point is within the preset pixel value range, the coordinates of this pixel point can be used as the target position of the indicator light in the target image. For example, when the pixel value corresponding to the pixel point with coordinates (10, 10) is [R: 5, G: 200, B: 5], and the preset pixel value range is [0 < R < 10, 10 < G < 256, 0 < B < 10], then the target position of the indicator light in the target image is (10, 10).

[0118] It can be seen from the above technical solutions that in the present application, the target position of the indicator light in the monitoring video is first determined through the position mark of the indicator light in the template image, and then the image information at the target position is analyzed during the test process, so that the flashing frequency and duty cycle of the indicator light can be obtained, which can improve the efficiency of indicator light testing; afterwards, by judging whether the flashing frequency of the indicator light meets the first condition and judging whether the duty cycle meets the second condition, the test result of the indicator light is determined. There is no need for manual visual inspection of the indicator light, thus saving labor costs and further improving the efficiency of indicator light testing.

[0119] Please refer to Fig. 9 , Fig. 9 which is a functional module diagram of a preferred embodiment of the indicator light testing device of the present application. The indicator light testing device 11 includes a receiving unit 110, a determining unit 111, and an obtaining unit 112. The so-called module / unit in the present application refers to a series of computer-readable instruction segments that can be executed by a processor 13 and can complete fixed functions, and are stored in a memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0120] The receiving unit 110 is configured to receive the monitoring video when the indicator light is working.

[0121] The determining unit 111 is configured to determine the target position of the indicator light in each frame of the monitoring video according to a pre-stored template image, where the template image includes the position mark of the indicator light in the template image.

[0122] The obtaining unit 112 is configured to obtain the image information of the indicator light at the target position.

[0123] The determining unit 111 is further configured to determine the flashing frequency and duty cycle of the indicator light according to the image information.

[0124] The determining unit 111 is further configured to determine the working state of the indicator light according to the flashing frequency and the duty cycle.

[0125] In one embodiment, when the target image is any frame image in the surveillance video, the positioning unit 111 locates the position of the indicator light in the target image to obtain the target position, including: determining any frame image adjacent to the target image in the surveillance video as a test image; determining all pixels in the target image as first pixels, and determining all pixels in the test image as second pixels; determining the brightness value of each of the first pixel points, and determining the brightness value of each of the second pixel points; calculating the brightness difference between the first pixel points and the second pixel points with the same coordinates; if the brightness difference is greater than a preset threshold, determining the coordinates of the first pixel point corresponding to the brightness difference in the target image as the target position.

[0126] In another embodiment, the positioning unit 111 locates the position of the indicator light in the target image to obtain the target position, including: determining the pixel value of each first pixel point in the target image; if the pixel value is within a preset pixel value range, determining the coordinates of the first pixel point corresponding to the pixel value in the target image as the target position.

[0127] In one embodiment, the receiving unit 110 is also used to obtain a template image, specifically including: acquiring a target image including the indicator light; locating the position of the indicator light in the target image to obtain the target position; and recording the position mark in the target image through the target position to obtain the template image.

[0128] In one embodiment, after the receiving unit 110 obtains the template image including the position mark, the determining unit 111 is further used to: send the template image including the position mark to a terminal that is communicatively connected to the electronic device; receive position calibration confirmation information sent by the terminal; if the confirmation information indicates that the calibration is passed, receive a monitoring video of the indicator light when it is working on the electronic device.

[0129] In one embodiment, the determining unit 111 is further configured to: if the confirmation information indicates that the calibration fails, reposition the indicator light in the target image.

[0130] In one embodiment, the determination unit 111 determines the working state of the indicator light according to the flashing frequency and the duty cycle, including: if the flashing frequency satisfies a first condition and the duty cycle satisfies a second condition, determining that the indicator light is in a normal working state, wherein the first condition refers to that the absolute error between the flashing frequency and the preset flashing frequency does not exceed a preset first difference, and the second condition refers to that the absolute error between the duty cycle and the preset duty cycle does not exceed a preset second difference.

[0131] In one embodiment, the duty cycle is the ratio of the duration that the indicator light is in the on state per unit time in the surveillance video to the unit time.

[0132] It can be seen from the above technical solution that the present application first determines the target position of the indicator light in the monitoring video by marking the position of the indicator light in the template image, and then analyzes the image information at the target position during the test to obtain the flashing frequency and duty cycle of the indicator light, which can improve the efficiency of the indicator light test; thereafter, the test result of the indicator light is determined by judging whether the flashing frequency of the indicator light meets the first condition and judging whether the duty cycle meets the second condition. There is no need for manual visual inspection of the indicator light, which can save labor costs and further improve the efficiency of the indicator light test.

[0133] See also Fig.10 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1 includes a memory 12 and a processor 13. The memory 12 is used to store computer-readable instructions, and the processor 13 is used to execute the computer-readable instructions stored in the memory to implement the indicator light testing method described in any of the above embodiments.

[0134] In one embodiment, the electronic device 1 further includes a bus, and a computer program stored in the memory 12 and executable on the processor 13, such as an indicator light test program.

[0135] Fig.10 Only the electronic device 1 having the memory 12 and the processor 13 is shown, and those skilled in the art can understand that Fig.10 The structure shown does not constitute a limitation on the electronic device 1 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0136] Combination Figure 2The memory 12 in the electronic device 1 stores a plurality of computer-readable instructions to implement an indicator light testing method, and the processor 13 can execute the plurality of instructions to implement: receiving a monitoring video of the indicator light working on the electronic device; determining a target position of the indicator light in each frame image in the monitoring video based on a template image, wherein the template image includes a position mark of the indicator light; acquiring image information of the indicator light at the target position according to the position mark; determining a flashing frequency and a duty cycle of the indicator light according to the image information; and determining a working state of the indicator light according to the flashing frequency and the duty cycle.

[0137] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0138] Those skilled in the art will appreciate that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may be a bus structure or a star structure. The electronic device 1 may also include more or less other hardware or software than shown in the diagram, or a different arrangement of components. For example, the electronic device 1 may also include input and output devices, network access devices, etc.

[0139] It should be noted that the electronic device 1 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.

[0140] The memory 12 includes at least one type of readable storage medium, which may be non-volatile or volatile. The readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 may be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the indicator light test program, etc., but also can be used to temporarily store data that has been output or is to be output.

[0141] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect various components of the entire electronic device 1, and executes or executes programs or modules stored in the memory 12 (for example, executing an indicator light test program, etc.), and calls data stored in the memory 12 to execute various functions of the electronic device 1 and process data.

[0142] The processor 13 executes the operating system of the electronic device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-mentioned various indicator light testing method embodiments, for example Figure 2 , Figure 6-8 Steps shown.

[0143] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a receiving unit 110, a determining unit 111, and an acquiring unit 112.

[0144] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute a part of the indicator light test method described in each embodiment of the present application.

[0145] If the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware devices to complete through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented.

[0146] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory and other memory, etc.

[0147] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0148] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. Fig.10 Only one arrow is used in the figure, but it does not mean that there is only one bus or one type of bus. The bus is configured to realize the connection and communication between the memory 12 and at least one processor 13, etc.

[0149] An embodiment of the present application also provides a computer-readable storage medium (not shown), in which computer-readable storage medium is stored computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the indicator light testing method described in any of the above embodiments.

[0150] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0151] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0152] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0153] In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.

[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A method for testing an indicator light, applied to an electronic device, characterized in that: The indicator light is installed on an electronic device, and the electronic device is communicatively connected with the electronic device. The method includes: receiving a monitoring video of the indicator light when it is operating on the electronic device; Determine the target position of the indicator light in each frame of the surveillance video based on a template image, wherein the template image includes a position mark of the indicator light; Acquire image information of the indicator light at the target position according to the position mark; Determining the flashing frequency and duty cycle of the indicator light according to the image information; and The working state of the indicator light is determined according to the flashing frequency and the duty cycle.

2. The indicator light testing method according to claim 1, characterized in that: The method for obtaining the template image includes: Acquiring a target image including the indicator light; Locating the position of the indicator light in the target image to obtain the target position; The template image is obtained by recording the position mark in the target image through the target position.

3. The indicator light testing method according to claim 2, characterized in that: When the target image is any frame of the surveillance video, locating the position of the indicator light in the target image to obtain the target position includes: Determine any frame of image adjacent to the target image in the surveillance video as a test image; Determine all pixels in the target image as first pixels, and determine all pixels in the test image as second pixels; Determine a brightness value of each of the first pixel points, and determine a brightness value of each of the second pixel points; Calculating a brightness difference between the first pixel and the second pixel having the same coordinates; If the brightness difference is greater than a preset threshold, the coordinates of the first pixel point corresponding to the brightness difference in the target image are determined to be the target position.

4. The indicator light testing method according to claim 2, characterized in that: The step of locating the position of the indicator light in the target image to obtain the target position comprises: Determine a pixel value of each first pixel in the target image; If the pixel value is within a preset pixel value range, the coordinates of a first pixel point corresponding to the pixel value in the target image are determined as the target position.

5. The indicator light testing method according to claim 2, characterized in that: After recording the position mark in the target image through the target position to obtain the template image, the method further includes: Sending the template image including the position mark to a terminal communicatively connected to the electronic device; Receiving position calibration confirmation information sent by the terminal; If the confirmation information indicates that the calibration is passed, a monitoring video of the indicator light working on the electronic device is received.

6. The indicator light testing method according to claim 5, characterized in that: The method further comprises: If the confirmation information indicates that the calibration fails, the position of the indicator light in the target image is relocated.

7. The indicator light testing method according to claim 6, characterized in that: Determining the working state of the indicator light according to the flashing frequency and the duty cycle includes: If the flashing frequency satisfies a first condition and the duty cycle satisfies a second condition, it is determined that the indicator light is in a normal working state, wherein the first condition includes that the absolute error between the flashing frequency and the preset flashing frequency does not exceed a preset first difference, and the second condition includes that the absolute error between the duty cycle and the preset duty cycle does not exceed a preset second difference.

8. The indicator light testing method according to claim 1, characterized in that: The duty cycle is the ratio of the time that the indicator light is in the on state per unit time in the surveillance video to the unit time.

9. An indicator light testing device, characterized in that: The device comprises: A receiving unit, used for receiving monitoring video when the indicator light is working; A determination unit, configured to determine a target position of the indicator light in each frame of the surveillance video according to a pre-stored template image, wherein the template image includes a position mark of the indicator light in the template image; An acquisition unit, used for acquiring image information of the indicator light at the target position; The determining unit is further used to determine the flashing frequency and duty cycle of the indicator light according to the image information; The determining unit is further used to determine the working state of the indicator light according to the flashing frequency and the duty cycle.

10. An electronic device, characterized in that: The electronic device comprises: a memory storing computer-readable instructions; and A processor executes the computer-readable instructions stored in the memory to implement the indicator light testing method according to any one of claims 1 to 8.