Cabinet door detection method and device, equipment and storage medium
By acquiring and analyzing the pixel information of specific areas in the detection images collected by the image acquisition device, determining whether the cabinet door is closed, solving the problems of high hardware cost and complexity in the prior art, and achieving efficient cabinet door detection.
Patent Information
- Application Number
- CN202311550652.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2025-05-20
AI Technical Summary
The prior art requires consuming storage resources of image acquisition equipment when performing cabinet door detection, resulting in high hardware cost and complexity.
By acquiring at least two frames of detection images, determining the first area of the target object in the image, determining whether there is an unclosed target cabinet door in the multiple cabinet doors based on the pixel information of the second area other than the first area, and outputting prompt information.
It realizes saving the storage resources of image acquisition equipment when performing cabinet door detection, reduces hardware cost and complexity, and improves the accuracy of detection.
Smart Images

Figure CN120020904A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly relates to a cabinet door detection method, device, equipment, and storage medium. Background Art
[0002] In recent years, with the improvement of people's living standards, online shopping has become an integral part of people's daily lives. Express delivery and takeaways, as important components of online shopping, also play an increasingly important role in daily life. To facilitate people's access to express deliveries, express cabinets or takeaway cabinets have emerged as the times require. In daily life, it often happens that someone forgets to close the cabinet door after picking up an express delivery or takeaway.
[0003] In recent years, with the development of machine vision, the prior art has proposed a technical solution for detecting whether a cabinet door is closed by storing a template image of the express cabinet door in a bottom image library and comparing the features with the express cabinet door in a real-time video. However, this solution requires consuming the storage resources of the image acquisition device. Summary of the Invention
[0004] The present invention provides a cabinet door detection method, device, equipment, and storage medium, which are used to solve the defect that the storage resources of the image acquisition device need to be consumed when detecting the cabinet door in the prior art, and achieve the purpose of saving the storage resources of the image acquisition device when detecting the cabinet door.
[0005] The present invention provides a cabinet door detection method, including:
[0006] When a target object is detected, obtain at least two frames of detection images, and each of the detection images includes a plurality of cabinet doors;
[0007] Determine a first area where the target object is located in each of the detection images;
[0008] Based on the pixel information of a second area other than the first area in each of the detection images, determine whether there is an unclosed target cabinet door among the plurality of cabinet doors;
[0009] When it is determined that there is an unclosed target cabinet door among the plurality of cabinet doors, output a prompt message, where the prompt message is used to remind the target object to close the target cabinet door.
[0010] According to the cabinet door detection method provided by the present invention, the determining whether there is an unclosed target cabinet door among the plurality of cabinet doors based on the pixel information of the second area other than the first area in each of the detection images includes:
[0011] Compare the pixel information of the second region in two adjacent frames of detection images. When it is determined that there are two frames of detection images in which the number of different pixels is greater than the first preset number, determine that there is an unclosed target cabinet door among the multiple cabinet doors.
[0012] According to a cabinet door detection method provided by the present invention, the comparison of the pixel information of the second region in two adjacent frames of detection images includes:
[0013] Determine the common region of the second region of each detection image in the two adjacent frames of detection images as the third region;
[0014] Compare the pixel information of the third region in the two adjacent frames of detection images.
[0015] According to a cabinet door detection method provided by the present invention, when it is determined that there are two frames of detection images in which the number of different pixels is greater than the first preset number, determining that there is an unclosed target cabinet door among the multiple cabinet doors includes:
[0016] When it is determined that there are two frames of detection images in which the number of different pixels is greater than the first preset number, compare the pixel information of the second region in the latter frame of the two frames of detection images with the pixel information of the second region in each first detection image before the target detection image; the target detection image is the former frame of the two frames of detection images;
[0017] When it is determined that the number of different pixels between the latter frame of detection image and each of the first detection images is greater than the first preset number, determine that there is an unclosed target cabinet door among the multiple cabinet doors.
[0018] According to a cabinet door detection method provided by the present invention, the method further includes:
[0019] Determine the fourth region where the different pixels are located in the latter frame of the two frames of detection images;
[0020] Compare the pixel information in the fifth region, which is the second region of the latter frame of detection image except the fourth region, with the pixel information in the fourth region;
[0021] When it is determined that the number of different pixels between the fifth region and the fourth region is greater than the second preset number, determine that there is an unclosed target cabinet door among the multiple cabinet doors.
[0022] According to a cabinet door detection method provided by the present invention, when it is determined that there is an unclosed target cabinet door among the multiple cabinet doors, outputting a prompt message includes:
[0023] When it is determined that there is a target cabinet door among the multiple cabinet doors that is not closed, and the target object exists in the second detection image re-acquired, a prompt message is output.
[0024] According to a cabinet door detection method provided by the present invention, the method further includes:
[0025] When it is determined based on the re-acquired second detection image that the target cabinet door remains in an unclosed state and the target object does not exist in the second detection image, the output of the prompt message is stopped after a preset duration.
[0026] The present invention also provides a cabinet door detection device, including:
[0027] An acquisition module, configured to acquire at least two frames of detection images when a target object is detected, and each of the detection images includes multiple cabinet doors;
[0028] A determination module, configured to determine a first area where the target object is located in each of the detection images;
[0029] The determination module is further configured to determine whether there is an unclosed target cabinet door among the multiple cabinet doors based on the pixel information of a second area other than the first area in each of the detection images;
[0030] An output module, configured to output a prompt message when it is determined that there is an unclosed target cabinet door among the multiple cabinet doors, and the prompt message is used to remind the target object to close the target cabinet door.
[0031] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the cabinet door detection method described in any one of the above is implemented.
[0032] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the cabinet door detection method described in any one of the above is implemented.
[0033] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the cabinet door detection method described in any one of the above is implemented.
[0034] The cabinet door detection method, device, equipment, and storage medium provided by the present invention obtain at least two frames of detection images when a target object is detected. Each detection image includes multiple cabinet doors. The first area where the target object is located in each detection image is determined. Based on the pixel information of the second area other than the first area in each detection image, it is determined whether there is a target cabinet door that is not closed among the multiple cabinet doors. When it is determined that there is a target cabinet door that is not closed among the multiple cabinet doors, a prompt message is output to remind the target object to close the target cabinet door. Since when detecting the closed state of the cabinet door, only relying on the detection images collected by the image acquisition device and based on the pixel information of the second area in this detection image, it can be determined whether there is a target cabinet door that is not closed, avoiding the phenomenon in the prior art that sensors need to be set at each cabinet door. Therefore, not only the complexity of the hardware relied on for cabinet door detection is reduced, but also the hardware cost is reduced. Moreover, there is no need to pre-store the template images of the express cabinet doors in the image acquisition device, so the storage resources of the image acquisition device can be saved. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0036] Figure 1 It is a schematic flowchart of the cabinet door detection method provided by the embodiment of the present invention;
[0037] Figure 2 It is a schematic installation diagram of the IPC provided by the embodiment of the present invention;
[0038] Figure 3 It is one of the schematic diagrams of the detection image provided by the embodiment of the present invention;
[0039] Figure 4 It is another schematic diagram of the detection image provided by the embodiment of the present invention;
[0040] Figure 5 It is yet another schematic diagram of the detection image provided by the embodiment of the present invention;
[0041] Figure 6 It is a schematic structural diagram of the cabinet door detection device provided by the embodiment of the present invention;
[0042] Figure 7 It exemplifies a schematic physical structure diagram of an electronic device. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts belong to the scope of protection of the present invention.
[0044] Currently, express cabinets and food delivery cabinets have been widely used in life. While greatly facilitating our lives, there is a phenomenon that many people forget to close the door after picking up food deliveries and express items. Currently, when detecting whether an express cabinet door is closed, one method is to set sensors on the express cabinet to detect whether the cabinet door is closed through the sensors. When it is detected that the cabinet door is not closed, a prompt message will be output to remind the user to close the cabinet door. However, in the above method, a sensor needs to be set at each cabinet door, resulting in a relatively high hardware cost for cabinet door detection. Moreover, when detecting the cabinet door, it is necessary to rely on the sensors set at each cabinet door, making the complexity of the hardware relied on by the detection method relatively high.
[0045] Another method is to pre-store the template image of the express cabinet door in the image acquisition device. After collecting the real-time video through the image acquisition device, compare the feature information of the express cabinet door in the real-time video with the feature information in the template image to detect whether there is an unclosed cabinet door. However, in the above method, it is necessary to pre-store the template image of the express cabinet door in the image acquisition device, resulting in a relatively large consumption of storage resources in the image acquisition device.
[0046] Based on the above problems, in the embodiments of the present invention, considering that in order to prevent express deliveries or takeaways from being lost or misappropriated currently, image acquisition devices are usually installed near the express cabinets, such as installing network cameras (IP Cameras, IPCs), etc. In addition, in the images acquired by the image acquisition device, when the cabinet door is opened, there will be obvious differences in the pixel information of the area where the cabinet door is located and the pixel information of other areas. Based on this, in the cabinet door detection method provided by the embodiments of the present invention, the image acquisition device can be used to acquire detection images. After determining the first area where the target object is located in each detection image, based on the pixel information of the other areas in each detection image except the first area blocked by the target object, it is determined whether there is an unclosed target cabinet among multiple cabinet doors. When it is determined that there is an unclosed target cabinet among multiple cabinet doors, a prompt message is output to remind the target object to close the target cabinet door. Since when detecting the closed state of the cabinet door, it only depends on the detection images acquired by the image acquisition device, and it can be determined whether there is an unclosed target cabinet based on the pixel information of the second area in the detection image, which avoids the phenomenon of setting sensors at each cabinet door in the prior art. Therefore, not only the complexity of the hardware relied on during cabinet door detection is reduced, but also the hardware cost is reduced. Moreover, there is no need to pre-store the template images of the express cabinet doors in the image acquisition device, so the storage resources of the image acquisition device can be saved. In addition, the embodiments of the present application solve the technical problems of false detection caused by light changes caused by clouds in traditional multi-frame detection and the influence on the detection result when the number of opened express cabinet doors exceeds a certain number in single-frame detection through a combination of multi-frame detection and single-frame detection.
[0047] In addition, the embodiments of the present invention can be applied to the detection of the opening and closing states of cabinet doors in any scenario, such as the detection of express cabinet doors, the detection of takeaway cabinet doors, or the detection of other cabinet doors with uniform colors and styles, etc.
[0048] The following combines Figures 1-5 to describe the cabinet door detection method provided by the embodiments of the present invention.
[0049] Figure 1 is a schematic flowchart of the cabinet door detection method provided by the embodiments of the present invention. The execution subject of this method can be an electronic device such as an intelligent camera, a network camera, a computer, a server, a server cluster, or a specially designed cabinet door detection device, or a cabinet door detection device set in the electronic device. The cabinet door detection device can be implemented through software, hardware, or a combination of both. As Figure 1 shown, this cabinet door detection method includes steps 101 to 104.
[0050] Step 101: When a target object is detected, obtain at least two frames of detection images, and each detection image includes multiple cabinet doors.
[0051] Figure 2 The installation schematic diagram of the IPC provided by the embodiment of the present invention is as follows. As Figure 2 shown, the express cabinet 11 includes a plurality of express boxes, such as express box A, express box B, and express box C, etc. The IPC 12 can be installed facing the express cabinet. By adjusting the field of view angle of the IPC 12, the captured detection image can cover the entire express cabinet. Of course, in addition to installing the IPC 12 facing the express cabinet 11, other installation methods can also be adopted, as long as it is ensured that the captured detection image contains the entire express cabinet. It should be noted that when the monitoring screen of the IPC 12 is larger than the screen of the express cabinet 11, a detection area needs to be configured based on the installation position of the IPC 12 and the size of the express cabinet 11. This detection area is the express cabinet area. For example, an area with a preset position and a preset size in the detection image captured by the IPC 12 is set as the express cabinet area. In this way, in the subsequent detection process, only the express cabinet area can be detected, that is, it is only determined whether there is an unclosed target cabinet door based on the pixel information within the express cabinet area, thereby avoiding detection errors caused by moving targets in other areas.
[0052] In addition, the target object can include a user picking up an express or a robot, etc. When the IPC 12 detects the target object, it means that a target object has entered the monitoring area of the IPC 12, that is, a target object is going to pick up an express from the express cabinet. At this time, the IPC 12 determines the image obtained after detecting the target object as the detection image. Among them, multiple cabinet doors of the express cabinet are included in at least two captured detection images.
[0053] Since in the case of detecting the target object, at least two subsequent captured detection images are used as the basis for subsequent detection of whether the cabinet door is closed, it can be ensured that when a prompt message is output in the case of detecting that there is an unclosed target cabinet door, the target object can promptly close the unclosed target cabinet door.
[0054] Step 102: Determine the first area where the target object is located in each detection image.
[0055] In this step, when the target object enters the monitoring area of the IPC 12, a depth algorithm can be applied to identify the human form and perform tracking to record the first area where the target object is located in each detection image. Among them, this first area can be understood as the area blocked by the target object in the detection image.
[0056] It can be understood that since the area blocked by the target object cannot determine whether the cabinet door is closed based on the pixel information of the image, in the embodiment of the present invention, it is necessary to determine which areas in the detection image are blocked by the target object based on the human form detection method, thereby improving the accuracy of cabinet door detection.
[0057] Step 103: Based on the pixel information of the second regions other than the first region in each detection image, determine whether there is an unclosed target cabinet door among multiple cabinet doors.
[0058] In this step, after determining the first region in each detection image, the second regions other than the first region in each detection image can be obtained. Herein, the second region can be understood as the other regions except the regions blocked by the target object.
[0059] Since the styles and colors of the cabinet doors of the express cabinet are usually unified, and the color inside the express box is different from the color of the cabinet door, it is possible to determine whether there is an unclosed target cabinet door among multiple cabinet doors based on the pixel information of the pixels in the second region. For example, it can be determined whether there are pixels in the second region of a certain frame of detection image whose colors are different from the colors of the pixels in the second region of other frames of detection images. If so, it indicates that there is an unclosed target cabinet door among multiple cabinet doors. For another example, usually when the cabinet door is open, the brightness inside the express box is lower than the brightness of the cabinet door. Therefore, it can be determined whether there are pixels in the second region of a certain frame of detection image whose brightness values are different from the brightness values of the pixels in the second region of other frames of detection images. If so, it indicates that there is an unclosed target cabinet door among multiple cabinet doors. Of course, it can also be determined based on the same frame of detection image. For example, it can be determined whether there are multiple consecutive pixels in the second region of this frame of detection image whose colors are different from the colors of other pixels. If so, it indicates that there is an unclosed target cabinet door among multiple cabinet doors. For another example, it can be determined whether there are multiple consecutive pixels in the second region of this frame of detection image whose brightness values are different from the brightness values of other pixels. If so, it indicates that there is an unclosed target cabinet door among multiple cabinet doors.
[0060] It should be noted that in practical applications, it is also possible to determine whether there is an unclosed target cabinet door based on other information of the pixels, such as the gray value of the pixels.
[0061] Step 104: When it is determined that there is an unclosed target cabinet door among multiple cabinet doors, output a prompt message for reminding the target object to close the target cabinet door.
[0062] In this step, the prompt message can be output in the form of voice broadcast, or a text message can be sent to the mobile terminal corresponding to the target object, or it can be output in the form of a flashing light. The prompt message is used to remind the target object to close the target cabinet door.
[0063] Exemplarily, when outputting a prompt message by means of voice broadcast or light flashing, in order to avoid disturbing the residents, after detecting the preset duration for the target object to walk out of the monitoring area, even if the target cabinet door is not closed, the prompt message will be stopped from being output, so as to avoid ineffective reminders. When outputting a prompt message by sending a text message to the mobile terminal corresponding to the target object, in order to promptly remind the target object to close the target cabinet door, usually when detecting that the target object is within the monitoring area, a prompt message is sent to the mobile terminal. If the preset duration for the target object to walk out of the monitoring area has passed, even if the target cabinet door is not closed, a prompt message will not be sent to the mobile terminal, which can also avoid ineffective reminders.
[0064] The cabinet door detection method provided by the embodiment of the present invention, when detecting a target object, obtains at least two frames of detection images, each detection image includes a plurality of cabinet doors, determines the first area where the target object is located in each detection image, and based on the pixel information of the second area other than the first area in each detection image, determines whether there is an unclosed target cabinet door among the plurality of cabinet doors. When it is determined that there is an unclosed target cabinet door among the plurality of cabinet doors, a prompt message is output to remind the target object to close the target cabinet door. Since when detecting the closed state of the cabinet door, it only relies on the detection images collected by the image acquisition device, and based on the pixel information of the second area in the detection image, it can be determined whether there is an unclosed target cabinet door, avoiding the phenomenon in the prior art that sensors need to be set at each cabinet door. Therefore, not only the complexity of the hardware relied on for cabinet door detection is reduced, but also the hardware cost is reduced. Moreover, there is no need to pre-store the template images of the express cabinet doors in the image acquisition device, so the storage resources of the image acquisition device can be saved.
[0065] Exemplarily, based on the pixel information of the second area other than the first area in each detection image, determining whether there is an unclosed target cabinet door among the plurality of cabinet doors can be achieved by the following method:
[0066] Compare the pixel information of the second area in two adjacent frames of detection images. When it is determined that there are two frames of detection images with the number of different pixels greater than the first preset number, it is determined that there is an unclosed target cabinet door among the plurality of cabinet doors.
[0067] Specifically, comparing the pixel information of the second region in two adjacent frames of detection images can be understood as starting from the first frame of detection image and comparing the pixel information of the second region in two adjacent detection images pairwise. When it is determined that the number of different pixels in a certain two adjacent frames of detection images is greater than the first preset number, it indicates that there is an unclosed target cabinet door among multiple cabinet doors. Of course, for further verification, the subsequent detection images can also be continuously compared with the previous frame of the above two adjacent frames of detection images. If there are situations where the number of different pixels is greater than the first preset number in all cases, it indicates that there is indeed an unclosed target cabinet door.
[0068] Among them, when all the cabinet doors of the express cabinet are in the closed state, the difference in pixel information within the second region in two adjacent frames of detection images is not significant. Therefore, the number of different pixels within the second region in two adjacent frames of detection images should be less than the first preset number. When there is an open cabinet door in the express cabinet, since the color, brightness, or contrast information of the pixels at the open cabinet door is quite different from the color, brightness, or contrast information of the pixels at the closed cabinet door, therefore, when the number of different pixels within the second region in two adjacent frames of detection images is greater than the first preset number, it indicates that a cabinet door is open at this time, that is, there is an unclosed target cabinet door among multiple cabinet doors.
[0069] Among them, comparing the pixel information of the second region in two adjacent frames of detection images can be understood as comparing the pixels at the same positions in the second regions of two adjacent frames of detection images. For example, based on the coordinates of each pixel, the pixels at the same positions can be determined, so as to compare the pixel information.
[0070] It should be understood that when determining two frames of detection images with the number of different pixels greater than the first preset number, starting from the acquisition moment of the latter frame of the two adjacent frames of detection images, the cabinet door is in the open state.
[0071] Figure 3 This is one of the schematic diagrams of the detection image provided by the embodiment of the present invention, such as Figure 3As shown, in the current monitoring scenario, the area occupied by a single express delivery box in the express delivery cabinet is area C, which is configured by the user by drawing a frame during the installation of the IPC device. Denote the first area where the target object is located in the detection image as area A, and the second area other than area A as area B. Compare the pixel information of area B in two adjacent frames of detection images. To improve the accuracy of the comparison, it is necessary to exclude the influence of noise, that is, it is necessary to filter out the pixel differences in a small area. For example, due to the influence of light or noise, there may be inconsistent pixel information in a small area in area B of two consecutive frames of detection images. At this time, the pixel differences in this small area need to be filtered. Usually, when the number of different pixels in the second area in two adjacent frames of detection images is greater than a first preset number, it is determined that there is an unclosed target cabinet door. Among them, the first preset number can be set to m times the number of pixels in area C, and the value of m is related to the sensitivity of the IPC. The higher the sensitivity, the smaller the value of m, and m is a positive number. In addition, the sensitivity of the IPC supports configuration.
[0072] In this embodiment, by comparing the pixel information of the second area in two adjacent frames of detection images, in the case of two frames of detection images with the number of different pixels greater than the first preset number, it is determined that there is an unclosed target cabinet door among multiple cabinet doors. Since the characteristic that the pixel information at the cabinet door will change when the cabinet door is opened is utilized, therefore, only the pixel information of the second area in two adjacent frames of detection images is compared, and whether there is an unclosed target cabinet door can be determined by using the difference of pixels in two adjacent frames of detection images. This not only makes the detection method simple but also has high accuracy.
[0073] Exemplarily, on the basis of the above embodiment, when comparing the pixel information of the second area in two adjacent frames of detection images, it may be to determine the common area of the second area of each detection image in two adjacent frames of detection images as the third area, and compare the pixel information of the third area in two adjacent frames of detection images.
[0074] Specifically, Figure 4 This is the second schematic diagram of the detection image provided by the embodiment of the present invention. As Figure 4 shown, in an actual application scenario, the target object may move, and the first area where it is located in two adjacent frames of detection images may change, such as Figure 4 changing from area A in the previous frame of detection image to area A' in the next frame of detection image. Since when comparing the pixel information in the second area, the pixels at the same position are compared, from Figure 4It can be seen that when the target object moves, a partial area B in the previous frame of detection image belongs to the area occluded by the target object in the subsequent frame image. Therefore, it is necessary to determine the common area of the second areas of each detection image in two adjacent frames of detection images, that is, the third area. Among them, this third area can be understood as Figure 4 the other areas in the subsequent frame of detection image except area A and area A'.
[0075] After determining the third area, the pixel information of the third area in two adjacent frames of detection images can be compared. For example, the pixels at the same position in the third areas of the two frames of detection images are compared to determine whether the number of different pixels is greater than the first preset number. If it is greater than the first preset number, it indicates that there is an unclosed target cabinet door.
[0076] In this embodiment, the common area of the second areas of each detection image in two adjacent frames of detection images can be determined, and the pixel information of this common area is compared. In this method, the influence of the movement of the target object on the comparison of pixel information is considered, and the occluded area after the movement of the target object is removed before comparing the pixel information, so as to improve the accuracy of the comparison of pixel information.
[0077] Exemplarily, on the basis of the above embodiments, in order to further improve the accuracy of cabinet door state detection, when determining that there are two frames of detection images with the number of different pixels greater than the first preset number and determining that there is an unclosed target cabinet door among multiple cabinet doors, it can also be achieved by the following method:
[0078] When it is determined that there are two frames of detection images with the number of different pixels greater than the first preset number, the pixel information of the second area in the subsequent frame of detection image in the two frames of detection images is respectively compared with the pixel information of the second area in each first detection image before the target detection image; among them, the target detection image is the previous frame of detection image in the two frames of detection images; when it is determined that the number of different pixels between the subsequent frame of detection image and each first detection image is greater than the first preset number, it is determined that there is an unclosed target cabinet door among multiple cabinet doors.
[0079] Specifically, when it is determined that there are two frames of detection images with the number of different pixels greater than the first preset number, it indicates that a cabinet door is in an unclosed state at this time, and this unclosed state starts from the acquisition moment of the latter frame of detection image among the above two frames of detection images. Before this acquisition moment, the cabinet doors were all in a closed state. Therefore, in order to further verify the accuracy of the detection, the pixel information of the second region in the latter frame of the two frames of detection images with differences can be compared with the pixel information of the second region in each first detection image before the former frame of detection image. If the number of different pixels between the latter frame of detection image and each first detection image is greater than the first preset number, it is verified that there is indeed an unclosed target cabinet door among multiple cabinet doors.
[0080] For example, if the number of different pixels between the B0 frame detection image and the B1 frame detection image is greater than the first preset number, the B0 frame detection image is recorded as the detection image with differential changes, the B1 frame detection image is the previous frame image of the B0 frame detection image, and the detection images collected before the B1 frame detection image are B2, B3... Bn in sequence, where the Bn frame is the first frame when the target object is detected. By continuously comparing the differences in pixel information in the second region between the B0 frame and B1, the B0 frame and B2, the B0 frame and B3... the B0 frame and Bn frame in sequence, when there are all more than the first preset number of different pixels, it is determined that there is an unclosed target cabinet door at this time.
[0081] In this embodiment, the pixel information of the second region in the latter frame of the two frames of detection images can be compared with the pixel information of the second region in each first detection image before the target detection image respectively, so as to further verify the state of the cabinet door, thereby improving the accuracy of cabinet door state detection.
[0082] Furthermore, in order to further determine the accuracy of cabinet door state detection, the opening and closing state of the cabinet door can also be determined by comparing the pixel information in different regions of the same frame of detection image. Exemplarily, the fourth region where the different pixels are located in the latter frame of the two frames of detection images can be determined, and the pixel information in the fifth region except the fourth region in the second region of the latter frame of detection image is compared with the pixel information in the fourth region. When it is determined that the number of different pixels between the fifth region and the fourth region is greater than the second preset number, it is determined that there is an unclosed target cabinet door among multiple cabinet doors.
[0083] Specifically, since the colors and styles of different cabinet doors of the express cabinet are usually similar, the error caused by all-weather light differences in cabinet door detection can be avoided by comparing the pixel information in different regions of the same frame of detection image.
[0084] Figure 5This is the third schematic diagram of the detection image provided by the embodiment of the present invention. As Figure 5 shown, when it is determined that the number of different pixels in two adjacent frames of detection images is greater than a first preset number, the area where the different pixels are located in the latter frame of the two frames of detection images is determined as the fourth area, as Figure 5 the area D in. Among them, the fourth area D can be understood as the area where it is suspected that the cabinet door is not closed.
[0085] In the second area of the latter frame of the detection image, other areas except the fourth area D are determined, that is, the fifth area E. The fifth area E can be understood as the area where the cabinet doors are all in the closed state. Compare the pixel information in the fifth area E with the pixel information in the fourth area D, such as comparing the color, brightness, contrast, etc. of the pixels in the fifth area with the color, brightness, contrast, etc. of the pixels in the fourth area. Since there will be a large difference between the pixel information inside the express box and the pixel information of the cabinet door, if there is indeed an unclosed cabinet door in the fourth area, the number of different pixels between the fifth area and the fourth area will be greater than a second preset number.
[0086] Among them, the fifth area E can be understood as other areas in the detection image except the first area blocked by the target object and the fourth area D.
[0087] In addition, the second preset number can be set to h times the number of pixels in area C. The h value is related to the sensitivity of the IPC. The higher the sensitivity, the smaller the h value, and h is greater than or equal to 1.
[0088] In this embodiment, the pixel information in the fourth area and the fifth area in the same frame of the detection image can be compared. When it is determined that the number of different pixels between the fifth area and the fourth area is greater than the second preset number, it is determined that there is an unclosed target cabinet door among multiple cabinet doors, which can avoid false detection caused by light differences, etc., and further improve the accuracy of cabinet door state detection. In addition, by combining multi-frame detection and single-frame detection, the technical problems of false detection caused by light changes caused by clouds in traditional multi-frame detection and the influence of the detection result when the number of opened express cabinet doors exceeds a certain number in single-frame detection are solved, and the accuracy of cabinet door state detection is improved.
[0089] It should be noted that in the embodiment of the present invention, the pixel information in each area of at least two frames of the collected detection images can also be compared respectively, that is, the comparison between the front and back two frames of images is not performed, and it is only determined whether there is an unclosed target cabinet door through the same frame of the detection image. The specific detection method is similar to that in the above embodiment and will not be elaborated here.
[0090] Exemplarily, based on the above embodiments, when it is determined that there is a target cabinet door that is not closed among multiple cabinet doors, a prompt message can be output in the following manner:
[0091] When it is determined that there is a target cabinet door that is not closed among multiple cabinet doors and there is a target object in the re-acquired second detection image, a prompt message is output.
[0092] Specifically, when there is a target object in the re-acquired second detection image, it indicates that the target object has not left the express cabinet at this time. When it is determined that there is a target cabinet door that is not closed, a prompt message can be output, such as by sending a voice prompt message for forgetting to close the express cabinet door to remind the user to close the cabinet door in time.
[0093] In this embodiment, on the one hand, a prompt message can be sent when it is determined that the target object has not left the monitoring area, which can timely remind the target object to close the target cabinet door and prevent the phenomenon of ineffective reminders. On the other hand, a prompt message will only be sent when the target object is detected, which can filter out alarms triggered by false detections such as tree shadows.
[0094] Furthermore, when it is determined based on the re-acquired second detection image that the target cabinet door remains in an unclosed state and there is no target object in the second detection image, the output of the prompt message will stop after a preset duration.
[0095] Specifically, when it is determined through the second detection image subsequently acquired by the IPC that the target cabinet door has not been closed and the target object has left the monitoring area, in order to avoid disturbing the residents, the output of the prompt message will stop after a preset duration, such as closing the voice reminder after a preset duration. The preset duration can be set to 30 seconds or one minute, etc.
[0096] In this embodiment, when it is determined that the target cabinet door remains in an unclosed state and the target object has left the monitoring area, the output of the prompt message will stop after a preset duration, so that while timely reminding the target object to close the cabinet door, it can also avoid the problem of disturbing the residents caused by continuously outputting the prompt message when the cabinet door is not closed.
[0097] Furthermore, after stopping the output of the prompt message, the pixel information in each area will be refreshed again, that is, the pixel information in each area will be initialized, so as to re-determine whether there is an unclosed target cabinet door based on the subsequently acquired detection image.
[0098] The cabinet door detection device provided by the present invention will be described below. The cabinet door detection device described below can be correspondingly referred to the cabinet door detection method described above.
[0099] Figure 6The structural schematic diagram of the cabinet door detection device provided by the embodiment of the present invention is referred to Figure 6 As shown, the cabinet door detection device 600 includes:
[0100] An acquisition module 601, configured to acquire at least two frames of detection images when a target object is detected, and each of the detection images includes a plurality of cabinet doors;
[0101] A determination module 602, configured to determine a first area where the target object is located in each of the detection images;
[0102] The determination module 602 is further configured to determine whether there is an unclosed target cabinet door among the plurality of cabinet doors based on the pixel information of a second area other than the first area in each of the detection images;
[0103] An output module 603, configured to output a prompt message when it is determined that there is an unclosed target cabinet door among the plurality of cabinet doors, and the prompt message is used to remind the target object to close the target cabinet door.
[0104] In an exemplary embodiment, the determination module 602 is specifically configured to:
[0105] Compare the pixel information of the second area in two adjacent frames of detection images, and when it is determined that there are two frames of detection images with the number of different pixels greater than a first preset number, determine that there is an unclosed target cabinet door among the plurality of cabinet doors.
[0106] In an exemplary embodiment, the device further includes a comparison module, wherein
[0107] The determination module 602 is further configured to determine a common area of the second area of each detection image in the two adjacent frames of detection images as a third area;
[0108] The comparison module is configured to compare the pixel information of the third area in the two adjacent frames of detection images.
[0109] In an exemplary embodiment, the determination module 602 is specifically configured to:
[0110] When it is determined that there are two frames of detection images with the number of different pixels greater than a first preset number, compare the pixel information of the second area in the latter frame of the two frames of detection images with the pixel information of the second area in each first detection image before the target detection image; the target detection image is the former frame of the two frames of detection images;
[0111] In the case where the number of different pixels between the subsequent frame detection image and each of the first detection images is determined to be greater than the first preset number, it is determined that there is an unclosed target cabinet door among the multiple cabinet doors.
[0112] In an exemplary embodiment, the determining module 602 is further configured to determine a fourth area where different pixels are located in the subsequent frame detection image of the two frame detection images;
[0113] The comparison module is configured to compare the pixel information in a fifth area other than the fourth area in the second area of the subsequent frame detection image with the pixel information in the fourth area;
[0114] The determining module 602 is further configured to determine that there is an unclosed target cabinet door among the multiple cabinet doors in the case where the number of different pixels between the fifth area and the fourth area is determined to be greater than a second preset number.
[0115] In an exemplary embodiment, the output module 603 is specifically configured to:
[0116] In the case where it is determined that there is an unclosed target cabinet door among the multiple cabinet doors and the target object exists in the second detection image re-acquired, a prompt message is output.
[0117] In an exemplary embodiment, the output module 603 is specifically configured to:
[0118] In the case where it is determined based on the re-acquired second detection image that the target cabinet door remains unclosed and the target object does not exist in the second detection image, the output of the prompt message is stopped after a preset duration.
[0119] The device in this embodiment can be used to execute the method in any one of the method embodiments on the cabinet door detection side. The specific implementation process and technical effects are similar to those in the method embodiments on the cabinet door detection side. For details, reference can be made to the detailed introduction in the method embodiments on the cabinet door detection side, which will not be elaborated here.
[0120] Figure 7 An example of the physical structure diagram of an electronic device is shown as Figure 7As shown in the figure, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740. Among them, the processor 710, the communications interface 720, and the memory 730 complete communication with each other through the communication bus 740. The processor 710 may call the logical instructions in the memory 730 to execute the cabinet door detection method. The method includes: when a target object is detected, obtaining at least two frames of detection images, each of the detection images including a plurality of cabinet doors; determining a first region where the target object is located in each of the detection images; based on the pixel information of a second region other than the first region in each of the detection images, determining whether there is a target cabinet door that is not closed among the plurality of cabinet doors; when it is determined that there is a target cabinet door that is not closed among the plurality of cabinet doors, outputting a prompt message, where the prompt message is used to remind the target object to close the target cabinet door.
[0121] In addition, when the logical instructions in the above-mentioned memory 730 are implemented in the form of a software functional unit and sold or used as an independent product, they may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, or a part of this technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.
[0122] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the cabinet door detection method provided by the above-mentioned various methods. The method includes: when a target object is detected, obtaining at least two frames of detection images, each of the detection images including a plurality of cabinet doors; determining a first region where the target object is located in each of the detection images; based on the pixel information of a second region other than the first region in each of the detection images, determining whether there is a target cabinet door that is not closed among the plurality of cabinet doors; when it is determined that there is a target cabinet door that is not closed among the plurality of cabinet doors, outputting a prompt message, where the prompt message is used to remind the target object to close the target cabinet door.
[0123] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the cabinet door detection method provided by the above various methods. The method includes: when a target object is detected, obtaining at least two frames of detection images, each of the detection images including a plurality of cabinet doors; determining a first region where the target object is located in each of the detection images; based on the pixel information of a second region other than the first region in each of the detection images, determining whether there is a target cabinet door that is not closed among the plurality of cabinet doors; and when it is determined that there is a target cabinet door that is not closed among the plurality of cabinet doors, outputting a prompt message, where the prompt message is used to remind the target object to close the target cabinet door.
[0124] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0125] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cabinet door detection method, characterized in that: include: When the target object is detected, acquiring at least two frames of detection images, each of the detection images including a plurality of cabinet doors; Determine a first area where the target object is located in each of the detection images; Based on pixel information of a second area other than the first area in each of the detection images, determining whether there is an unclosed target cabinet door among the plurality of cabinet doors; In the case where it is determined that there is an unclosed target door among the plurality of doors, prompt information is output, where the prompt information is used to remind the target object to close the target door.
2. The cabinet door detection method according to claim 1, characterized in that: The determining whether there is an unclosed target cabinet door among the plurality of cabinet doors based on pixel information of a second area other than the first area in each of the detection images comprises: The pixel information of the second area in two adjacent frames of detection images is compared, and when it is determined that there are two frames of detection images with a difference pixel number greater than a first preset number, it is determined that there is an unclosed target cabinet door among the multiple cabinet doors.
3. The cabinet door detection method according to claim 2, characterized in that: The comparing pixel information of the second area in two adjacent frames of detection images includes: Determine a common area of the second areas of the detection images in the two adjacent frames of detection images as a third area; The pixel information of the third area in the two adjacent frames of detection images is compared.
4. The cabinet door detection method according to claim 2, characterized in that: In the case where it is determined that there are two frames of detection images in which the number of difference pixels is greater than a first preset number, determining that there is the target cabinet door that is not closed among the multiple cabinet doors includes: In the case where it is determined that there are two detection images with a number of difference pixels greater than a first preset number, pixel information of a second area in a latter detection image of the two detection images is compared with pixel information of a second area in each first detection image before a target detection image; the target detection image is a former detection image of the two detection images; When it is determined that the number of difference pixels between the subsequent frame detection image and each of the first detection images is greater than the first preset number, it is determined that there is the target cabinet door that is not closed among the multiple cabinet doors.
5. The cabinet door detection method according to any one of claims 2 to 4, characterized in that: The method further comprises: Determine a fourth region where a difference pixel is located in a latter detection image of the two detection images; Compare pixel information in a fifth area excluding the fourth area in the second area of the subsequent frame of detection image with pixel information in the fourth area; When it is determined that the number of difference pixels between the fifth area and the fourth area is greater than a second preset number, it is determined that there is the target cabinet door that is not closed among the plurality of cabinet doors.
6. The cabinet door detection method according to any one of claims 2 to 4, characterized in that: The step of outputting prompt information when it is determined that there is an unclosed target door among the plurality of doors includes: When it is determined that there is an unclosed target cabinet door among the multiple cabinet doors and the target object exists in the re-acquired second detection image, prompt information is output.
7. The cabinet door detection method according to claim 6, characterized in that: The method further comprises: When it is determined based on the re-acquired second detection image that the target cabinet door is continuously in an open state and the target object does not exist in the second detection image, the prompt information is stopped from being output after a preset time period.
8. A cabinet door detection device, characterized in that: include: An acquisition module, used for acquiring at least two frames of detection images when a target object is detected, each of the detection images including a plurality of cabinet doors; A determination module, used to determine a first area where the target object is located in each of the detection images; The determination module is further configured to determine whether there is an unclosed target cabinet door among the plurality of cabinet doors based on pixel information of a second area other than the first area in each of the detection images; The output module is used to output prompt information when it is determined that there is an unclosed target cabinet door among the multiple cabinet doors, and the prompt information is used to remind the target object to close the target cabinet door.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the cabinet door detection method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the cabinet door detection method according to any one of claims 1 to 7 is implemented.