A door and window detection method and system based on image recognition

By setting a light strip on one side of the door and window and recording its motion video, image recognition technology is used to detect the optical properties of the door and window glass, which solves the inefficient detection problem caused by relying on manual labor in the existing technology and achieves fast and automated detection results.

CN118365594BActive Publication Date: 2025-01-21QINGDAO TANFENG INTELLIGENT TECH ENG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410392416.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-02
Publication Date
2025-01-21
Estimated Expiration
2044-04-02

Smart Images

  • Figure CN118365594B_ABST
    Figure CN118365594B_ABST
Patent Text Reader

Abstract

The present invention relates to a door and window detection method and system based on image recognition, which is performed by setting a vertical light band on one side of the door and window to be detected, and then allowing the light band to move from one side to another opposite side, and recording the process through video. The edge of the light band is extracted from the video, and the edge of the light band is matched with a reference line. When the edge of the light band matches the reference line, it means that the light passes through the door and window glass without distortion and passes the detection. Otherwise, it means that there is an abnormality. Then, a reflective image is collected at the abnormal position, and the edge of the light band of the reflective image is matched with the reference line, so as to determine which side of the door and window has the abnormality. The present application can quickly detect the optical properties of the door and window glass through image recognition, thereby improving the detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of door and window detection, and in particular to a door and window detection method and system based on image recognition. Background Art

[0002] As people's living standards improve, the requirements for daylighting in residential buildings also increase, so more and more glass doors and windows are used in buildings.

[0003] Glass doors and windows need to be tested before leaving the factory. The main test contents include the physical property test and optical property test of glass. For optical property test, such as surface flatness, light transmittance, etc., the existing test methods mainly use manual and related instruments for test. Although the optical properties of door and window glass can be effectively tested, it relies on manual use of instruments and the test efficiency is low. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a door and window detection method and system based on image recognition, so as to solve the problem that door and window detection in the prior art relies on manual labor and has low detection efficiency.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A door and window detection method based on image recognition of the present invention comprises the following steps:

[0007] Acquire a first motion video of a light band arranged on the other side of the door and window glass to be detected from one side of the door and window glass to be detected, wherein the light band moves from one side edge of the door and window glass to be detected to another opposite side edge;

[0008] Parsing the first motion video onto a time axis, determining reference line positions of a plurality of image frames in the first motion video according to the motion speed of the light band and the time axis, and setting a reference line in the image frame based on the reference line position, wherein the reference line is a reference position of an edge of the light band;

[0009] Extracting a first light band edge in the image frame, and matching the first light band edge with the reference line;

[0010] When the edge of the light band matches the reference line, the door and window glass to be detected is detected; when the edge of the light band does not match the reference line, the abnormal position of the door and window glass to be detected is determined based on the first light band edge and the reference line;

[0011] Acquire the reflected light images on both sides of the abnormal position, wherein the reflected light images are respectively collected when the light bands located on both sides of the door and window glass to be detected are turned on;

[0012] The edge of the second light band in the reflected light image is extracted, the edge of the second light band is matched with the reference line, and the abnormal point of the door and window glass to be detected is determined based on the matching result.

[0013] In one embodiment of the present application, it also includes:

[0014] Obtain the incident light intensity i of the light band, and obtain the transmitted light intensity i′ on one side of the door and window glass to be detected;

[0015] The light transmittance T of the door and window glass to be inspected is calculated based on the incident light intensity i and the transmitted light intensity i′, where T=(i′ / i)×100%.

[0016] In one embodiment of the present application, it also includes:

[0017] Obtain the incident light intensity i of the light band, and obtain the reflected light intensity i″ on both sides of the door and window glass to be detected;

[0018] The reflectivity R of the door and window glass to be inspected is calculated based on the incident light intensity i and the reflected light intensity i″, where R=(i″ / i)×100%.

[0019] In an embodiment of the present application, determining the reference line positions of the plurality of image frames in the first motion video according to the motion speed of the light band and the time axis includes:

[0020] The first image frame in which the light band edge appears among the multiple image frames is used as a reference frame, and a reference line X=L is marked at the light band edge of the reference frame, so that the reference line X=L coincides with the light band edge of the reference frame;

[0021] The reference line positions of multiple image frames after the reference frame are determined, and the reference line position is X=L+v×t, wherein v is the movement speed of the light band, t is the time difference between the image frame and the reference frame, and the movement speed of the light band is preset.

[0022] In an embodiment of the present application, matching the first light band edge with the reference line includes:

[0023] Determine the two-dimensional coordinates (x n ,y n );

[0024] Calculate the X-direction difference D between each pixel and the reference line n , D n =x n -L+v×t, and calculate multiple differences D n The variance S 2 ;

[0025] The variance S 2The variance S is compared with the preset variance threshold. 2 When the variance is less than or equal to a preset variance threshold, it is determined that the edge of the first light band matches the reference line; otherwise, it is determined that the edge of the first light band does not match the reference line.

[0026] In one embodiment of the present application, determining the abnormal position of the door and window glass to be detected based on the edge of the first light band and the reference line includes:

[0027] Based on multiple difference values ​​D n Construct difference sequence;

[0028] Determine the mutation point of the difference sequence and calculate the difference D′ of the mutation point n The corresponding coordinate point (x′) on the edge of the first light band n , y′ n ) as the abnormal position of the door and window glass to be detected.

[0029] In one embodiment of the present application, obtaining the reflected light images on both sides of the abnormal position includes:

[0030] Turn off the light strip on one side of the door and window glass to be inspected, turn on the light strip on the other side of the door and window glass to be inspected, adjust the position of the light strip so that the edge of the light strip coincides with the abnormal position, and collect the reflected light image on the other side of the door and window glass to be inspected;

[0031] The light band on the other side of the door and window glass to be inspected is turned off, and the light band on one side of the door and window glass to be inspected is turned on, the position of the light band is adjusted so that the edge of the light band coincides with the abnormal position, and the reflected image of one side of the door and window glass to be inspected is collected.

[0032] In one embodiment of the present application, the edge of the second light band is matched with the reference line.

[0033] Determine the two-dimensional coordinates (x m ,y m );

[0034] Calculate the X-direction difference D between each pixel and the reference line m , D m =x m -L+v×t, and calculate multiple differences D m The variance S′ 2 ;

[0035] The variance S′ 2 Compared with the preset variance threshold, the variance S′ 2When the variance is less than or equal to a preset variance threshold, it is determined that the edge of the second light band matches the reference line; otherwise, it is determined that the edge of the second light band does not match the reference line.

[0036] In one embodiment of the present application, determining the abnormal point of the door and window glass to be detected based on the matching result includes:

[0037] When the edge of the second light band located on one side of the abnormal position does not match the reference line, it is determined that the abnormal point is located on one side of the abnormal position; when the edge of the second light band located on the other side of the abnormal position does not match the reference line, it is determined that the abnormal point is located on the other side of the abnormal position.

[0038] The present application also provides a door and window detection system based on image recognition, comprising:

[0039] A first acquisition module is used to acquire, from one side of the door and window glass to be detected, a first motion video of a light band arranged on the other side of the door and window glass to be detected, wherein the light band moves from one side edge of the door and window glass to be detected to another opposite side edge;

[0040] A reference module, used to parse the first motion video onto a time axis, determine reference line positions of a plurality of image frames in the first motion video according to the motion speed of the light band and the time axis, and set a reference line in the image frame based on the reference line position, wherein the reference line is a reference position of an edge of the light band;

[0041] A matching module, used for extracting a first light band edge in the image frame, and matching the first light band edge with the reference line;

[0042] A first detection module, configured to detect the door and window glass to be detected when the edge of the light band matches the reference line; and to determine the abnormal position of the door and window glass to be detected based on the first light band edge and the reference line when the edge of the light band does not match the reference line;

[0043] A second acquisition module is used to acquire the reflected images on both sides of the abnormal position, and the reflected images are respectively acquired when the light bands located on both sides of the door and window glass to be detected are turned on;

[0044] The second detection module is used to extract the edge of the second light band in the reflected image, match the edge of the second light band with the reference line, and determine the abnormal point of the door and window glass to be detected based on the matching result.

[0045] The present invention also provides a storage medium storing a computer program, wherein the computer program, when loaded and executed by a processor, implements the above-mentioned door and window detection method based on image recognition.

[0046] The present invention also provides an electronic device, comprising: a processor and a memory; wherein the memory is used to store a computer program; the processor is used to load and execute the computer program so that the electronic device executes the above-mentioned door and window detection method based on image recognition.

[0047] The beneficial effects of the present invention are as follows: a door and window detection method and system based on image recognition of the present invention, by setting a vertical light band on one side of the door and window to be detected, and then allowing the light band to move from one side to another opposite side, and recording the process through video. The edge of the light band is extracted from the video, and the edge of the light band is matched with the reference line. When the edge of the light band matches the reference line, it means that there is no distortion of light passing through the door and window glass, and the detection is passed. Otherwise, it means that there is an abnormality. Then, a reflective image is collected at the abnormal position, and the edge of the light band of the reflective image is matched with the reference line, so as to determine which side of the door and window has the abnormality. Through image recognition, the present application can quickly detect the optical properties of door and window glass, thereby improving the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0049] Figure 1 is an application scenario diagram of a door and window detection method based on image recognition shown in an embodiment of the present application;

[0050] Figure 2 is a flow chart of a door and window detection method based on image recognition shown in an embodiment of the present application;

[0051] Figure 3 is a schematic diagram of a light band and a reference line in a frame image in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of an abnormal position in an embodiment of the present application;

[0053] Figure 5 is a structural diagram of a door and window detection system based on image recognition shown in an embodiment of the present application;

[0054] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0055] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0056] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show the layers related to the present invention rather than being drawn according to the number, shape and size of the layers in actual implementation. In actual implementation, the type, quantity and proportion of each layer may be changed arbitrarily, and the layer layout may also be more complicated.

[0057] In the following description, numerous details are discussed to provide a more thorough explanation of embodiments of the present invention; however, it is apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details.

[0058] Figure 1 is an application scenario diagram of a door and window detection method based on image recognition shown in an embodiment of the present application, such as Figure 1 As shown, the door and window 110 to be inspected is fixed on the fixture 120. Brackets 130 are respectively arranged on both sides of the door and window 110 to be inspected, and vertical light strips 140, cameras 150 and light intensity sensors are arranged on the brackets 130; the brackets 130 are located on the slide rails 160 arranged on the bottom surface, and the brackets 130 can move along the slide rails 160 under the drive of the motor and the lead screw nut mechanism. The motor is driven by a reduction gear to increase the control accuracy. The light strip 140, the camera 150 and the light intensity sensor are connected to the industrial control host to realize automatic control.

[0059] The present application includes a light transmission detection part and a light reflection detection part. During light transmission detection, the light strip 140 on one side is turned off and the camera is turned on, and the light strip 140 on the other side is turned on, but the camera 150 is turned off. During light reflection detection, the light strip 140 and the camera 150 on the same side are turned on.

[0060] Figure 2 is a flow chart of a door and window detection method based on image recognition shown in an embodiment of the present application, such as Figure 2 As shown: A door and window detection method based on image recognition in this embodiment may include steps S210 to S260:

[0061] S210, acquiring a first motion video of a light band arranged on the other side of the door and window glass to be detected from one side of the door and window glass to be detected, wherein the light band moves from one side edge of the door and window glass to be detected to another opposite side edge;

[0062] When performing perspective inspection, turn on the light strip on the other side of the door and window glass to be inspected to generate a light strip. At the same time, control the movement of the bracket at a speed v, so that the light strip moves from one side of the door and window glass to be inspected to the other opposite side. The camera located on one side of the door and window glass to be inspected can then capture the motion video of the light strip.

[0063] S220, parsing the first motion video onto a time axis, determining reference line positions of a plurality of image frames in the first motion video according to a motion speed of the light band and the time axis, and setting a reference line in the image frame based on the reference line position, wherein the reference line is a reference position of an edge of the light band;

[0064] The camera in this application uses 60FPS, so the first motion video collected contains 60 frames per second. After parsing on the time axis, multiple frames of images can be obtained. For ease of processing, this application also simplifies the image frames, and only 10 frames per second of video are retained to evenly distribute images on the time axis. Then, frame-by-frame analysis is performed.

[0065] When performing frame-by-frame analysis, this application requires the use of reference lines for assistance. When the light band moves at a speed v, the position of the light band in each frame of the image can be calculated, where the reference line position is the theoretical position of the edge of the light band. Therefore, the reference line is calibrated in each frame of the image, and then by comparing the edge of the light band with the reference line, it can be determined whether the light is distorted when passing through the door and window glass.

[0066] Figure 3 FIG. 1 is a schematic diagram of a light band and a reference line in a frame image in an embodiment of the present application. Figure 3 As shown, in this embodiment, the reference line is calibrated through the following process:

[0067] S221, taking the first image frame in which the light band edge appears among the multiple image frames as a reference frame, and marking a reference line X=L at the light band edge of the reference frame, so that the reference line X=L coincides with the light band edge of the reference frame;

[0068] Since many image frames were deleted in the previous process to reduce the amount of calculation, the reference frame may be at a certain distance L from the edge of the image. Therefore, the reference line of the reference frame is X=L. When calibrating the reference line of the reference frame, the reference line is brought close to the edge of the light band, and the reference line is fixed when the most pixel points coincide with the reference line.

[0069] S222, determining the reference line position of multiple image frames after the reference frame, the reference line position is X=L+v×t, wherein v is the movement speed of the light band, t is the time difference between the image frame and the reference frame, and the movement speed of the light band is preset.

[0070] The time difference between any two adjacent image frames is fixed, and the movement speed of the light band is also fixed, so the position of the reference line can be directly calculated.

[0071] It is worth noting that, since there is a certain proportional relationship between the distance in the video image and the calculated distance, before calibration, the above ratio can be obtained through testing, so as to perform calibration in the image.

[0072] As an alternative, the present application can also take a subsequent image frame, calculate the distance of the light band edge between the reference frame and the subsequent image frame, and then evenly divide the distance based on the number of image frames between the reference frame and the subsequent image frame, so as to determine the distance of the light band edge between adjacent image frames for calibration.

[0073] S230, extracting a first light band edge in the image frame, and matching the first light band edge with the reference line;

[0074] In the present application, the first light band edge may be extracted by using an edge extraction operator, such as a canny operator.

[0075] This embodiment adopts a method of position difference matching to determine whether there is distortion at the edge of the first light band. The specific process includes:

[0076] S231, determine the two-dimensional coordinates (x n ,y n );

[0077] The origin of the two-dimensional coordinate is the lower left corner of the image, the horizontal coordinate is the X axis, and the vertical coordinate is the Y axis. By counting the number of pixels, the two-dimensional coordinate (x n ,y n ).

[0078] S232, calculating the difference D in the X direction between each pixel point and the reference line n , D n =x n -L+v×t, and calculate multiple differences D n The variance S 2 ;

[0079] Since the reference line calibrated in the previous article is the position of the light band under ideal conditions, assuming that the light band moves at a constant speed. However, in the actual process, the edge of the light band may not coincide with the position of the reference line. Therefore, this application directly calculates the difference to obtain the distance difference D between each pixel and the corresponding reference line. n , and use the distance difference D n To determine the shape of the light band edge.

[0080] This application calculates the distance difference D n The variance S 2 To multiple distance difference D n The uniformity is determined by the variance S 2 The smaller it is, the more distance differences D n The more uniform, the closer the edge of the light band is to a straight line. Otherwise, it means that there may be distortion at the edge of the light band.

[0081] S233, the variance S 2 The variance S is compared with the preset variance threshold. 2 When the variance is less than or equal to a preset variance threshold, it is determined that the edge of the first light band matches the reference line; otherwise, it is determined that the edge of the first light band does not match the reference line.

[0082] This application sets the variance threshold to the variance S 2 Filtering is performed at the variance S 2 When the variance is greater than a preset threshold, it is determined that the edge of the first light band is distorted, that is, it does not match the reference line.

[0083] S240, when the edge of the light band matches the reference line, detecting the door and window glass to be detected; when the edge of the light band does not match the reference line, determining the abnormal position of the door and window glass to be detected based on the first light band edge and the reference line;

[0084] In most cases, the glass door and window can be tested at this step. However, if there is distortion at the edge of the first light band, the subsequent distortion position detection is performed.

[0085] In the present application, there are three situations of abnormalities in glass doors and windows: the abnormal position is located on the surface of one side of the door and window glass to be detected, the abnormal position is located on the surface of the other side of the door and window glass to be detected, and the abnormal position is located inside the door and window glass to be detected.

[0086] This application first preliminarily determines which position causes the light transmission distortion, and then determines the specific point.

[0087] Figure 4 is a schematic diagram of an abnormal position in an embodiment of the present application, and the abnormal position obtained is as follows Figure 4 shown.

[0088] Specifically, determining the abnormal position of the door and window glass to be detected based on the first light band edge and the reference line includes:

[0089] S241, based on multiple difference values ​​D n Construct difference sequence;

[0090] S242, determine the mutation point of the difference sequence, and calculate the difference D' of the mutation point n The corresponding coordinate point (x' n , y' n ) as the abnormal position of the door and window glass to be detected.

[0091] The mutation point of the difference sequence can be determined by calculating the gradient. The mutation point can be one or more. In the present application, the light passes through the corresponding position of the door and window glass, causing the light propagation direction to change, thereby causing the edge distortion of the light band in the image. Therefore, by calculating the mutation point, the abnormal position of the door and window glass to be detected can be obtained.

[0092] S250, acquiring reflected images on both sides of the abnormal position, wherein the reflected images are respectively acquired when light bands located on both sides of the door and window glass to be inspected are turned on;

[0093] The above process determines the abnormal location, but the specific location needs further judgment. Therefore, the reflection detection stage is entered.

[0094] The main principle of reflective detection is to use the reflection of light on the glass surface. If there are tiny bumps, pits or other defects on the glass surface, the edge of the light band formed by the reflection will be distorted.

[0095] The process of collecting the reflected light image using the detection device in this application includes:

[0096] S251, turning off the light band on one side of the door and window glass to be inspected, turning on the light band on the other side of the door and window glass to be inspected, adjusting the position of the light band so that the edge of the light band coincides with the abnormal position, and collecting a reflected image on the other side of the door and window glass to be inspected;

[0097] S252, turning off the light band on the other side of the door and window glass to be inspected, and turning on the light band on one side of the door and window glass to be inspected, adjusting the position of the light band so that the edge of the light band coincides with the abnormal position, and collecting the reflected image of one side of the door and window glass to be inspected.

[0098] In this application, the light strip and camera on one side of the door and window glass to be detected are first turned off, and a relatively dark detection environment is maintained. This is to reduce the light transmission from one side of the door and window glass to be detected to the other side. Then the light strip and camera on the other side of the door and window glass to be detected are turned off, and the light strip and camera are moved to the abnormal position so that the edge of the light strip captured by the camera coincides with the abnormal position, thereby obtaining the reflected image on the other side. The reflected image on one side of the door and window glass to be detected is also collected according to the above process.

[0099] S260, extracting a second light band edge in the reflective image, matching the second light band edge with the reference line, and determining an abnormal point of the door and window glass to be detected based on the matching result.

[0100] The matching method of the reflective image is the same as that of the transparent detection part, including:

[0101] S261, determine the two-dimensional coordinates (x m ,y m );

[0102] S262, calculating the difference D in the X direction between each pixel point and the reference line m , D m =x m -L+v×t, and calculate multiple differences D m The variance S′ 2 ;

[0103] S263, the variance S′ 2 Compared with the preset variance threshold, the variance S′ 2 When the variance is less than or equal to a preset variance threshold, it is determined that the edge of the second light band matches the reference line; otherwise, it is determined that the edge of the second light band does not match the reference line.

[0104] Similarly, the horizontal coordinate of each pixel point in the edge of the second light band is subtracted from the corresponding reference line (the reference line here can be directly obtained from the image frame of the corresponding position in the motion video), and then the variance is calculated to determine whether there is distortion. If there is, it means that the abnormal point is on this side. If not, the reflection image on the next side is matched.

[0105] When the edge of the second light band located on one side of the abnormal position does not match the reference line, it is determined that the abnormal point is located on one side of the abnormal position; when the edge of the second light band located on the other side of the abnormal position does not match the reference line, it is determined that the abnormal point is located on the other side of the abnormal position.

[0106] In addition, when the reflected images on both sides do not match the reference line, it means that there are abnormal points on both sides. When the reflected images on both sides match the reference line, it means that the abnormal point is inside the glass, and there may be defects such as bubbles and impurities.

[0107] Finally, in the industrial control host, the abnormal points are marked with anchor frames to help staff quickly find the locations of the abnormal points.

[0108] In the above process, the transmitted light image and the reflected light image are collected in the light transmission detection stage and the light reflection detection stage respectively. In this process, the light transmittance detection and the light reflection detection can also be performed. The specific process is as follows:

[0109] In one embodiment of the present application, it also includes:

[0110] Obtain the incident light intensity i of the light band, and obtain the transmitted light intensity i′ on one side of the door and window glass to be detected;

[0111] The light transmittance T of the door and window glass to be inspected is calculated based on the incident light intensity i and the transmitted light intensity i′, where T=(i′ / i)×100%.

[0112] In one embodiment of the present application, it also includes:

[0113] Obtain the incident light intensity i of the light band, and obtain the reflected light intensity i″ on both sides of the door and window glass to be detected;

[0114] The reflectivity R of the door and window glass to be inspected is calculated based on the incident light intensity i and the reflected light intensity i", where R = (i" / i) x 100%.

[0115] The present application can efficiently detect the optical properties of door and window glass, and plays a positive and important role in controlling the quality of door and window glass before it leaves the factory.

[0116] The present invention provides a door and window detection method based on image recognition, which is performed by setting a vertical light band on one side of the door and window to be detected, and then allowing the light band to move from one side to another opposite side, and recording the process through video. The edge of the light band is extracted from the video, and the edge of the light band is matched with the reference line. When the edge of the light band matches the reference line, it means that the light passes through the door and window glass without distortion and passes the detection. Otherwise, it means that there is an abnormality. Then, a reflective image is collected at the abnormal position, and the edge of the light band of the reflective image is matched with the reference line, so as to determine which side of the door and window has the abnormality. The present application can quickly detect the optical properties of the door and window glass through image recognition, thereby improving the detection efficiency.

[0117] like Figure 5 As shown, the present application also provides a door and window detection system based on image recognition, comprising:

[0118] A first acquisition module is used to acquire, from one side of the door and window glass to be detected, a first motion video of a light band arranged on the other side of the door and window glass to be detected, wherein the light band moves from one side edge of the door and window glass to be detected to another opposite side edge;

[0119] A reference module, used to parse the first motion video onto a time axis, determine reference line positions of a plurality of image frames in the first motion video according to the motion speed of the light band and the time axis, and set a reference line in the image frame based on the reference line position, wherein the reference line is a reference position of an edge of the light band;

[0120] A matching module, used for extracting a first light band edge in the image frame, and matching the first light band edge with the reference line;

[0121] A first detection module, configured to detect the door and window glass to be detected when the edge of the light band matches the reference line; and to determine the abnormal position of the door and window glass to be detected based on the first light band edge and the reference line when the edge of the light band does not match the reference line;

[0122] A second acquisition module is used to acquire the reflected images on both sides of the abnormal position, and the reflected images are respectively acquired when the light bands located on both sides of the door and window glass to be detected are turned on;

[0123] The second detection module is used to extract the edge of the second light band in the reflective image, match the edge of the second light band with the reference line, and determine the abnormal point of the door and window glass to be detected based on the matching result.

[0124] The present invention provides a door and window detection system based on image recognition, which sets a vertical light strip on one side of the door and window to be detected, and then allows the light strip to move from one side to another opposite side, and records the process through video. The edge of the light strip is extracted from the video, and the edge of the light strip is matched with a reference line. When the edge of the light strip matches the reference line, it indicates that the light passes through the door and window glass without distortion and passes the detection. Otherwise, it indicates that an abnormality exists. Then, a reflective image is collected at the abnormal position, and the edge of the light strip of the reflective image is matched with the reference line, so as to determine which side of the door and window has the abnormality. The present application can quickly detect the optical properties of the door and window glass through image recognition, thereby improving the detection efficiency.

[0125] Figure 6 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0126] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603, such as executing the method in the above embodiment. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0127] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0128] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.

[0129] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0130] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0131] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0132] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the above method. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0133] Another aspect of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the air target pollutant component forecast model training and forecasting method provided in each of the above embodiments.

[0134] The above embodiments are only preferred embodiments for fully illustrating the present application, and the protection scope of the present application is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present application is within the protection scope of the present application.

Claims

1. A door and window detection method based on image recognition, characterized in that: Includes steps: Acquire a first motion video of a light band arranged on the other side of the door and window glass to be detected from one side of the door and window glass to be detected, wherein the light band moves from one side edge of the door and window glass to be detected to another opposite side edge; Parsing the first motion video onto a time axis, determining reference line positions of a plurality of image frames in the first motion video according to the motion speed of the light band and the time axis, and setting a reference line in the image frame based on the reference line position, wherein the reference line is a reference position of an edge of the light band; Extracting a first light band edge in the image frame, and matching the first light band edge with the reference line; When the edge of the first light band matches the reference line, the door and window glass to be detected is detected; when the edge of the first light band does not match the reference line, the abnormal position of the door and window glass to be detected is determined based on the edge of the first light band and the reference line; Acquire the reflected light images on both sides of the abnormal position, wherein the reflected light images are respectively collected when the light bands located on both sides of the door and window glass to be detected are turned on; The edge of the second light band in the reflected light image is extracted, the edge of the second light band is matched with the reference line, and the abnormal point of the door and window glass to be detected is determined based on the matching result.

2. According to the method for door and window detection based on image recognition in claim 1, it is characterized in that: Also includes: Get the incident light intensity of the light band , and obtain the transmitted light intensity on one side of the door and window glass to be detected ; Based on the incident light intensity and the transmitted light intensity Calculate the light transmittance of the door and window glass to be tested , .

3. According to the method for door and window detection based on image recognition in claim 1, it is characterized in that: Also includes: Get the incident light intensity of the light band , and obtain the reflected light intensity on both sides of the door and window glass to be detected ; Based on the incident light intensity and the reflected light intensity Calculate the reflectivity of the door and window glass to be tested , .

4. According to the method for door and window detection based on image recognition in claim 1, it is characterized in that: Determining reference line positions of a plurality of image frames in the first motion video according to the motion speed of the light band and the time axis includes: The first image frame in which the light band edge appears among multiple image frames is taken as the reference frame, and the reference line The edge of the light band in the reference frame is marked so that the reference line Coincident with the edge of the light band of the reference frame; Determine the reference line position of multiple image frames after the reference frame, the reference line position is ,in, is the speed of the light band, The time difference between the image frame and the reference frame, the moving speed of the light strip is preset.

5. The door and window detection method based on image recognition according to claim 4 is characterized in that: Matching the first light band edge with the reference line comprises: Determine the two-dimensional coordinates of each pixel point in the edge of the first light band ; Calculate the distance between each pixel and the reference line Direction Difference , , and calculate multiple differences Variance ; The variance The variance is compared with the preset threshold. When the variance is less than or equal to a preset variance threshold, it is determined that the edge of the first light band matches the reference line; otherwise, it is determined that the edge of the first light band does not match the reference line.

6. The door and window detection method based on image recognition according to claim 5, characterized in that: Determining the abnormal position of the door and window glass to be detected based on the first light band edge and the reference line includes: Based on multiple differences Construct difference sequence; Determine the mutation point of the difference sequence, and convert the difference of the mutation point into The corresponding coordinate point on the edge of the first light band As the abnormal position of the door and window glass to be detected.

7. The door and window detection method based on image recognition according to claim 1, characterized in that: Acquiring reflected images on both sides of the abnormal position, including: Turn off the light strip on one side of the door and window glass to be inspected, turn on the light strip on the other side of the door and window glass to be inspected, adjust the position of the light strip so that the edge of the light strip coincides with the abnormal position, and collect the reflected light image on the other side of the door and window glass to be inspected; The light band on the other side of the door and window glass to be inspected is turned off, and the light band on one side of the door and window glass to be inspected is turned on, the position of the light band is adjusted so that the edge of the light band coincides with the abnormal position, and the reflected image of one side of the door and window glass to be inspected is collected.

8. The door and window detection method based on image recognition according to claim 1, characterized in that: matching the second light band edge with the reference line, Determine the two-dimensional coordinates of each pixel point in the edge of the second light band ; Calculate the distance between each pixel and the reference line Direction Difference , , and calculate multiple differences Variance ; The variance The variance is compared with the preset threshold. When the variance is less than or equal to a preset variance threshold, it is determined that the edge of the second light band matches the reference line; otherwise, it is determined that the edge of the second light band does not match the reference line.

9. The door and window detection method based on image recognition according to claim 1, characterized in that: Determining the abnormal point of the door and window glass to be detected based on the matching result includes: When the edge of the second light band located on one side of the abnormal position does not match the reference line, it is determined that the abnormal point is located on one side of the abnormal position; when the edge of the second light band located on the other side of the abnormal position does not match the reference line, it is determined that the abnormal point is located on the other side of the abnormal position.

10. A door and window detection system based on image recognition, characterized in that: include: A first acquisition module is used to acquire, from one side of the door and window glass to be detected, a first motion video of a light band arranged on the other side of the door and window glass to be detected, wherein the light band moves from one side edge of the door and window glass to be detected to another opposite side edge; A reference module, used to parse the first motion video onto a time axis, determine reference line positions of a plurality of image frames in the first motion video according to the motion speed of the light band and the time axis, and set a reference line in the image frame based on the reference line position, wherein the reference line is a reference position of an edge of the light band; A matching module, used for extracting a first light band edge in the image frame, and matching the first light band edge with the reference line; A first detection module, configured to detect the door and window glass to be detected when the edge of the first light band matches the reference line; and to determine the abnormal position of the door and window glass to be detected based on the first light band edge and the reference line when the edge of the first light band does not match the reference line; A second acquisition module is used to acquire the reflected images on both sides of the abnormal position, and the reflected images are respectively acquired when the light bands located on both sides of the door and window glass to be detected are turned on; The second detection module is used to extract the edge of the second light band in the reflected image, match the edge of the second light band with the reference line, and determine the abnormal point of the door and window glass to be detected based on the matching result.

Citation Information

Patent Citations

  • Automatic detection method of steel rail light band abnormity based on digital image processing

    CN102628814A

  • Glass cover plate light transmission abnormity detection method based on image processing

    CN117392136A