A black screen abnormality detection method, device, computer equipment and storage medium
By setting different target footing points for the detection camera and automatically adjusting preset calibration areas, the detection efficiency and cost problems of black screen problems in cockpit software testing are solved, automatic detection and efficient screen image extraction are achieved, and manpower and equipment needs are reduced.
Patent Information
- Application Number
- CN202410023434.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-05
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-01-05
AI Technical Summary
In cockpit software testing, the occasionality of black screen problems leads to the need for a large number of test samples. Manual testing consumes manpower and is prone to missed detection and misjudgment. Automatic testing requires multiple imaging equipment and multiple calibrations, which is a large workload.
By setting different target footprints, different screens are detected for one camera, and screen images are extracted using binarization processing, edge detection algorithms and Hough transformations, and preset calibration areas are automatically adjusted to reduce repeated calibration and human resource consumption.
Automatic detection is realized, saving the number and labor costs of detection cameras, improving detection efficiency and accuracy, and reducing the demand for imaging equipment.
Smart Images

Figure CN117834997B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of screen detection technology, and in particular to a black screen abnormality detection method, device, computer equipment and storage medium. Background Art
[0002] As the functions of smart cockpit software become increasingly rich, the amount of software coding is growing exponentially, and the software iteration speed is extremely fast, which brings huge challenges to the quality of cockpit software, especially problems such as black screen, which may even affect user safety. Therefore, black screen testing is particularly important in cockpit testing.
[0003] Black screen testing is generally divided into two methods: manual testing and automated testing. Since the black screen problem is an occasional problem, a large number of test samples are required. If manual testing is used, a large amount of manpower will be wasted, and it is easy to miss detection and misjudgment. Therefore, automated testing has gradually become the mainstream method. In automated black screen testing, it is usually necessary to use imaging equipment (usually a camera) for advance calibration to determine the position of the vehicle screen. During the test, the screen of the vehicle screen is captured at regular intervals, and the captured image is tested. In addition, one imaging device can only monitor one screen. If a large number of test samples are required, a large number of imaging devices need to be purchased, and multiple calibrations and tests are required, which will also bring a lot of workload. Summary of the invention
[0004] In view of this, the present invention provides a black screen abnormality detection method, device, computer equipment and storage medium to solve the problem in the related art that screen testing requires a large number of test cameras.
[0005] In a first aspect, the present invention provides a method for detecting a black screen abnormality, the method comprising: receiving a detection request, the detection request including a target landing point corresponding to a screen to be tested; different screens are arranged at different positions, corresponding to different landing points; moving a detection camera to the target landing point corresponding to the screen to be tested, taking a picture of the screen to be tested by the detection camera to obtain a regional image; extracting a screen image from the regional image; and detecting the screen image to obtain a detection result of the screen to be tested.
[0006] The black screen abnormality detection method provided by the present invention sets different target landing points for different screens to be tested, so that one camera can meet the measurement requirements of different screens to be tested, saving a large number of requirements for detection cameras in the execution of detection, thereby saving the cost of detection. The method can also realize automatic detection of the screen to be tested, extract a complete image of the screen, and output the result of screen detection.
[0007] In an optional embodiment, the step of extracting a screen image from a regional image includes: binarizing the regional image to obtain a grayscale image of the regional image; extracting a to-be-identified area corresponding to a preset calibration area of the screen to be tested in the grayscale image, wherein different screens correspond to different preset calibration areas; using an edge detection algorithm to determine an edge position in the to-be-identified area; using a Hough transform to determine a straight line in the to-be-identified area, and determining a maximum rectangle in the to-be-identified area based on the straight line and the edge position; if the area of the maximum rectangle is the same as the area of the preset calibration area, determining the maximum rectangle as the screen image.
[0008] The black screen abnormality detection method provided by the present invention uses binarization processing to obtain a grayscale image, finds the area to be identified corresponding to the preset calibration area, and then confirms the position of the screen in the area to be identified by an edge detection algorithm and a straight line. Since the size of the area to be identified is consistent with the size of the screen in the initial setting, it can be determined whether the screen is offset. After the method sets the preset calibration area, it is no longer necessary to detect the size of the screen to be tested in subsequent detections, and the offset detection of the screen to be tested can be performed directly.
[0009] In an optional embodiment, if the area of the maximum rectangle is different from the area of the preset calibration area, the starting point coordinates of the preset calibration area are adjusted, and the adjusted preset calibration area is determined according to the adjusted starting point coordinates, and the step of extracting the area to be identified corresponding to the preset calibration area of the screen to be tested in the grayscale image is returned until the area of the maximum rectangle is the same as the area of the preset calibration area, and the maximum rectangle is determined as the screen image.
[0010] The black screen abnormality detection method provided by the present invention automatically adjusts the starting point coordinates of a preset calibration area through a correction algorithm when the screen to be tested is determined to be offset, thereby reducing the need for repeated calibration and saving human resource costs.
[0011] In an optional implementation, if the area of the maximum rectangle is different from the area of the preset calibration area, the coordinates of the starting point of the preset calibration area are adjusted; the coordinates of the starting point include a first coordinate value and a second coordinate value, the first coordinate value is the coordinate value of the starting point on the X-axis, and the second coordinate value is the coordinate value of the starting point on the Y-axis;
[0012] Move the starting point coordinates by one pixel along the first direction on the X-axis, and determine the adjusted preset calibration area according to the adjusted starting point coordinates; determine the maximum rectangle in the adjusted area to be identified; if the maximum rectangle in the adjusted area to be identified is larger than the maximum rectangle in the area to be identified before the adjustment, continue to move the starting point coordinates along the first direction until the maximum rectangle in the adjusted area to be identified is smaller than the maximum rectangle in the area to be identified after the last adjustment, and determine the last adjusted position as the adjusted first coordinate value; move the starting point coordinates by one pixel along the third direction on the Y-axis, and determine the adjusted preset calibration area according to the adjusted starting point coordinates; determine the maximum rectangle in the adjusted area to be identified; if the adjusted area to be identified is smaller than the maximum rectangle in the area to be identified, the position after the last adjustment is determined as the adjusted first coordinate value. If the largest rectangle in the area is larger than the largest rectangle in the area to be identified before adjustment, continue to move the coordinates of the starting point along the third direction until the largest rectangle in the area to be identified after adjustment is smaller than the largest rectangle in the area to be identified after the last adjustment, and determine the position after the last adjustment as the adjusted second coordinate value; if the largest rectangle in the area to be identified after adjustment is smaller than the largest rectangle in the area to be identified before adjustment, move the coordinates of the starting point along the fourth direction until the largest rectangle in the area to be identified after adjustment is smaller than the largest rectangle in the area to be identified after the last adjustment, determine the position after the last adjustment as the adjusted second coordinate value, and determine the largest rectangle in the area to be identified after the last adjustment as the screen image; the third direction is opposite to the fourth direction;
[0013] The adjusted starting point coordinates are determined according to the adjusted first coordinate value and the adjusted second coordinate value.
[0014] In an optional embodiment, if the largest rectangle in the area to be identified after adjustment along the first direction is smaller than the largest rectangle in the area to be identified before adjustment, the coordinates of the starting point are moved along the second direction until the largest rectangle in the area to be identified after adjustment is smaller than the largest rectangle in the area to be identified after the last adjustment, and the last adjusted position is determined as the adjusted first coordinate value; the first direction and the second direction are opposite.
[0015] In an optional embodiment, if the largest rectangle in the area to be identified after adjustment along the third direction is smaller than the largest rectangle in the area to be identified before adjustment, the coordinates of the starting point are moved along the fourth direction until the largest rectangle in the area to be identified after adjustment is smaller than the largest rectangle in the area to be identified after the last adjustment, the last adjusted position is determined as the adjusted second coordinate value, and the largest rectangle in the area to be identified after the last adjustment is determined as the screen image; the third direction is opposite to the fourth direction.
[0016] In an optional embodiment, the step of detecting a screen image and obtaining a detection result of the screen to be tested includes: performing grayscale preprocessing on the screen image to obtain a grayscale image; calculating the grayscale extreme value difference of the grayscale image, if the grayscale extreme value difference is less than a preset threshold, stopping the test and determining that the screen to be tested is abnormal; if the grayscale extreme value difference is greater than the preset threshold, binarizing the grayscale image according to the binarization threshold, and dividing the grayscale value of the grayscale image into a first value and a second value; counting a first proportion of pixels with a grayscale value of the first value in the screen image, and a second proportion of pixels with a grayscale value of the second value in the screen image; if both the first proportion and the second proportion are greater than the preset value, determining that the screen to be tested is normal; if the first proportion or the second proportion is less than the preset value, determining that the screen to be tested is abnormal.
[0017] The black screen abnormality detection method provided by the present invention can realize pure color detection of the image by converting the captured image into a grayscale image and further calculating the grayscale extreme value difference; then the image is binarized to form a first value and a second value, and the proportion of pixels with a grayscale value of the first value and a proportion of pixels with a grayscale value of the second value in the screen image is compared to detect whether the screen color meets the detection requirements, thereby avoiding the first pure color detection not being detected; through the two detection methods, the final screen detection result is guaranteed to be more reliable.
[0018] In the second aspect, the present invention provides a black screen abnormality detection device, which includes: a detection receiving module, used to receive a detection request, the detection request includes a target landing point corresponding to the screen to be tested; different screens are set at different positions, corresponding to different landing points; a camera detection module, used to move the detection camera to the target landing point corresponding to the screen to be tested, and take a picture of the screen to be tested by the detection camera to obtain a regional image; an image extraction module, used to extract the screen image from the regional image; an image detection module, used to detect the screen image and obtain the detection result of the screen to be tested.
[0019] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the black screen abnormality detection method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0020] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the black screen abnormality detection method of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 is a schematic flow chart of a method for detecting a black screen anomaly according to an embodiment of the present invention;
[0023] Figure 2 is a schematic structural diagram of a detection frame according to an embodiment of the present invention;
[0024] Figure 3 is a flow chart of another black screen abnormality detection method according to an embodiment of the present invention;
[0025] Figure 4 is a flow chart of another black screen abnormality detection method according to an embodiment of the present invention;
[0026] Figure 5 is a schematic diagram of the structure of a black screen abnormality detection device according to an embodiment of the present invention;
[0027] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0029] Since the black screen problem in the cockpit is an occasional problem, a large number of test samples are required to detect the black screen problem. In the automated black screen test, it is usually necessary to use an imaging device (camera) to capture the image of the vehicle screen at regular intervals and detect the captured image. One imaging device can only monitor one screen. If a large number of test samples are required, a large number of imaging devices need to be purchased, and multiple calibrations and tests need to be performed, which will also bring a considerable workload. Therefore, the present invention provides a black screen anomaly detection method, which can realize the detection of more vehicle screens with a small number of cameras, and can calibrate and correct the vehicle screen during testing.
[0030] According to an embodiment of the present invention, an embodiment of a black screen abnormality detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] In this embodiment, a black screen abnormality detection method is provided. Figure 1 is a flow chart of a black screen abnormality detection method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0032] Step S101, receiving a detection request, wherein the detection request includes a target landing point corresponding to the screen to be detected.
[0033] In an optional embodiment, different screens are arranged at different positions, corresponding to different target landing points.
[0034] In an optional embodiment, when the screen to be tested needs to be tested, a test request will be sent to the test camera and the system that performs the test. The above-mentioned test request includes the corresponding target landing point of the screen to be tested, and the target landing point is used to indicate the position of the camera during detection; the test request also includes the current screen type, the vehicle computer to which it belongs, and the preset calibration area of the screen, wherein the screen type and the vehicle computer to which it belongs are used to confirm whether the screen to be tested is the screen to be tested, and the preset calibration area of the screen is used to determine the position of the test image where the screen to be tested should be in the test. If an offset occurs, the detection system can automatically perform coordinate displacement recalibration to find the screen to be tested.
[0035] Step S102, moving the detection camera to the target landing point corresponding to the screen to be tested, taking a picture of the screen to be tested by the detection camera, and obtaining a regional image.
[0036] In an optional embodiment, after receiving a detection request for the screen to be tested, the camera to be tested moves to a corresponding target landing point according to the target landing point provided in the detection request, takes a picture of the screen to be tested, and obtains a regional image.
[0037] Step S103: extracting a screen image from the area image.
[0038] In an optional embodiment, after the camera to be tested takes a picture and obtains the regional image, the screen image is extracted from the regional image through an algorithm.
[0039] Step S104, detecting the screen image to obtain a detection result of the screen to be tested.
[0040] In an optional embodiment, after the screen image is extracted, the screen image is detected, and it is determined based on the detection result whether a black screen appears on the screen to be tested.
[0041] In an optional embodiment, before performing screen detection, an initial screen calibration is performed. Figure 2 As shown, multiple screens to be tested are placed on the corresponding test frame at one time. The number of screens for hanging test on one test frame varies according to the size of the screen. After the screens to be tested are installed, the test frame performs initial calibration on the screens to be tested. The calibration content includes the screen type, the vehicle computer to which it belongs, and the landing point to which it belongs. There is a programmable slide rail in the center of the test frame, on which a test camera is installed. There are four target landing points A, B, C, and D on the programmable slide rail. Screens A-1 to be tested, screen A-2 to be tested, screen A-3 to be tested, and screen A-4 to be tested correspond to target landing point A. The camera to be tested takes a photo at target landing point A to calibrate the preset calibration area, length, and width of the above four screens to be tested.
[0042] The black screen abnormality detection method proposed in this embodiment sets different target landing points for different screens to be tested, so that one camera can meet the measurement requirements of different screens to be tested, saving a large number of detection cameras in the execution of the test, thereby saving the cost of the test. This embodiment can also realize the automatic detection of the screen to be tested, extract the complete image of the screen, and output the result of the screen detection.
[0043] In this embodiment, a black screen abnormality detection method is provided. Figure 3 is a flow chart of a black screen abnormality detection method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0044] Step S201: Receive a detection request, which includes the target landing point corresponding to the screen to be tested. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0045] Step S202: Move the detection camera to the target landing point corresponding to the screen to be tested, and take a picture of the screen to be tested by the detection camera to obtain a regional image. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0046] Step S203: extracting a screen image from the region image.
[0047] Specifically, the above step S203 includes:
[0048] Step S2031, binarization processing is performed on the region image to obtain a grayscale image of the region image.
[0049] In an optional embodiment, in order to facilitate subsequent feature extraction, the regional image is first binarized, and the color image is converted into a black and white image to obtain a grayscale photo of the regional image. Since the screen is bright and luminous, and the surrounding detection frame is not bright, the screen can be distinguished from the surrounding environment. According to experience, the threshold of the binarization process is generally set to 150, that is, the grayscale values between 151-255 are set to 1, and the grayscale values between 0-150 are set to 0.
[0050] Step S2032: extracting the area to be identified corresponding to the preset calibration area of the screen to be tested in the grayscale image.
[0051] In an optional embodiment, different screens correspond to different preset calibration areas.
[0052] In an optional embodiment, after obtaining the grayscale image, an area to be identified corresponding to a preset calibration area for initial calibration of the screen to be tested is extracted from the grayscale image. This step can determine whether the screen is offset. If the preset calibration area is the same as the area to be identified, it proves that the screen has not moved; otherwise, the screen has moved.
[0053] Step S2033: Use an edge detection algorithm to determine the edge position in the area to be identified.
[0054] In an optional embodiment, in the area to be identified, the Canny edge detection algorithm is used to find the position where the grayscale intensity changes most strongly in the area to be identified, so that all edges of the screen to be detected can be found.
[0055] Step S2034, using Hough transform to determine the straight line in the area to be identified, and determining the largest rectangle in the area to be identified based on the straight line and the edge position.
[0056] In an optional embodiment, in the area to be identified, Hough transform is used to determine the straight lines in the area to be identified, and combined with the edge of the screen to be tested found in step S2033, it is confirmed whether the screen to be tested has shifted: when no shift occurs, all edges of the screen to be tested coincide with the identified straight lines to obtain a maximum rectangle in the area to be identified; when a shift occurs, three edges or two edges of the screen to be tested are found in the area to be identified, and combined with the border straight lines of the area to be identified itself, a maximum rectangle in the area to be identified is formed.
[0057] Step S2035: If the area of the largest rectangle is the same as the area of the preset calibration area, the largest rectangle is determined as the screen image.
[0058] In an optional embodiment, after the largest rectangle is found in step S2034, the area of the largest rectangle is compared with the area of the preset calibration area. When the areas of the two are the same, the largest rectangle is the screen image.
[0059] Step S2036, if the area of the largest rectangle is different from the area of the preset calibration area, adjust the starting point coordinates of the preset calibration area, determine the adjusted preset calibration area according to the adjusted starting point coordinates, and return to step S2032.
[0060] In an optional embodiment, the area of the largest rectangle is compared with the area of the preset calibration area. When the areas of the two are different, that is, the largest rectangle is smaller than the preset calibration area, it is determined that the screen to be tested is offset. The present invention selects an automatic adjustment method. Since the detection frame does not have the adjustment capability, the preset calibration area is adjusted. The length and width of the preset calibration area are kept unchanged, and the coordinates of its starting point are moved until the coordinates of the starting point reach a certain position, and the preset calibration area and the largest rectangle in the area to be identified have the same area, and the screen position is determined.
[0061] Step S204: Detect the screen image to obtain the detection result of the screen to be tested. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0062] The black screen abnormality detection method proposed in this embodiment uses binarization processing to obtain a grayscale image, finds the area to be identified corresponding to the preset calibration area, and then confirms the position of the screen in the area to be identified through an edge detection algorithm and a straight line. Since the size of the area to be identified in the initial setting is consistent with the size of the screen, it can be determined whether the screen is offset. After the preset calibration area is set in this method, it is no longer necessary to detect the size of the screen to be tested in subsequent detections, and the offset detection of the screen to be tested can be performed directly.
[0063] In an optional embodiment, the step of adjusting the starting point of the preset calibration area includes:
[0064] The coordinates of the starting point are moved by one pixel along the first direction on the X-axis, and an adjusted preset calibration area is determined according to the adjusted coordinates of the starting point; and a maximum rectangle in the adjusted area to be identified is determined.
[0065] In an optional embodiment, after detecting that the screen to be tested is offset, the coordinates of the starting point of the preset calibration area are moved so that the screen to be tested is in the preset calibration area. In the detection photo, the coordinates of the starting point are moved by one pixel in any direction on the X-axis, and then the maximum rectangular difference before and after the movement is checked to determine the direction of the offset of the screen to be tested.
[0066] If the adjusted maximum rectangle in the area to be identified is larger than the maximum rectangle in the area to be identified before adjustment, continue to move the coordinates of the starting point along the first direction until the adjusted maximum rectangle in the area to be identified is smaller than the maximum rectangle in the area to be identified after the last adjustment, and determine the last adjusted position as the adjusted first coordinate value.
[0067] In an optional embodiment, after the starting point coordinates of the preset calibration area are moved one pixel in the first direction on the X-axis, the largest rectangle in the area to be identified is extracted. When the adjusted largest rectangle is larger than the largest rectangle before the adjustment, the screen to be tested is closer to the calibration area after adjustment, proving that the adjustment in this direction is correct, and the starting point coordinates of the preset calibration area can continue to be shifted in this direction; however, this displacement is not unlimited, until a certain position, the largest rectangle in the area to be identified is the largest, which is the final position of the starting point coordinates on the X-axis.
[0068] If the adjusted maximum rectangle in the area to be identified is smaller than the maximum rectangle in the area to be identified before the adjustment, move the coordinates of the starting point along the second direction until the adjusted maximum rectangle in the area to be identified is smaller than the maximum rectangle in the area to be identified after the last adjustment, and determine the last adjusted position as the adjusted first coordinate value.
[0069] In an optional embodiment, after the starting point coordinates of the preset calibration area are moved one pixel in the first direction for the first time, the largest rectangle in the area to be identified is extracted. The area of the rectangle tends to decrease, and it can be seen that the adjustment direction is wrong. The starting point coordinates of the preset calibration area are moved in a second direction opposite to the first direction until a certain position is reached, and the area of the largest rectangle in the area to be identified is the largest. This is the final position of the starting point coordinates on the X-axis.
[0070] The coordinates of the starting point are moved by one pixel along the third direction on the Y axis, and the adjusted preset calibration area is determined according to the adjusted coordinates of the starting point; and the largest rectangle in the adjusted area to be identified is determined.
[0071] In an optional embodiment, after the position of the starting point coordinates of the preset calibration area on the X axis is determined, the coordinates of the starting point coordinates on the Y axis need to be adjusted. Select any direction on the Y axis to move one pixel, and then check the maximum rectangular difference before and after the movement to determine the direction of the screen to be measured.
[0072] If the adjusted maximum rectangle in the area to be identified is larger than the maximum rectangle in the area to be identified before adjustment, continue to move the coordinates of the starting point along the third direction until the adjusted maximum rectangle in the area to be identified is smaller than the maximum rectangle in the area to be identified after the last adjustment, and determine the last adjusted position as the adjusted second coordinate value.
[0073] In an optional embodiment, after the starting point coordinates of the preset calibration area are adjusted to the corresponding position on the X-axis, the position on the Y-axis is selected for adjustment; after the starting point coordinates of the preset calibration area are moved one pixel in the third direction on the Y-axis, the largest rectangle in the area to be identified is extracted, and when the adjusted largest rectangle is larger than the largest rectangle before the adjustment, the screen to be tested is closer to the calibration area after adjustment, proving that the adjustment in this direction is correct, and the starting point coordinates of the preset calibration area can continue to be shifted in this direction; until at a certain position, the area of the largest rectangle in the area to be identified is the largest, which is the final position of the starting point coordinates on the Y-axis.
[0074] If the adjusted maximum rectangle in the area to be identified is smaller than the maximum rectangle in the area to be identified before adjustment, move the coordinates of the starting point along the fourth direction until the adjusted maximum rectangle in the area to be identified is smaller than the maximum rectangle in the area to be identified after the last adjustment, and determine the last adjusted position as the adjusted second coordinate value.
[0075] In an optional embodiment, after the starting point coordinates of the preset calibration area move one pixel in the third direction for the first time, the largest rectangle in the area to be identified is extracted, and the area of the rectangle tends to decrease, proving that the adjustment direction is wrong. The starting point coordinates of the preset calibration area are moved in a fourth direction opposite to the third direction until a certain position is reached, where the area of the largest rectangle in the area to be identified is the largest. This is the final position of the starting point coordinates on the Y-axis.
[0076] The black screen anomaly detection method proposed in this embodiment, when the screen to be tested is determined to be offset, automatically adjusts the starting point coordinates of the preset calibration area through a correction algorithm, thereby reducing the need for repeated calibration and saving human resource costs.
[0077] In this embodiment, a black screen abnormality detection method is provided. Figure 4 is a flow chart of a black screen abnormality detection method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0078] Step S401: Receive a detection request, which includes the target landing point corresponding to the screen to be tested. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0079] Step S402: Move the detection camera to the target landing point corresponding to the screen to be tested, and take a picture of the screen to be tested by the detection camera to obtain a regional image. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0080] Step S403: extract the screen image from the region image. Figure 1Step S103 of the illustrated embodiment will not be described in detail here.
[0081] Step S404, detecting the screen image to obtain the detection result of the screen to be tested.
[0082] Specifically, the above step S404 includes:
[0083] Step S4041, pre-processing the screen image in grayscale to obtain a grayscale image.
[0084] In an optional embodiment, the screen image of the screen to be tested is gray-scale processed to obtain a gray-scale image. The detection method here is the same as the gray-scale processing method involved in the above step S403.
[0085] Step S4042, calculating the grayscale extreme value difference of the grayscale image, if the grayscale extreme value difference is less than a preset threshold, then stopping the test and determining that the screen to be tested is abnormal;
[0086] In an optional embodiment, the grayscale extreme value difference of the grayscale image is calculated, and a preset threshold is set to 30. When the calculated grayscale extreme value difference value is less than the preset threshold, the screen color is identified as a solid color photo, the test is stopped, and the screen to be tested is determined to be abnormal; when the calculated grayscale extreme value difference value is greater than the preset threshold, the screen detection process continues.
[0087] In an optional embodiment, the above-mentioned pure color photo is not only black, but may also be displayed as a single color such as white, green, etc. on the screen.
[0088] Step S4043: if the grayscale extreme value difference is greater than a preset threshold, binarization is performed on the grayscale image according to the binarization threshold, and the grayscale value of the grayscale image is divided into a first value and a second value.
[0089] In an optional embodiment, after calculating the grayscale extreme value difference and confirming that the screen is not a pure color display, the grayscale image is binarized. This embodiment chooses to set a threshold of 150, converts grayscale values between 151-255 to first values, and converts grayscale values between 0-150 to second values; in this embodiment, the first value and the second value are 1 and 0, respectively.
[0090] Step S4044, counting a first proportion of pixels having a grayscale value of a first value in the screen image, and a second proportion of pixels having a grayscale value of a second value in the screen image.
[0091] If both the first proportion and the second proportion are greater than the preset value, the screen to be tested is determined to be normal; if the first proportion or the second proportion is less than the preset value, the screen to be tested is determined to be abnormal.
[0092] The black screen abnormality detection method proposed in this embodiment can realize pure color detection of the image by converting the captured image into a grayscale image and further calculating the grayscale extreme value difference; then the image is binarized to form a first value and a second value, and the ratio of the first value to the second value is compared to detect whether the screen color meets the detection requirements, thereby avoiding the first pure color detection from not being detected; through the two detection methods, the final screen detection result is guaranteed to be more reliable.
[0093] In this embodiment, a black screen abnormality detection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0094] This embodiment provides a black screen abnormality detection device, such as Figure 5 As shown, including:
[0095] The detection receiving module 1 is used to receive a detection request, wherein the detection request includes a target landing point corresponding to the screen to be detected; different screens are set at different positions and correspond to different landing points.
[0096] The camera detection module 2 is used to move the detection camera to the target landing point corresponding to the screen to be tested, and take a picture of the screen to be tested by the detection camera to obtain a regional image.
[0097] The image extraction module 3 is used to extract the screen image from the area image.
[0098] The image detection module 4 is used to detect the screen image and obtain the detection result of the screen to be tested.
[0099] In some optional implementations, the image extraction module 3 includes:
[0100] The image processing unit is used to perform binarization processing on the regional image to obtain a grayscale image of the regional image.
[0101] The to-be-recognized area extraction unit is used to extract the to-be-recognized area corresponding to the preset calibration area of the screen to be tested in the grayscale image.
[0102] The edge detection unit is used to determine the edge position in the area to be identified by using an edge detection algorithm.
[0103] The maximum rectangle determination unit is used to determine the straight line in the area to be identified by using Hough transform, and determine the maximum rectangle in the area to be identified according to the straight line and the edge position.
[0104] The coordinate adjustment unit is used to adjust the coordinates of the starting point of the preset calibration area, and determine the adjusted preset calibration area according to the adjusted starting point coordinates.
[0105] The screen determination unit is used to determine the largest rectangle as the screen image.
[0106] In some optional implementations, the image detection module 4 includes:
[0107] The image processing unit is used to perform grayscale preprocessing on the screen image to obtain a grayscale image.
[0108] The image calculation unit is used to calculate the grayscale extreme value difference of the grayscale image. If the grayscale extreme value difference is less than a preset threshold, the test is stopped and it is determined that the screen to be tested is abnormal.
[0109] The image binarization unit is used to perform binarization processing on the grayscale image according to a binarization threshold value, and distinguish the grayscale value of the grayscale image into a first value and a second value.
[0110] The image determination unit is used to count the ratio of the first value to the second value. If the ratio is greater than a preset value, the screen to be tested is determined to be normal; if the ratio does not exceed a threshold ratio, the screen to be tested is determined to be abnormal.
[0111] The black screen abnormality detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0112] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0113] The embodiment of the present invention also provides a computer device having the above Figure 5 The black screen abnormality detection device shown.
[0114] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0115] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0116] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0117] The memory 20 may 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; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0118] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0119] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0120] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0121] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A black screen abnormality detection method, characterized in that: include: Receiving a detection request, wherein the detection request includes a target landing point corresponding to the screen to be detected; Different screens are set in different positions, corresponding to different footholds; Moving the detection camera to the target landing point corresponding to the screen to be tested, taking a picture of the screen to be tested by the detection camera to obtain a regional image; extracting a screen image from the area image; Detecting the screen image to obtain a detection result of the screen to be tested; The step of extracting a screen image from the area image comprises: Performing binarization processing on the region image to obtain a grayscale image of the region image; Extracting the area to be identified corresponding to the preset calibration area of the screen to be tested from the grayscale image, where different screens correspond to different preset calibration areas; Using an edge detection algorithm to determine the edge position of the to-be-identified area; Determine a straight line in the area to be identified by using Hough transform, and determine a maximum rectangle in the area to be identified according to the straight line and the edge position; If the area of the largest rectangle is the same as the area of the preset calibration area, determining the largest rectangle as the screen image; If the area of the largest rectangle is different from the area of the preset calibration area, adjusting the coordinates of the starting point of the preset calibration area, determining the adjusted preset calibration area according to the adjusted starting point coordinates, returning to the step of extracting the area to be identified corresponding to the preset calibration area of the screen to be tested in the grayscale image, until the area of the largest rectangle is the same as the area of the preset calibration area, and determining the largest rectangle as the screen image; If the area of the largest rectangle is different from the area of the preset calibration area, adjusting the coordinates of the starting point of the preset calibration area; The starting point coordinates include a first coordinate value and a second coordinate value, wherein the first coordinate value is the coordinate value of the starting point on the X-axis, and the second coordinate value is the coordinate value of the starting point on the Y-axis; Moving the starting point coordinates by one pixel along the first direction on the X-axis, and determining an adjusted preset calibration area according to the adjusted starting point coordinates; Determine the largest rectangle in the adjusted area to be identified; If the largest rectangle in the to-be-recognized area after adjustment is larger than the largest rectangle in the to-be-recognized area before adjustment, continue to move the coordinates of the starting point along the first direction until the largest rectangle in the to-be-recognized area after adjustment is smaller than the largest rectangle in the to-be-recognized area after the last adjustment, and determine the last adjusted position as the adjusted first coordinate value; Moving the starting point coordinates by one pixel along the third direction on the Y axis, and determining an adjusted preset calibration area according to the adjusted starting point coordinates; Determine the largest rectangle in the adjusted area to be identified; If the largest rectangle in the to-be-recognized area after adjustment is larger than the largest rectangle in the to-be-recognized area before adjustment, continue to move the coordinates of the starting point along the third direction until the largest rectangle in the to-be-recognized area after adjustment is smaller than the largest rectangle in the to-be-recognized area after the last adjustment, and determine the last adjusted position as the adjusted second coordinate value; Determine the adjusted starting point coordinates according to the adjusted first coordinate value and the adjusted second coordinate value; If the largest rectangle in the to-be-recognized area after adjustment along the first direction is smaller than the largest rectangle in the to-be-recognized area before adjustment, move the coordinates of the starting point along the second direction until the largest rectangle in the to-be-recognized area after adjustment is smaller than the largest rectangle in the to-be-recognized area after the last adjustment, and determine the position after the last adjustment as the adjusted first coordinate value; the first direction and the second direction are opposite; If the largest rectangle in the area to be identified after adjustment along the third direction is smaller than the largest rectangle in the area to be identified before adjustment, move the coordinates of the starting point along the fourth direction until the largest rectangle in the area to be identified after adjustment is smaller than the largest rectangle in the area to be identified after the last adjustment, determine the last adjusted position as the adjusted second coordinate value, and determine the largest rectangle in the area to be identified after the last adjustment as the screen image; the third direction is opposite to the fourth direction.
2. The method according to claim 1, characterized in that The step of detecting the screen image to obtain the detection result of the screen to be tested includes: Performing grayscale preprocessing on the screen image to obtain a grayscale image; Calculating the grayscale extreme value difference of the grayscale image, and if the grayscale extreme value difference is less than a preset threshold, stopping the test and determining that the screen to be tested is abnormal; If the grayscale extreme value difference is greater than a preset threshold, binarization is performed on the grayscale image according to the binarization threshold, and the grayscale value of the grayscale image is divided into a first value and a second value; Counting a first proportion of pixels having a first grayscale value in the screen image, and a second proportion of pixels having a second grayscale value in the screen image; If the first proportion and the second proportion are both greater than a preset value, it is determined that the screen to be tested is normal; If the first proportion or the second proportion is smaller than the preset value, it is determined that the screen to be tested is abnormal.
3. A black screen abnormality detection device, characterized in that: include: Detection receiving module: used to receive a detection request, wherein the detection request includes a target landing point corresponding to the screen to be tested; Different screens are set in different positions, corresponding to different footholds; Camera detection module: used for moving the detection camera to the target landing point corresponding to the screen to be tested, taking a picture of the screen to be tested by the detection camera, and obtaining a regional image; Image extraction module: used for extracting a screen image from the area image; Image detection module: used to detect the screen image and obtain the detection result of the screen to be tested; The step of extracting a screen image from the area image comprises: Performing binarization processing on the region image to obtain a grayscale image of the region image; Extracting the area to be identified corresponding to the preset calibration area of the screen to be tested from the grayscale image, where different screens correspond to different preset calibration areas; Using an edge detection algorithm to determine the edge position of the to-be-identified area; Determine a straight line in the area to be identified by using Hough transform, and determine a maximum rectangle in the area to be identified according to the straight line and the edge position; If the area of the largest rectangle is the same as the area of the preset calibration area, determining the largest rectangle as the screen image; If the area of the largest rectangle is different from the area of the preset calibration area, adjusting the coordinates of the starting point of the preset calibration area, determining the adjusted preset calibration area according to the adjusted starting point coordinates, returning to the step of extracting the area to be identified corresponding to the preset calibration area of the screen to be tested in the grayscale image, until the area of the largest rectangle is the same as the area of the preset calibration area, and determining the largest rectangle as the screen image; If the area of the largest rectangle is different from the area of the preset calibration area, adjusting the coordinates of the starting point of the preset calibration area; The starting point coordinates include a first coordinate value and a second coordinate value, wherein the first coordinate value is the coordinate value of the starting point on the X-axis, and the second coordinate value is the coordinate value of the starting point on the Y-axis; Moving the starting point coordinates by one pixel along the first direction on the X-axis, and determining an adjusted preset calibration area according to the adjusted starting point coordinates; Determine the largest rectangle in the adjusted area to be identified; If the largest rectangle in the to-be-recognized area after adjustment is larger than the largest rectangle in the to-be-recognized area before adjustment, continue to move the coordinates of the starting point along the first direction until the largest rectangle in the to-be-recognized area after adjustment is smaller than the largest rectangle in the to-be-recognized area after the last adjustment, and determine the last adjusted position as the adjusted first coordinate value; Moving the starting point coordinates by one pixel along the third direction on the Y axis, and determining an adjusted preset calibration area according to the adjusted starting point coordinates; Determine the largest rectangle in the adjusted area to be identified; If the largest rectangle in the to-be-recognized area after adjustment is larger than the largest rectangle in the to-be-recognized area before adjustment, continue to move the coordinates of the starting point along the third direction until the largest rectangle in the to-be-recognized area after adjustment is smaller than the largest rectangle in the to-be-recognized area after the last adjustment, and determine the last adjusted position as the adjusted second coordinate value; Determine the adjusted starting point coordinates according to the adjusted first coordinate value and the adjusted second coordinate value; If the largest rectangle in the to-be-recognized area after adjustment along the first direction is smaller than the largest rectangle in the to-be-recognized area before adjustment, move the coordinates of the starting point along the second direction until the largest rectangle in the to-be-recognized area after adjustment is smaller than the largest rectangle in the to-be-recognized area after the last adjustment, and determine the position after the last adjustment as the adjusted first coordinate value; the first direction and the second direction are opposite; If the largest rectangle in the area to be identified after adjustment along the third direction is smaller than the largest rectangle in the area to be identified before adjustment, move the coordinates of the starting point along the fourth direction until the largest rectangle in the area to be identified after adjustment is smaller than the largest rectangle in the area to be identified after the last adjustment, determine the last adjusted position as the adjusted second coordinate value, and determine the largest rectangle in the area to be identified after the last adjustment as the screen image; the third direction is opposite to the fourth direction.
4. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the black screen abnormality detection method according to claim 1 or 2 by executing the computer instructions.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the black screen abnormality detection method described in claim 1 or 2.
