WO2023050637A1 - Garbage detection - Google Patents

Garbage detection Download PDF

Info

Publication number
WO2023050637A1
WO2023050637A1 PCT/CN2022/070517 CN2022070517W WO2023050637A1 WO 2023050637 A1 WO2023050637 A1 WO 2023050637A1 CN 2022070517 W CN2022070517 W CN 2022070517W WO 2023050637 A1 WO2023050637 A1 WO 2023050637A1
Authority
WO
WIPO (PCT)
Prior art keywords
garbage
area
detection
preset
determined
Prior art date
Application number
PCT/CN2022/070517
Other languages
French (fr)
Chinese (zh)
Inventor
黄超
郑伟伟
姚为龙
Original Assignee
上海仙途智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海仙途智能科技有限公司 filed Critical 上海仙途智能科技有限公司
Publication of WO2023050637A1 publication Critical patent/WO2023050637A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the embodiments of this specification relate to the field of object detection, and in particular to methods and devices for garbage detection.
  • the garbage detection technology For garbage detection, usually after taking an image of the area to be cleaned, the garbage detection technology is used to determine the garbage in the captured image, which can be marked with a garbage detection frame.
  • the current garbage detection technology can detect the garbage in the image, it is difficult to further determine the specific location of the detected garbage, and the accuracy is low.
  • this specification provides a method and device for garbage detection.
  • the technical scheme is as follows.
  • a garbage detection method which divides an area to be detected into at least two preset areas in advance; the method includes: acquiring a target image taken for the area to be detected; determining that the divided preset area is in the target image position; for the target image, using a pre-trained garbage detection model to determine a garbage detection result; according to the determined garbage detection result, determine a preset area where garbage exists as a garbage area.
  • a garbage detection device which divides an area to be detected into at least two preset areas in advance; the device includes: an acquisition unit, used to acquire a target image taken for the area to be detected; a mapping unit, used to determine the divided The position of the preset area in the target image; the detection unit is used to determine the garbage detection result by using the garbage detection model trained in advance for the target image; the positioning unit is used to determine the garbage detection result according to the determined garbage detection result.
  • a preset area where garbage exists is determined as a garbage area.
  • the above technical solution can determine the position of the preset area in the target image, so as to facilitate the determination of the preset area where garbage exists according to the garbage detection result of the target image, efficiently, quickly and accurately determine the position of the garbage, and reduce computing resources loss.
  • Fig. 1 is a schematic flow chart of a garbage detection method provided by the embodiment of this specification
  • Fig. 2 is a schematic diagram of the principle of a preset area mapping method provided by the embodiment of this specification;
  • Fig. 3 is a schematic diagram of the principle of a garbage area determination method provided by the embodiment of this specification.
  • Fig. 4 is a schematic diagram of the principle of cleaning route planning provided by the embodiment of this specification.
  • Fig. 5 is a schematic diagram of the principle of a model structure provided by the embodiment of this specification.
  • Fig. 6 is a schematic diagram of the principle of another cleaning route planning provided by the embodiment of this specification.
  • Fig. 7 is a schematic structural diagram of a garbage detection device provided by an embodiment of this specification.
  • Fig. 8 is a schematic structural diagram of a device for configuring the method of the embodiment of the present specification.
  • Object detection is an important perception technique.
  • obstacles on the driving route can be detected for unmanned vehicles, specifically including other cars, pedestrians, bicycles, motorcycles, etc., and correct driving decisions can be made based on the detection results. Such as stopping, avoiding or going around.
  • the target detected by the target detection may be an obstacle or other objects. For example, spam detection.
  • the unmanned sweeper can detect garbage in the area to be cleaned, and detect the garbage in the area to be cleaned, so that the driving route of the unmanned sweeper can be planned to clean up the detected garbage.
  • the garbage detection technology For garbage detection, usually after taking an image of the area to be cleaned, the garbage detection technology is used to determine the garbage in the captured image, which can be marked with a garbage detection frame.
  • the current garbage detection technology can detect the garbage in the image, it is difficult to further determine the specific location of the detected garbage, and the accuracy is low.
  • a large piece of paper dust in the distance and a small piece of paper dust near it may have similar sizes in the image, so it is difficult to determine the position of the paper dust.
  • the method for locating obstacles is not suitable for locating garbage.
  • obstacles are more obvious, such as pedestrians, motorcycles, etc., they can be scanned by lidar, and obstacles can be determined through more reflection information.
  • many garbage is relatively small, such as paper scraps, fallen leaves, etc. Even if the position in the image is detected and scanned by lidar, there is reflection information for the paper scraps, making it difficult to locate the scraps of paper.
  • the embodiment of this specification provides a garbage detection method.
  • the area to be detected can be divided in advance, and can be divided into multiple preset areas. After the image taken for the area to be detected is acquired, the position of the preset area in the captured image can be determined, so that after the garbage is detected, the preset area with garbage can be determined as the garbage area.
  • the garbage area is a specific location determined for the garbage. Of course, in the same garbage area, there may be multiple garbage. This method does not need to determine the location of each garbage, and can directly determine the preset area where garbage exists as the garbage area, and the determined garbage area is the location of each garbage contained therein.
  • the cleaning route can be planned quickly and efficiently, so that the unmanned sweeper can clean along the cleaning route. It should be noted that the unmanned sweeper needs to clean the garbage area as a whole.
  • the garbage detection method provided by the embodiment of this specification can divide the area to be detected into a plurality of preset areas, and determine the position of the preset area in the image, so that after detecting garbage, it is convenient to further determine the presence of garbage in the image The preset area, so that the garbage can be located. High positioning efficiency, fast speed and high accuracy.
  • FIG. 1 it is a schematic flowchart of a garbage detection method provided in the embodiment of this specification.
  • the region to be detected can be divided into at least two preset regions in advance.
  • the area to be detected may be an area where garbage detection is required, specifically, it may be a pre-set area. For example, for areas such as parking lots, airport halls, shopping malls, etc., since it is necessary to clean up the garbage on the ground, it is necessary to perform garbage detection first to facilitate cleaning later.
  • the preset area in an optional embodiment, it can be used to map to the image that needs to be detected for garbage, so as to determine the position of the detected garbage, that is, the preset area where the garbage is located, and facilitate subsequent determination of cleaning route.
  • the method flow does not limit the method of dividing the preset area.
  • the preset area may be divided manually or automatically by the device.
  • the division may be performed according to a certain size standard.
  • the area to be detected can be divided into multiple grids, and the size and shape of different grids are the same, and the size of each grid can be comprehensively determined according to factors such as image accuracy, garbage detection accuracy, and garbage evaluation size. Of course, it can also be directly set to 1 square meter.
  • the cleaning range of the unmanned sweeper without moving can be determined, and then the grid size can be determined according to the determined cleaning range, specifically, the grid can be made equal to or smaller than the determined cleaning range, so that When the unmanned sweeper is cleaning the preset area, it can be cleaned without moving.
  • the sizes of different preset areas may be the same or different; the shapes of different preset areas may be the same or different.
  • the preset area In the case of manually dividing the preset area, optionally, it can be manually divided according to a special area in the area to be detected. For example, when the area to be detected is a parking lot, each parking space contained in it can be manually determined as a preset area, which is convenient for subsequent direct cleaning of the entire parking space.
  • the aisle can be divided into grids with the same size and shape; when the area to be detected is an area with a height difference, it can be specifically a staircase, and each staircase can be manually determined as a preset area.
  • the division may also be performed in a manner of combining manual division and automatic division.
  • the ground in each shop can be manually determined as the preset area, and then for the hall and aisle of the shopping mall, the preset area can be determined by using the method of automatic division of equipment, specifically, it can be divided by using a grid of preset size , divide the hall and aisle of the shopping mall into multiple grids with a size of 1 square meter, and each grid is a preset area.
  • the preset areas are used to determine the location of the garbage, there may be no overlap between different preset areas.
  • the method may include the following steps.
  • S101 Acquire a target image taken for a region to be detected.
  • S102 Determine the position of the divided preset area in the target image.
  • S103 For the target image, determine a garbage detection result by using a pre-trained garbage detection model.
  • S104 Determine a preset area where garbage exists as a garbage area according to the determined garbage detection result.
  • S102 and S103 may be executed in parallel or successively, and this embodiment does not limit the execution sequence between S102 and S103.
  • the above method flow can determine the position of the preset area in the target image, so as to facilitate the determination of the preset area where garbage exists according to the garbage detection result of the target image, efficiently, quickly and accurately determine the position of the garbage, and reduce computing resources loss.
  • staff can be arranged to clean it, or unmanned cleaning equipment can clean it after determining the cleaning route.
  • the target image in S101 may specifically be any image captured for the region to be detected.
  • the process of this method can be applied to any electronic device. Therefore, specifically, the electronic device can shoot target images for the area to be detected through its own camera device; The target image is captured in the area, and then transmitted to the electronic device to execute the above-mentioned method flow for garbage detection.
  • the method flow can be applied to unmanned cleaning equipment, specifically, a mobile unmanned cleaning vehicle.
  • the unmanned cleaning equipment can be equipped with a camera device to facilitate garbage detection. Therefore, the unmanned cleaning equipment itself can take pictures of the area to be detected to obtain target images.
  • a high-altitude camera or a drone can take target images of the area to be detected, and then transmit the target images to unmanned cleaning equipment for garbage detection.
  • the UAV can shoot from a top-down perspective.
  • acquiring a target image taken for the area to be detected may specifically include: acquiring a target image taken by other devices for the area to be detected; or acquiring a target image taken by itself for the area to be detected.
  • the captured target image may include all regions to be detected, or some regions to be detected.
  • the position of the garbage can only be determined based on the preset area contained in the target image.
  • an image captured in advance for the region to be detected may be determined as the target image, or an image captured in real time for the region to be detected may be determined as the target image.
  • acquiring a target image taken for the area to be detected may specifically include: acquiring a target image taken in real time for the area to be detected; or acquiring a target image taken in advance for the area to be detected.
  • the shooting result optionally, there may be one or more target images.
  • the garbage itself is not necessarily fixed at the same position, and the location of the garbage may change at any time. For example, discarded cans were kicked away, paper scraps and fallen leaves were blown away by the wind, etc.
  • multiple target images may be obtained, so as to perform garbage detection and garbage location based on the multiple target images.
  • Different target images can contain different parts of the area to be detected, so that multiple parts of the area to be detected can be covered, and garbage detection and garbage location can be performed from different angles to improve the accuracy of garbage detection and garbage location.
  • multiple images taken continuously for the region to be detected may be acquired, or multiple images taken for the region to be detected within a preset time period may be acquired.
  • acquiring a target image taken for the region to be detected may include: acquiring a plurality of target images taken for the region to be detected; or acquiring a plurality of target images taken for the region to be detected within a preset time period; Or acquire multiple target images shot continuously for the area to be detected.
  • the process of the method can be executed by acquiring multiple target images, so as to improve the accuracy of garbage detection and garbage location.
  • the flow of the method does not limit the method for specifically determining the position of the preset area in the target image.
  • the position of the area to be detected mapped in the target image can be determined according to the pose of the target image when shooting the area to be detected, and further can be determined according to the actual position of the preset area contained in the area to be detected The location of the preset area map in the target image.
  • determining the position of the divided preset area in the target image may include: determining the position, height and shooting angle of the camera when shooting the target image; determining the position of each preset area in the area to be detected; According to the position, height and shooting angle of the camera device, and the position of each preset area, the position of each preset area in the target image is determined.
  • the actual position corresponding to the boundary of the captured target image can be determined, so that the distance between the actual position corresponding to the boundary of the target image and the actual position of the preset area can be determined.
  • the positional relationship further determines the position of the preset area in the target image.
  • the position of the preset area may also be characterized by the positions of multiple points.
  • the position of the preset area may be represented by the positions of four vertices.
  • the position of the camera device in three-dimensional space can be determined according to the position and height of the camera device, so that the points used to represent the position of the preset area can be connected to the camera device, and then the points used to characterize the position of the preset area can be determined according to the shooting angle.
  • the position of the point in the captured target image, so that the position of the preset area in the target image can be determined.
  • FIG. 2 it is a schematic diagram of a principle of a preset area mapping method provided by an embodiment of this specification. There are two preset area mapping methods provided.
  • the area to be detected may be pre-divided into 4 square preset areas.
  • FIG. 2 only shows the situation of mapping for preset area 1 .
  • the position of the preset area 1 is represented by coordinates. Specifically (0,0), (0,1), (1,0) and (1,1).
  • a preset area mapping method may be to photograph the area to be detected through the top view angle of the camera device.
  • the position of the camera is (0,0)
  • the height is 2, and the shooting angle is 90 degrees. Therefore, for the captured square target image 1, it can be determined that the actual positions corresponding to the boundary of the target image 1 are (2,2), (2,-2), (-2,2) and (-2,-2 ).
  • the corresponding position of the preset area 1 in the target image 1 can be determined according to the positional relationship between the position of the preset area 1 and the actual position of the boundary of the target image 1 .
  • Another preset area mapping method may be to determine the position of the camera in three-dimensional space according to the position and height of the camera. Specifically, the position of the camera in the three-dimensional space may be determined according to the position (0, -2) and the height 1 of the camera. After that, the range mapped by the target image 2 can be determined according to the shooting angle of 90 degrees. Wherein, it can be determined that the actual position (0, -1) falls on one of the boundaries of the target image 2 .
  • determining the position of the preset area in the target image may also be done in other ways.
  • the position of the preset area can be identified by means of features in the area to be detected. Specifically, for a rectangular parking space drawn with a white line, the position of the preset area in the target image can be determined by identifying the position of the white line.
  • the positional relationship between the camera device and the area to be detected can be determined through the relevant information of the camera device, and then the position of the preset area in the target image can be accurately determined, which facilitates subsequent garbage positioning.
  • the position of the imaging device in the UTM coordinate system can be determined, and the position of the preset area in the UTM coordinate system can be determined. According to the relationship between the positions, it can be determined that the preset area is at location in the target image.
  • a garbage detection method is used to determine a garbage detection result.
  • the pre-trained garbage detection model can be used for detection.
  • preprocessing operations need to be performed on the target image.
  • the preprocessing operations may include operations such as scaling, normalization, and cropping.
  • preprocessing may be performed on the target image; the preprocessing result is input into the pre-trained garbage detection model, and the garbage detection result is determined according to the output of the garbage detection model.
  • the target image can be cropped to retain the preset area in the target image.
  • the amount of data input into the garbage detection model can be reduced, thereby reducing the loss of computing resources and improving the efficiency of garbage detection.
  • the preprocessing may include: cropping the target image, and retaining a preset area in the target image.
  • the preprocessing may also include: scaling the target image.
  • scaling the target image the resolution of the image can be reduced, and the amount of data input to the garbage detection model can be reduced, thereby reducing the consumption of computing resources and improving the efficiency of garbage detection.
  • the preprocessing may also include: performing normalization processing on the RGB channel data in the target image, so that it is convenient to input the preprocessing result into the garbage detection model for subsequent detection by the garbage detection model.
  • the garbage detection model may specifically be constructed using a deep convolutional neural network.
  • These can include base feature networks for extracting image features and detection heads for spam detection.
  • the framework of the garbage detection model may adopt frameworks such as SSD, RetinaNet, CenterNet or YoLo.
  • frameworks such as SSD, RetinaNet, CenterNet or YoLo.
  • the framework of YoLov5 can be used for construction.
  • garbage detection there are many specific problems. Specifically, it can include: the number of garbage samples is small, and the garbage itself is small. Therefore, based on the characteristics of the specific scene of garbage detection, the adaptability can be adjusted according to the needs of the garbage detection scene, and the garbage detection model can be adjusted.
  • the garbage detection model itself can perform feature extraction by scaling the input image data.
  • feature pyramid networks For example, feature pyramid networks.
  • the degree of zooming can be limited, so that when zooming the image data, the loss of the image features corresponding to the garbage can be avoided as far as possible, thereby improving the effect of the garbage detection model.
  • the scaling ratio of the zoomed image data may be limited, and the resolution of the zoomed image data may also be limited.
  • the garbage detection model is used to perform garbage detection on at least one or more scaled copies of the target image; wherein, any scaled copy may have an image resolution greater than a preset resolution, or a scale ratio may be greater than a preset scale ratio .
  • the garbage detection model may include a feature pyramid network.
  • a typical feature pyramid network can include 2, 3, 4, and 5 layers for extracting features through scaling. Specifically, 2 layers can be used to scale the input image data by 4 times, 3 layers can be used to scale the input image data by 8 times, 4 layers can be used to scale the input image data by 16 times, and 5 layers can be used for Scales by a factor of 32 for the input image data.
  • the feature pyramid network in the garbage detection model may only include 2, 3, and 4 layers, so as to limit the scaling and avoid loss of image features of garbage.
  • the image features of the garbage in the target image can be avoided by limiting the zoom ratio or the zoomed image resolution, thereby improving the detection effect of the garbage detection model and improving the accuracy of garbage detection.
  • the number of garbage detection frames containing garbage is usually far less than that of non-garbage detection frames. Therefore, when training the garbage detection model, in the training sample set, usually The number of positive samples (junk detection boxes) is much less than negative samples (non-junk detection boxes).
  • Focus loss can determine the weights of positive and negative samples separately, increase the weight of a small number of positive samples, and reduce the weight of a large number of negative samples, so as to improve the training efficiency, training effect and garbage detection accuracy of the garbage detection model.
  • the loss function in the garbage detection model can include focal loss.
  • the focus loss can be used to increase the weight of image samples labeled with garbage detection boxes.
  • the weight of positive samples can be increased by introducing focal loss, so as to improve the training efficiency, training effect and garbage detection accuracy of the garbage detection model.
  • the image samples marked with garbage detection frames are difficult to label, and the acquired number is small. Therefore, the number of training samples in the garbage detection scene is small.
  • the basic feature network can be included in the garbage detection model, it is used to extract image features.
  • other labels similar to garbage can be introduced to train the basic feature network. For example, obstacles.
  • the training method of the garbage detection model may include: determining the image sample marked with the obstacle detection frame label as the image sample marked with the garbage detection frame label, and training the basic feature network included in the garbage detection model.
  • the obstacle detection frame is easy to label, and has more application scenarios, and the number of samples that can be obtained is larger. It can be used to increase the number of samples for training the basic feature network and improve the representation ability of the basic feature network.
  • the obstacle detection frame label and the garbage detection frame label can be used together to train the basic feature network to improve the representation ability, and then the same basic feature network can be used for garbage detection and obstacle detection to reduce the loss of computing resources.
  • the output of the garbage detection model usually includes a garbage detection frame, which can be used to mark the detected garbage in the target image, and can have a confidence level, that is, the marked image part Contains the credibility of garbage.
  • the garbage detection model can also be used to identify the type of the detected garbage, for example, can identify the type of garbage contained in the garbage detection frame, which can specifically include: paper scraps, leaves, plastic bags, boxes, etc. Specifically, the type of garbage may be further identified for the detected garbage detection frame.
  • the garbage detection frame output by the garbage detection model may also have the recognized garbage type.
  • the output garbage detection frame may be directly determined as the garbage detection result.
  • garbage detection frames with a confidence level lower than a preset confidence level may be deleted, or similar garbage detection frames may be considered as the same garbage detection frame.
  • the garbage detection model may output multiple similar garbage detection frames for the same garbage. In order to filter these repeated detection results, filtering may be performed according to the intersection ratio between different garbage detection frames.
  • intersection ratio between different garbage detection frames may specifically be the ratio of the overlap area between two garbage detection frames to the merged area.
  • using a pre-trained garbage detection model to determine the garbage detection result may include: the output of the garbage detection model is a garbage detection frame, and the output garbage detection frame has a degree of confidence; In order to traverse the garbage detection frame output by the garbage detection model; if the intersection ratio between the currently traversed garbage detection frame and any other garbage detection frame is greater than the preset intersection ratio, delete the other garbage detection frame ; After the traversal, determine the remaining garbage detection frames as garbage detection results.
  • multiple target images taken at the same location for the area to be detected can be obtained, so that multiple target images can be used for multiple garbage detections, and the garbage detection results can be determined comprehensively .
  • it may be a plurality of target images taken continuously at the same position for the region to be detected, or a plurality of target images taken periodically or irregularly at the same position for the region to be detected.
  • the garbage detection frames detected in different target images can be compared.
  • the garbage detection frame can be determined as the garbage detection result; if the garbage detection frame is only detected in one target image, while other target images If none of them can be detected, the garbage detection frame may not be determined as a garbage detection result.
  • the garbage detection frame can be determined as the garbage detection result; If two preset numbers of target images are detected, the garbage detection frame may not be determined as a garbage detection result, and specifically, the garbage detection frame may be deleted; the second preset number may be smaller than the first preset number.
  • unreliable or repeated garbage detection frames can be filtered, thereby improving the garbage detection accuracy of the garbage detection model.
  • the preset area containing garbage can be directly determined according to the target image .
  • any detected garbage is within the range of any preset area corresponding to the location in the target image, it may be determined that the preset area contains garbage.
  • the actual garbage detection result may be a garbage detection frame, it is necessary to determine the garbage area based on the garbage detection frame.
  • the garbage detection frame may be entirely contained within the position range of any preset area, or may be located within the position range of different preset areas. Specifically, the garbage area may be determined according to the center point of the garbage detection frame or the degree of overlap with the preset area.
  • the garbage detection result is a garbage detection frame
  • determining a preset area where garbage exists as a garbage area may include: setting the center point of any garbage detection frame The preset area where it is located is determined as a garbage area; or the preset area whose coincidence degree with any garbage detection frame satisfies the preset coincidence condition is determined as a garbage area.
  • the preset coincidence condition may include: the coincidence degree is greater than the preset coincidence degree, or the coincidence degree is the highest.
  • FIG. 3 it is a schematic diagram of the principle of a method for determining a garbage area provided by an embodiment of this specification.
  • It includes 4 preset regions mapped to the position range in the target image and 2 garbage detection frames, which are preset regions 1-4 and garbage detection frames 1-2 respectively.
  • the preset areas are marked with numbers 1-4.
  • the center point of the garbage detection frame 1 is located in the preset area 2, it can be determined that there is garbage in the preset area 2, and the preset area 2 is a garbage area.
  • the center point of the garbage detection frame 2 is the preset area 3, and it can be determined that there is garbage in the preset area 3, and the preset area 3 is a garbage area.
  • the preset area where garbage exists can be determined, and the detected garbage can be located efficiently, quickly and accurately, which is convenient for follow-up Cleaning route planning saves computing resources and improves computing efficiency.
  • the garbage area in order to improve the accuracy of determining the garbage area, the garbage area may be comprehensively determined according to the garbage detection results of multiple target images.
  • acquiring a target image taken for the region to be detected may include: acquiring a plurality of target images taken for the region to be detected; or acquiring a plurality of target images taken for the region to be detected within a preset time period; Or acquire multiple target images shot continuously for the area to be detected.
  • the acquired multiple target images are not necessarily taken at the same position, and may respectively contain different parts of the region to be detected.
  • any preset area only detects the presence of garbage in one target image, but does not detect the presence of garbage in other target images, then the detection result may be wrong, or the position of the garbage has changed. Therefore, you can The preset area is not determined as a garbage area.
  • these multiple target images may be obtained by shooting the area to be detected from different positions. Then, there is likely to be garbage in the preset area, and the preset area can be determined as the garbage area.
  • determining the preset area with garbage as the garbage area may include: if any preset area is in the garbage detection result determined for the target image of the preset number of images, all If garbage exists, the preset area may be determined as the garbage area.
  • the accuracy of the garbage area can be improved by using the garbage detection results of multiple target images.
  • the above-mentioned embodiment can be used to determine the position of the preset area in the target image, so as to facilitate the positioning of the detected garbage, and it is also convenient for the subsequent unmanned cleaning equipment to plan cleaning routes. Garbage is cleaned up.
  • the cleaning route can be further determined in the process of the above method.
  • cleaning may be performed on the detected garbage.
  • unmanned cleaning equipment can detect and locate garbage based on local computing resources, and move and clean after determining the cleaning route.
  • the process of the method may further include S105: determining a garbage area to be cleaned, and determining a cleaning route according to the garbage area to be cleaned.
  • the determined cleaning route may include a garbage area to be cleaned.
  • S105 may be performed after determining the garbage area, specifically, it may be performed after S104.
  • the garbage area After the garbage area is determined, it is usually necessary to clean it by cleaning equipment and plan the cleaning route. To plan the cleaning route, it is necessary to determine the garbage area to be cleaned.
  • the garbage area to be cleaned may specifically be a garbage area that needs to be cleaned later.
  • each determined garbage area may be determined as a garbage area to be cleaned.
  • the garbage area that meets the requirements may also be determined as the garbage area to be cleaned.
  • the garbage area containing a large amount of garbage may be determined as the garbage area to be cleaned, or the garbage area containing a specific type of garbage may be determined as the garbage area to be cleaned.
  • the determined garbage area needs to be cleaned as a whole.
  • the cleaning route is determined.
  • a route passing through all the garbage areas to be cleaned may be determined.
  • start from any garbage area to be cleaned randomly select an unpassed garbage area from other nearest garbage areas to be cleaned, move to the selected garbage area, and perform overall cleaning.
  • FIG. 4 it is a schematic diagram of the principle of cleaning route planning provided by the embodiment of this specification. It includes preset areas 1-9, and each preset area is marked by a number contained therein, and preset areas 1, 3, 4, and 9 are determined as garbage areas.
  • the nearest preset area 4 can be determined and moved to the preset area 4; since the distance between the preset area 4 and the preset areas 3 and 9 is the same, the preset area can be randomly selected Area 3, move to preset area 3, and then move to preset area 9.
  • the cleaning route can be determined quickly and efficiently based on the garbage area where the garbage is located and determined based on the garbage location, so as to avoid the loss of computing resources. Especially in unmanned cleaning equipment, it can save local computing resources of unmanned cleaning equipment.
  • different cleaning methods may also be determined for different types of garbage.
  • the cleaning method can be determined according to the type of garbage identified by the garbage detection model.
  • the above-mentioned method flow may also include: obtaining the corresponding relationship between garbage types and cleaning methods; according to the determined garbage detection results, determining the types of garbage contained in the garbage area; the garbage detection model can also be used to detect garbage types ; Determine the corresponding cleaning method according to the type of garbage contained in any garbage area.
  • one or more corresponding cleaning methods may be determined.
  • different cleaning methods may have priorities, so that the cleaning method with the highest priority may be selected; optionally, each determined cleaning method may be used to clean once to improve the cleaning effect.
  • a corresponding cleaning method can be determined, so that subsequent cleaning can be facilitated, and the cleaning of garbage can be more convenient and thorough.
  • the cleaning method can be determined quickly and efficiently according to the type of garbage contained in each garbage area, so that when the unmanned cleaning equipment specifically cleans any garbage area, Use the corresponding cleaning method to clean to improve cleaning efficiency.
  • obstacles may be further determined.
  • the unmanned sweeper For example, for an unmanned sweeper, it is necessary to avoid obstacles while cleaning up garbage. Therefore, for the area that needs to be cleaned, the unmanned sweeper needs to perform both garbage detection and obstacle detection.
  • target detection may be used for obstacle detection, and an obstacle detection model may be used to determine obstacles in the target image; laser radar or the like may also be used for scanning or the like.
  • multiple obstacle detection methods can be used, and the detection results of multiple obstacle detection methods can be combined to determine a preset area where an obstacle exists, that is, an obstacle area, so that Use unmanned cleaning equipment to avoid obstacle areas.
  • the detection results of multiple obstacle detection methods may be used as the obstacle detection results to determine the obstacle area.
  • using laser radar to scan for obstacles may be based on the point cloud data acquired by laser radar to determine a preset area where obstacles exist.
  • the ground plane points are obtained according to the ground plane fitting method, and the remaining points are used as obstacle points. Then the three-dimensional obstacle point cloud is projected into the target image through the projection formula, and the number of obstacle points is counted for the preset area. If it is greater than the threshold, it is considered as an obstacle area with obstacles.
  • obstacles can be determined by using a target detection method.
  • the obstacle detection results based on images and point cloud data can be fused to determine the combined obstacle detection results, so as to facilitate the determination of obstacle areas where obstacles exist.
  • the execution sequence of obstacle detection and garbage detection can be executed in parallel or sequentially. This embodiment is not limited.
  • the detected obstacle may be positioned according to the obstacle detection result, specifically, a preset area where the obstacle exists may be determined as the obstacle area.
  • the obstacle area may be a preset area where obstacles exist.
  • the determination of the obstacle area and the garbage area may be performed in parallel or sequentially, which is not limited in this embodiment.
  • the determination of the garbage area is the garbage detected by the positioning, and the garbage detected by the positioning is usually used to plan the cleaning route, and the obstacle area usually needs to be avoided, so it can be determined according to the determined garbage area and the obstacle area.
  • Cleaning route the determined cleaning route can pass through the garbage area that needs to be cleaned, and will not pass through any obstacle area.
  • the cleaning route can be planned from parking space 2 to parking space 4 and then to parking space 5. Each parking space needs to be cleaned as a whole.
  • a preset area which is determined as both a garbage area and an obstacle area.
  • the preset area can be determined as both a garbage area and an obstacle area.
  • the garbage area determined as the obstacle area may not be considered.
  • determining the garbage area that needs to be cleaned may specifically include: determining the garbage area in the non-obstacle area as the garbage area that needs to be cleaned, so that the cleaning route can be planned only for the garbage area in the non-obstacle area.
  • a preset area that contains garbage and belongs to the non-obstacle area may also be determined as the garbage area according to the pre-determined obstacle area.
  • the above method flow may further include S106: Detecting obstacles in the area to be detected, and determining a preset area where obstacles exist as an obstacle area.
  • determining the preset area where garbage is detected as the garbage area according to the determined garbage detection result may include: determining the non-obstacle area where garbage is detected as the garbage area according to the determined garbage detection result .
  • determining the garbage area to be cleaned may include: determining the garbage area in the non-obstacle area as the garbage area to be cleaned.
  • the cleaning route it is also possible to determine the garbage area belonging to the obstacle area and the garbage area in the non-obstacle area, so that the cleaning route can be determined according to the garbage area in the non-obstacle area, so that the planned cleaning route includes non-obstacle areas.
  • the garbage area of the area does not include the garbage area that belongs to the obstacle area, and does not include any obstacle area.
  • obstacle detection can be further combined to help plan cleaning routes and improve garbage cleaning efficiency.
  • the image content contained in the obstacle area in the target image can be directly deleted, and garbage detection is performed on the deleted target image, which can save computing resources.
  • obstacle detection may be performed by a target detection method. Therefore, detecting an obstacle in the region to be detected may include: using a pre-trained obstacle detection model to determine an obstacle detection result for the target image.
  • the labels marked with The image samples of the obstacle detection frame label, and the image samples marked with the garbage detection frame label jointly train the basic feature network of the obstacle detection model and the garbage detection model, and obtain the same basic feature network, which can improve the representation of the basic feature network ability, improve the training effect of obstacle detection model and garbage detection model, and save computing resources.
  • the detection head of the obstacle detection model only the image samples marked with the obstacle detection frame label need to be used for training, and the parameters of the basic feature network can be fixed.
  • the basic feature networks included in the obstacle detection model and the garbage detection model are trained using the same training sample set, and the trained basic feature networks are the same.
  • the training sample set may include: image samples marked with obstacle detection frame labels, and image samples marked with garbage detection frame labels.
  • the garbage detection model in the embodiment of this specification can be trained by collecting data of different garbage in different scenarios, and output the garbage detection frame and garbage category in the detection head.
  • the method of sharing the basic feature network with the obstacle detection model but independently training the detection head can be used .
  • FIG. 5 it is a schematic schematic diagram of a model structure provided by an embodiment of this specification.
  • the obstacle detection model and the garbage detection model share the basic feature network.
  • the feature extraction of the basic feature network can only be performed once without performing separate executions, thereby saving computing resources and improving computing speed and efficiency.
  • the basic feature network occupies the most computing resources in the deep learning model, and sharing this part of the calculation can greatly reduce the consumption of computing resources.
  • the shared basic features can also greatly reduce the need for separate training data for garbage detection, so as to achieve the target accuracy faster.
  • the specific way to train the detection model of the shared basic feature network is to train a detection model together on the obstacle and garbage detection data to obtain the common basic feature network parameters.
  • both the obstacle detection frame label and the garbage detection frame label can be regarded as the target detection frame label, which is used to train a detection model and obtain the basic feature network parameters.
  • a garbage detection model and an obstacle detection model can be constructed respectively.
  • the basic feature network parameters can be fixed during the training process, and the detection head of the obstacle detection model can be trained using the obstacle data. part, use the garbage detection data to train the detection head of the garbage detection model.
  • a more accurate and suitable cleaning route can be further determined.
  • the process of the above method may further include: determining a garbage area that needs to be cleaned and an obstacle area that needs to be avoided, and determining a cleaning route based on the determined garbage area and obstacle area.
  • FIG. 6 it is a schematic diagram of another cleaning route planning provided by the embodiment of this specification.
  • Preset areas 1-9 each preset area is marked by a number contained therein.
  • Preset areas 1, 3, 4, and 9 are determined as garbage areas, and preset areas 5 and 6 are determined as obstacle areas.
  • the nearest preset area 4 can be determined and moved to the preset area 4; since the distance between the preset area 4 and the preset areas 3 and 9 is the same, the preset area can be randomly selected Area 3, moving to the preset area 3, since moving from the preset area 4 to the preset area 3 in a straight line will pass through the preset area 5 (obstacle area), therefore, it can go around through the preset areas 1 and 2.
  • the preset areas 5 and 6 are obstacle areas, it is possible to detour from outside the preset area 6, thereby obtaining a cleaning route.
  • the unmanned cleaning equipment can take pictures of the area to be detected through its own camera device to obtain the target image.
  • the area to be detected may be a hall of a shopping mall.
  • the area to be detected is pre-divided into multiple preset areas, and each preset area is a square floor tile in the hall of the shopping mall.
  • Unmanned cleaning equipment can detect garbage and obstacles at the same time.
  • the target image can be input into the basic feature network, and then the image features output by the basic feature network can be input into the detection head and obstacle in the garbage detection model.
  • the detection head in the object detection model determines the garbage detection result and the obstacle detection result.
  • obstacles may be pedestrians, goods, and the like.
  • the unmanned cleaning device can also determine the position of the preset area in the area to be detected in the target image, specifically, it can determine the position of the square floor tiles in the hall of the shopping mall in the target image.
  • the unmanned cleaning equipment can determine the square floor tiles with garbage and the square floor tiles with obstacles, and then plan the cleaning route to avoid obstacles Clean the square floor tiles with rubbish.
  • the preset area can be mapped to the target image, which is convenient for garbage positioning, so that it can serve unmanned cleaning, and the obtained garbage positioning
  • the information can be used by unmanned sweepers for efficient garbage cleaning path planning.
  • the garbage detection model can also share the basic feature network with the obstacle detection model, thereby reducing computing resource consumption, reducing training data requirements, and improving representation capabilities.
  • the embodiment of this specification also provides an apparatus embodiment.
  • FIG. 7 it is a schematic structural diagram of a garbage detection device provided in the embodiment of this specification.
  • the rubbish detection device may include the following units.
  • the obtaining unit 201 is configured to obtain a target image taken for the region to be detected.
  • the mapping unit 202 is configured to determine the position of the divided preset area in the target image.
  • the detection unit 203 is configured to determine a garbage detection result by using a pre-trained garbage detection model for the target image.
  • the positioning unit 204 is configured to determine a preset area where garbage exists as a garbage area according to the determined garbage detection result.
  • the mapping unit 202 can be used to: determine the position, height and shooting angle of the camera when shooting the target image; determine the position of each preset area in the area to be detected; according to the position, height and shooting angle of the camera , and the position of each preset area to determine the position of each preset area in the target image.
  • the detection unit 203 may include: a preprocessing subunit 203a, configured to perform preprocessing on the target image.
  • the detection subunit 203b is configured to input the preprocessing result into the pre-trained garbage detection model, and determine the garbage detection result according to the output of the garbage detection model.
  • the preprocessing subunit 203a may be configured to: crop the target image, and retain a preset area in the target image.
  • the garbage detection model is at least used to perform garbage detection on one or more scaled copies of the target image; wherein, any scaled copy has an image resolution greater than a preset resolution, or a scale ratio greater than a preset scale ratio.
  • the loss function in the garbage detection model includes a focus loss; the focus loss is used to increase the weight of image samples marked with garbage detection frame labels.
  • the garbage detection model may include a basic feature network; the training method of the garbage detection model may include: determining an image sample marked with an obstacle detection frame label as an image sample marked with a garbage detection frame label, and training the garbage detection model Included base feature network.
  • the output of the garbage detection model is a garbage detection frame, and the output garbage detection frame has a confidence level; the detection unit 203 may include: a traversal subunit 203c for traversing the garbage detection The garbage detection box output by the model.
  • the deletion subunit 203d is used to delete the other garbage detection frame when the intersection ratio between the currently traversed garbage detection frame and any other garbage detection frame is greater than the preset intersection ratio; after the traversal, the The remaining garbage detection boxes are determined as garbage detection results.
  • the garbage detection result is a garbage detection frame
  • the positioning unit 204 can be used to: determine the preset area where the center point of any garbage detection frame is located as the garbage area; or determine the coincidence degree with any garbage detection frame The preset area that satisfies the preset coincidence condition is determined as a garbage area.
  • the acquiring unit 201 can be used to: acquire multiple target images taken for the area to be detected; or acquire multiple target images taken for the area to be detected within a preset time period; or acquire continuous shooting of the area to be detected multiple target images.
  • the positioning unit 204 may be configured to: if any preset area contains garbage in the garbage detection results determined for the preset number of target images, determine the preset area as a garbage area.
  • the garbage detection device may further include: a cleaning route determining unit 205, configured to determine a garbage area to be cleaned, and determine a cleaning route according to the garbage area to be cleaned.
  • a cleaning route determining unit 205 configured to determine a garbage area to be cleaned, and determine a cleaning route according to the garbage area to be cleaned.
  • the garbage detection device may also include: a cleaning mode determination unit 206, configured to obtain the correspondence between garbage types and cleaning modes; according to the determined garbage detection results, determine the types of garbage contained in the garbage area; the garbage detection model It is also used to detect the type of garbage; according to the type of garbage contained in any garbage area, determine the corresponding cleaning method.
  • a cleaning mode determination unit 206 configured to obtain the correspondence between garbage types and cleaning modes; according to the determined garbage detection results, determine the types of garbage contained in the garbage area; the garbage detection model It is also used to detect the type of garbage; according to the type of garbage contained in any garbage area, determine the corresponding cleaning method.
  • the garbage detection device may further include: an obstacle detection unit 207, configured to detect obstacles in the area to be detected, and determine a preset area where obstacles exist as an obstacle area.
  • an obstacle detection unit 207 configured to detect obstacles in the area to be detected, and determine a preset area where obstacles exist as an obstacle area.
  • the positioning unit 204 may be configured to: determine the non-obstacle area in which garbage is detected as the garbage area according to the determined garbage detection result.
  • the obstacle detection unit 207 may be configured to: use a pre-trained obstacle detection model to determine an obstacle detection result for the target image.
  • the basic feature network included in the obstacle detection model and the garbage detection model can be trained using the same training sample set, and the trained basic feature network is the same;
  • the training sample set can include: an image marked with an obstacle detection frame label samples, and image samples annotated with spam detection box labels.
  • the embodiment of this specification also provides a computer device, which can be specifically an unmanned cleaning device, which at least includes a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor executes the program When implementing a garbage detection method in any one of the above method embodiments.
  • FIG. 8 shows a schematic diagram of a more specific hardware structure of a computer device provided by the embodiment of this specification.
  • the device may include: a processor 1010 , a memory 1020 , an input/output interface 1030 , a communication interface 1040 and a bus 1050 .
  • the processor 1010 , the memory 1020 , the input/output interface 1030 and the communication interface 1040 are connected to each other within the device through the bus 1050 .
  • the processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute related programs to realize the technical solutions provided by the embodiments of this specification.
  • a general-purpose CPU Central Processing Unit, central processing unit
  • a microprocessor an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits
  • ASIC Application Specific Integrated Circuit
  • the memory 1020 can be implemented in the form of ROM (Read Only Memory, read-only memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, etc.
  • the memory 1020 can store operating systems and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and invoked by the processor 1010 for execution.
  • the input/output interface 1030 is used to connect the input/output module to realize information input and output.
  • the input/output/module can be configured in the device as a component (not shown in the figure), or can be externally connected to the device to provide corresponding functions.
  • the input device may include a keyboard, mouse, touch screen, microphone, various sensors, etc.
  • the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
  • the communication interface 1040 is used to connect a communication module (not shown in the figure), so as to realize the communication interaction between the device and other devices.
  • the communication module can realize communication through wired means (such as USB, network cable, etc.), and can also realize communication through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
  • Bus 1050 includes a path that carries information between the various components of the device (eg, processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
  • the above device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components.
  • the above-mentioned device may only include components necessary to implement the solutions of the embodiments of this specification, and does not necessarily include all the components shown in the figure.
  • the embodiment of this specification also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, a garbage detection method in any of the above method embodiments is implemented.
  • Computer-readable media including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, A magnetic tape cartridge, disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
  • a typical implementing device is a computer, which may take the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, e-mail device, game control device, etc. desktops, tablets, wearables, or any combination of these.
  • each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments.
  • the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiment.
  • the device embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated, and the functions of each module may be integrated in the same or multiple software and/or hardware implementations. Part or all of the modules can also be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

Disclosed in the present description are a garbage detection method and apparatus. An area to be subjected to detection is divided into at least two preset areas in advance. The method comprises: acquiring a target image which is captured for an area to be subjected to detection; determining positions of preset areas, which are obtained by dividing said area, in the target image; for the target image, determining a garbage detection result by using a pre-trained garbage detection model; and according to the determined garbage detection result, determining a preset area where garbage is present to be a garbage area.

Description

垃圾检测Spam detection 技术领域technical field
本说明书实施例涉及目标检测领域,尤其涉及用于垃圾检测的方法和装置。The embodiments of this specification relate to the field of object detection, and in particular to methods and devices for garbage detection.
背景技术Background technique
针对垃圾检测,通常是针对待清扫的区域拍摄图像后,利用垃圾检测技术确定出所拍摄图像中的垃圾,具体可以使用垃圾检测框进行标注。For garbage detection, usually after taking an image of the area to be cleaned, the garbage detection technology is used to determine the garbage in the captured image, which can be marked with a garbage detection frame.
虽然目前的垃圾检测技术可以检测出图像中的垃圾,却难以进一步确定所检测出的垃圾具体位置,准确度较低。Although the current garbage detection technology can detect the garbage in the image, it is difficult to further determine the specific location of the detected garbage, and the accuracy is low.
发明内容Contents of the invention
为了解决上述技术问题,本说明书提供了用于垃圾检测的方法和装置。技术方案如下所示。In order to solve the above technical problems, this specification provides a method and device for garbage detection. The technical scheme is as follows.
一种垃圾检测方法,预先将待检测区域划分为至少两个预设区域;所述方法包括:获取针对所述待检测区域拍摄的目标图像;确定所划分的预设区域在所述目标图像中的位置;针对所述目标图像,利用预先训练的垃圾检测模型确定垃圾检测结果;根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域。A garbage detection method, which divides an area to be detected into at least two preset areas in advance; the method includes: acquiring a target image taken for the area to be detected; determining that the divided preset area is in the target image position; for the target image, using a pre-trained garbage detection model to determine a garbage detection result; according to the determined garbage detection result, determine a preset area where garbage exists as a garbage area.
一种垃圾检测装置,预先将待检测区域划分为至少两个预设区域;所述装置包括:获取单元,用于获取针对所述待检测区域拍摄的目标图像;映射单元,用于确定所划分的预设区域在所述目标图像中的位置;检测单元,用于针对所述目标图像,利用预先训练的垃圾检测模型确定垃圾检测结果;定位单元,用于根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域。A garbage detection device, which divides an area to be detected into at least two preset areas in advance; the device includes: an acquisition unit, used to acquire a target image taken for the area to be detected; a mapping unit, used to determine the divided The position of the preset area in the target image; the detection unit is used to determine the garbage detection result by using the garbage detection model trained in advance for the target image; the positioning unit is used to determine the garbage detection result according to the determined garbage detection result. A preset area where garbage exists is determined as a garbage area.
上述技术方案,可以通过确定预设区域在目标图像中的位置,从而方便根据目标图像的垃圾检测结果,确定存在垃圾的预设区域,高效、快速、准确地确定出垃圾的位置,减少计算资源的损耗。The above technical solution can determine the position of the preset area in the target image, so as to facilitate the determination of the preset area where garbage exists according to the garbage detection result of the target image, efficiently, quickly and accurately determine the position of the garbage, and reduce computing resources loss.
附图说明Description of drawings
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments described in the embodiments of this specification, and those skilled in the art can also obtain other drawings based on these drawings.
图1是本说明书实施例提供的一种垃圾检测方法的流程示意图;Fig. 1 is a schematic flow chart of a garbage detection method provided by the embodiment of this specification;
图2是本说明书实施例提供的一种预设区域映射方法的原理示意图;Fig. 2 is a schematic diagram of the principle of a preset area mapping method provided by the embodiment of this specification;
图3是本说明书实施例提供的一种垃圾区域确定方法的原理示意图;Fig. 3 is a schematic diagram of the principle of a garbage area determination method provided by the embodiment of this specification;
图4是本说明书实施例提供的一种清扫路线规划的原理示意图;Fig. 4 is a schematic diagram of the principle of cleaning route planning provided by the embodiment of this specification;
图5是本说明书实施例提供的一种模型结构的原理示意图;Fig. 5 is a schematic diagram of the principle of a model structure provided by the embodiment of this specification;
图6是本说明书实施例提供的另一种清扫路线规划的原理示意图;Fig. 6 is a schematic diagram of the principle of another cleaning route planning provided by the embodiment of this specification;
图7是本说明书实施例提供的一种垃圾检测装置的结构示意图;Fig. 7 is a schematic structural diagram of a garbage detection device provided by an embodiment of this specification;
图8是用于配置本说明书实施例方法的一种设备的结构示意图。Fig. 8 is a schematic structural diagram of a device for configuring the method of the embodiment of the present specification.
具体实施方式Detailed ways
为了使本领域技术人员更好地理解本说明书实施例中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行详细地描述,显然,所描述的实施例仅仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于公开的范围。In order for those skilled in the art to better understand the technical solutions in the embodiments of this specification, the technical solutions in the embodiments of this specification will be described in detail below in conjunction with the drawings in the embodiments of this specification. Obviously, the described implementation Examples are only some of the embodiments in this specification, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this specification shall fall within the scope of the disclosure.
目标检测是一种重要的感知技术。例如,在无人驾驶领域,可以针对无人驾驶汽车,检测行驶路线上的障碍物,具体可以包括其他汽车、行人、自行车、摩托车等等,基于检测结果可以作出正确的行驶决策。例如停止,避让或绕行。Object detection is an important perception technique. For example, in the field of unmanned driving, obstacles on the driving route can be detected for unmanned vehicles, specifically including other cars, pedestrians, bicycles, motorcycles, etc., and correct driving decisions can be made based on the detection results. Such as stopping, avoiding or going around.
其中,目标检测所检测的目标可以是障碍物,也可以是其他物体。例如,垃圾检测。Wherein, the target detected by the target detection may be an obstacle or other objects. For example, spam detection.
在一种具体的示例中,可以由无人清扫车针对待清扫的区域进行垃圾检测,检测待清扫区域中的垃圾,从而可以规划无人清扫车的行驶路线,以清扫检测出的垃圾。In a specific example, the unmanned sweeper can detect garbage in the area to be cleaned, and detect the garbage in the area to be cleaned, so that the driving route of the unmanned sweeper can be planned to clean up the detected garbage.
针对垃圾检测,通常是针对待清扫的区域拍摄图像后,利用垃圾检测技术确定出所拍摄图像中的垃圾,具体可以使用垃圾检测框进行标注。For garbage detection, usually after taking an image of the area to be cleaned, the garbage detection technology is used to determine the garbage in the captured image, which can be marked with a garbage detection frame.
虽然目前垃圾检测技术可以检测出图像中的垃圾,却难以进一步确定所检测出的垃圾具体位置,准确度较低。Although the current garbage detection technology can detect the garbage in the image, it is difficult to further determine the specific location of the detected garbage, and the accuracy is low.
例如,针对不同大小的纸屑,远处的大块纸屑和近处的小块纸屑,在图像中的大小可能相近,因此难以确定纸屑的位置。For example, for paper scraps of different sizes, a large piece of paper dust in the distance and a small piece of paper dust near it may have similar sizes in the image, so it is difficult to determine the position of the paper dust.
并且,定位障碍物的方法并不适合针对垃圾进行定位。例如,由于障碍物较为显著,例如行人、摩托车等,可以通过激光雷达进行扫描,通过较多的反射信息可以确定障碍物。但许多垃圾较为细小,例如纸屑、落叶等,即使检测出在图像中的位置,使用激光雷达进行扫描,针对纸屑也存在反射信息,从而难以定位纸屑。Moreover, the method for locating obstacles is not suitable for locating garbage. For example, because obstacles are more obvious, such as pedestrians, motorcycles, etc., they can be scanned by lidar, and obstacles can be determined through more reflection information. However, many garbage is relatively small, such as paper scraps, fallen leaves, etc. Even if the position in the image is detected and scanned by lidar, there is reflection information for the paper scraps, making it difficult to locate the scraps of paper.
为了解决上述技术问题,方便针对垃圾进行定位,本说明书实施例提供了一种垃圾检测方法。In order to solve the above technical problems and facilitate positioning of garbage, the embodiment of this specification provides a garbage detection method.
为了方便定位,可以预先针对待检测区域进行划分,可以划分为多个预设区域。在获取针对待检测区域拍摄的图像之后,可以确定预设区域在所拍摄图像中的位置,从而可以在检测出垃圾后,确定存在垃圾的预设区域为垃圾区域。In order to facilitate positioning, the area to be detected can be divided in advance, and can be divided into multiple preset areas. After the image taken for the area to be detected is acquired, the position of the preset area in the captured image can be determined, so that after the garbage is detected, the preset area with garbage can be determined as the garbage area.
其中,垃圾区域就是针对垃圾所确定的具体位置。当然,在同一垃圾区域中,可能存在多个垃圾。本方法无需针对每个垃圾确定位置,可以直接将存在垃圾的预设区域确定为垃圾区域,所确定的垃圾区域就是其中包含的每个垃圾的位置。Wherein, the garbage area is a specific location determined for the garbage. Of course, in the same garbage area, there may be multiple garbage. This method does not need to determine the location of each garbage, and can directly determine the preset area where garbage exists as the garbage area, and the determined garbage area is the location of each garbage contained therein.
在一种具体的示例中,确定垃圾区域之后,就可以快速高效地规划清扫路线,以便于无人清扫车沿着清扫路线进行清扫。需要说明的是,无人清扫车需要针对垃圾区域整体进行清扫。In a specific example, after the garbage area is determined, the cleaning route can be planned quickly and efficiently, so that the unmanned sweeper can clean along the cleaning route. It should be noted that the unmanned sweeper needs to clean the garbage area as a whole.
本说明书实施例提供的一种垃圾检测方法,可以通过将待检测区域划分为多个预设区域,并确定预设区域在图像中的位置,方便在检测垃圾之后,进一步在图像中确定存在垃圾的预设区域,从而可以针对垃圾进行定位。定位效率高、速度快、准确率高。The garbage detection method provided by the embodiment of this specification can divide the area to be detected into a plurality of preset areas, and determine the position of the preset area in the image, so that after detecting garbage, it is convenient to further determine the presence of garbage in the image The preset area, so that the garbage can be located. High positioning efficiency, fast speed and high accuracy.
下面结合附图,针对本说明书实施例提供的一种垃圾检测方法进行详细解释。A garbage detection method provided in the embodiment of this specification will be explained in detail below in conjunction with the accompanying drawings.
如图1所示,为本说明书实施例提供的一种垃圾检测方法的流程示意图。其中可以预先将待检测区域划分为至少两个预设区域。As shown in FIG. 1 , it is a schematic flowchart of a garbage detection method provided in the embodiment of this specification. Wherein the region to be detected can be divided into at least two preset regions in advance.
其中,待检测区域可以是需要进行垃圾检测的区域,具体可以是预先设置的一个区域。例如,针对停车场、机场大厅、商场等区域,由于需要进行清扫地面上的垃圾,因 此需要先进行垃圾检测,方便之后进行清扫。Wherein, the area to be detected may be an area where garbage detection is required, specifically, it may be a pre-set area. For example, for areas such as parking lots, airport halls, shopping malls, etc., since it is necessary to clean up the garbage on the ground, it is necessary to perform garbage detection first to facilitate cleaning later.
针对预设区域,在一种可选的实施例中,可以用于映射到需要进行垃圾检测的图像中,以便于确定检测出的垃圾的位置,即垃圾所在的预设区域,方便后续确定清扫路线。For the preset area, in an optional embodiment, it can be used to map to the image that needs to be detected for garbage, so as to determine the position of the detected garbage, that is, the preset area where the garbage is located, and facilitate subsequent determination of cleaning route.
本方法流程并不限定划分预设区域的方法。可选地,预设区域可以是人工划分的,也可以是设备自动划分的。The method flow does not limit the method of dividing the preset area. Optionally, the preset area may be divided manually or automatically by the device.
在设备自动划分预设区域的情况下,可选地,可以根据一定的尺寸标准进行划分。例如,可以将待检测区域划分为多个网格,不同格子之间大小和形状相同,而每个格子的大小可以根据图像精度、垃圾检测的精度、垃圾评价大小等因素综合确定。当然,也可以直接设定为1平方米。In the case that the device automatically divides the preset area, optionally, the division may be performed according to a certain size standard. For example, the area to be detected can be divided into multiple grids, and the size and shape of different grids are the same, and the size of each grid can be comprehensively determined according to factors such as image accuracy, garbage detection accuracy, and garbage evaluation size. Of course, it can also be directly set to 1 square meter.
在一种具体的示例中,可以确定无人清扫车在不移动的情况下的清扫范围,进而可以根据所确定的清扫范围确定格子大小,具体可以使得格子等于或小于所确定的清扫范围,以便于无人清扫车在清扫预设区域时,可以在不移动的情况下清扫完成。In a specific example, the cleaning range of the unmanned sweeper without moving can be determined, and then the grid size can be determined according to the determined cleaning range, specifically, the grid can be made equal to or smaller than the determined cleaning range, so that When the unmanned sweeper is cleaning the preset area, it can be cleaned without moving.
当然,不同预设区域的大小可以相同,也可以不同;不同预设区域的形状可以相同,也可以不同。Of course, the sizes of different preset areas may be the same or different; the shapes of different preset areas may be the same or different.
在人工划分预设区域的情况下,可选地,可以人工根据待检测区域中的特殊区域进行划分。例如,在待检测区域是停车场的情况下,可以人工将其中包含的每个停车位确定为预设区域,方便后续直接清扫整个停车位,而对于非停车位的区域,具体可以是停车场的过道,可以划分为大小和形状都相同的网格;在待检测区域是存在高低落差的区域的情况下,具体可以是楼梯,可以人工将每层楼梯确定为预设区域。In the case of manually dividing the preset area, optionally, it can be manually divided according to a special area in the area to be detected. For example, when the area to be detected is a parking lot, each parking space contained in it can be manually determined as a preset area, which is convenient for subsequent direct cleaning of the entire parking space. The aisle can be divided into grids with the same size and shape; when the area to be detected is an area with a height difference, it can be specifically a staircase, and each staircase can be manually determined as a preset area.
当然,可选地,具体划分预设区域时,也可以综合人工划分和自动划分的方式进行划分。例如,针对商场,可以由人工将各个商铺内的地面确定为预设区域,再针对商场大厅和过道,利用设备自动划分的方法确定预设区域,具体可以是利用预设大小的网格进行划分,将商场大厅和过道划分为多个1平方米大小的网格,每个网格就是一个预设区域。Of course, optionally, when specifically dividing the preset area, the division may also be performed in a manner of combining manual division and automatic division. For example, for shopping malls, the ground in each shop can be manually determined as the preset area, and then for the hall and aisle of the shopping mall, the preset area can be determined by using the method of automatic division of equipment, specifically, it can be divided by using a grid of preset size , divide the hall and aisle of the shopping mall into multiple grids with a size of 1 square meter, and each grid is a preset area.
可选地,由于预设区域用于确定垃圾的位置,因此,不同预设区域之间可以不存在重合的部分。Optionally, since the preset areas are used to determine the location of the garbage, there may be no overlap between different preset areas.
该方法可以包括以下步骤。The method may include the following steps.
S101:获取针对待检测区域拍摄的目标图像。S101: Acquire a target image taken for a region to be detected.
S102:确定所划分的预设区域在目标图像中的位置。S102: Determine the position of the divided preset area in the target image.
S103:针对目标图像,利用预先训练的垃圾检测模型确定垃圾检测结果。S103: For the target image, determine a garbage detection result by using a pre-trained garbage detection model.
S104:根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域。S104: Determine a preset area where garbage exists as a garbage area according to the determined garbage detection result.
可选地,S102和S103可以并行执行,也可以先后执行,本实施例并不限定S102和S103之间的执行次序。Optionally, S102 and S103 may be executed in parallel or successively, and this embodiment does not limit the execution sequence between S102 and S103.
上述方法流程,可以通过确定预设区域在目标图像中的位置,从而方便根据目标图像的垃圾检测结果,确定存在垃圾的预设区域,高效、快速、准确地确定出垃圾的位置,减少计算资源的损耗。在确定出垃圾的位置之后,可以安排工作人员进行清扫,也可以由无人清扫设备在确定清扫路线后进行清扫。The above method flow can determine the position of the preset area in the target image, so as to facilitate the determination of the preset area where garbage exists according to the garbage detection result of the target image, efficiently, quickly and accurately determine the position of the garbage, and reduce computing resources loss. After determining the location of the garbage, staff can be arranged to clean it, or unmanned cleaning equipment can clean it after determining the cleaning route.
一、下面针对S101进行详细的解释。1. The following is a detailed explanation of S101.
在一种可选的实施例中,S101中的目标图像具体可以是针对待检测区域拍摄的任一图像。In an optional embodiment, the target image in S101 may specifically be any image captured for the region to be detected.
针对拍摄操作,可选地,本方法流程可以应用于任一电子设备中,因此,具体可以是电子设备通过自身配置的摄像装置,针对待检测区域拍摄目标图像;也可以是其他设备针对待检测区域拍摄目标图像,再传输给电子设备执行上述方法流程,进行垃圾检测。For the shooting operation, optionally, the process of this method can be applied to any electronic device. Therefore, specifically, the electronic device can shoot target images for the area to be detected through its own camera device; The target image is captured in the area, and then transmitted to the electronic device to execute the above-mentioned method flow for garbage detection.
在一种具体的示例中,本方法流程可以应用于无人清扫设备,具体可以是可以移动的无人清扫车。无人清扫设备上可以配置有摄像装置,方便进行垃圾检测,因此,可以由无人清扫设备自身针对待检测区域进行拍摄,获取目标图像。In a specific example, the method flow can be applied to unmanned cleaning equipment, specifically, a mobile unmanned cleaning vehicle. The unmanned cleaning equipment can be equipped with a camera device to facilitate garbage detection. Therefore, the unmanned cleaning equipment itself can take pictures of the area to be detected to obtain target images.
在另一种具体的示例中,可以由高空摄像头,或者无人机针对待检测区域拍摄目标图像,再将目标图像传输到无人清扫设备进行垃圾检测。无人机具体可以以俯视视角进行拍摄。In another specific example, a high-altitude camera or a drone can take target images of the area to be detected, and then transmit the target images to unmanned cleaning equipment for garbage detection. Specifically, the UAV can shoot from a top-down perspective.
因此,可选地,获取针对待检测区域拍摄的目标图像,具体可以包括:获取其他设备针对待检测区域拍摄的目标图像;或者获取自身针对待检测区域拍摄的目标图像。Therefore, optionally, acquiring a target image taken for the area to be detected may specifically include: acquiring a target image taken by other devices for the area to be detected; or acquiring a target image taken by itself for the area to be detected.
针对拍摄内容,可选地,由于拍摄角度的不同,所拍摄的目标图像中,可以包含待检测的全部区域,或者待检测的部分区域。在拍摄的目标图像只包含待检测的部分区域的情况下,只能基于目标图像中包含的预设区域,确定垃圾位置。Regarding the shooting content, optionally, due to different shooting angles, the captured target image may include all regions to be detected, or some regions to be detected. In the case that the captured target image only includes a part of the area to be detected, the position of the garbage can only be determined based on the preset area contained in the target image.
可选地,可以是将预先针对待检测区域拍摄的图像确定为目标图像,也可以是将实时针对待检测区域拍摄的图像确定为目标图像。Optionally, an image captured in advance for the region to be detected may be determined as the target image, or an image captured in real time for the region to be detected may be determined as the target image.
因此,可选地,获取针对待检测区域拍摄的目标图像,具体可以包括:获取针对待检测区域实时拍摄的目标图像;或者获取针对待检测区域预先拍摄的目标图像。Therefore, optionally, acquiring a target image taken for the area to be detected may specifically include: acquiring a target image taken in real time for the area to be detected; or acquiring a target image taken in advance for the area to be detected.
而针对拍摄结果,可选地,目标图像可以是一个或多个。For the shooting result, optionally, there may be one or more target images.
在垃圾检测的场景中,垃圾本身并不一定是固定在同一位置的,垃圾的位置可能随时会发生变动。例如,废弃易拉罐被人踢开、纸屑和落叶被风吹走等等。In the garbage detection scenario, the garbage itself is not necessarily fixed at the same position, and the location of the garbage may change at any time. For example, discarded cans were kicked away, paper scraps and fallen leaves were blown away by the wind, etc.
因此,为了方便提高垃圾检测和垃圾定位的准确率,可以获取多张目标图像,以便于根据多张目标图像进行垃圾检测和垃圾定位。Therefore, in order to improve the accuracy of garbage detection and garbage location conveniently, multiple target images may be obtained, so as to perform garbage detection and garbage location based on the multiple target images.
不同的目标图像可以包含待检测区域的不同部分,从而可以覆盖待检测区域的多个部分,也可以从不同角度进行垃圾检测和垃圾定位,提高垃圾检测和垃圾定位的准确率。Different target images can contain different parts of the area to be detected, so that multiple parts of the area to be detected can be covered, and garbage detection and garbage location can be performed from different angles to improve the accuracy of garbage detection and garbage location.
具体地,可以获取连续针对待检测区域拍摄的多张图像,也可以获取在预设时间段内针对待检测区域拍摄的多张图像。Specifically, multiple images taken continuously for the region to be detected may be acquired, or multiple images taken for the region to be detected within a preset time period may be acquired.
因此,可选地,获取针对待检测区域拍摄的目标图像,可以包括:获取针对待检测区域拍摄的多个目标图像;或者获取在预设时间段内针对待检测区域拍摄的多个目标图像;或者获取针对待检测区域连续拍摄的多个目标图像。Therefore, optionally, acquiring a target image taken for the region to be detected may include: acquiring a plurality of target images taken for the region to be detected; or acquiring a plurality of target images taken for the region to be detected within a preset time period; Or acquire multiple target images shot continuously for the area to be detected.
在本实施例中,可以通过获取多张目标图像执行本方法流程,提高垃圾检测和垃圾定位的准确率。In this embodiment, the process of the method can be executed by acquiring multiple target images, so as to improve the accuracy of garbage detection and garbage location.
二、下面针对S102进行详细的解释。2. A detailed explanation of S102 is given below.
本方法流程并不限定具体确定预设区域在目标图像中位置的方法。The flow of the method does not limit the method for specifically determining the position of the preset area in the target image.
可选地,可以根据目标图像在针对待检测区域进行拍摄时的位姿,确定出待检测区域映射在目标图像中的位置,进一步可以根据待检测区域中包含的预设区域的实际位置,确定出预设区域映射在目标图像中的位置。Optionally, the position of the area to be detected mapped in the target image can be determined according to the pose of the target image when shooting the area to be detected, and further can be determined according to the actual position of the preset area contained in the area to be detected The location of the preset area map in the target image.
可选地,确定所划分的预设区域在目标图像中的位置,可以包括:确定拍摄目标图像时,摄像装置的位置、高度和拍摄角度;确定待检测区域中每个预设区域的位置;根据摄像装置的位置、高度和拍摄角度,以及每个预设区域的位置,确定每个预设区域在 目标图像中的位置。Optionally, determining the position of the divided preset area in the target image may include: determining the position, height and shooting angle of the camera when shooting the target image; determining the position of each preset area in the area to be detected; According to the position, height and shooting angle of the camera device, and the position of each preset area, the position of each preset area in the target image is determined.
其中,可选地,根据摄像装置的位置、高度和拍摄角度,可以确定出所拍摄的目标图像边界对应的实际位置,从而可以根据目标图像边界对应的实际位置和预设区域的实际位置之间的位置关系,进一步确定预设区域在目标图像中的位置。Wherein, optionally, according to the position, height and shooting angle of the camera device, the actual position corresponding to the boundary of the captured target image can be determined, so that the distance between the actual position corresponding to the boundary of the target image and the actual position of the preset area can be determined. The positional relationship further determines the position of the preset area in the target image.
可选地,预设区域的位置也可以通过多个点的位置进行表征,例如,针对矩形的预设区域,可以通过4个顶点的位置表征该预设区域的位置。之后可以根据摄像装置的位置和高度,确定摄像装置在三维空间中的位置,从而可以将用于表征预设区域位置的点与摄像装置连接,进而可以根据拍摄角度确定用于表征预设区域位置的点在所拍摄的目标图像中的位置,从而可以确定出预设区域在目标图像中的位置。Optionally, the position of the preset area may also be characterized by the positions of multiple points. For example, for a rectangular preset area, the position of the preset area may be represented by the positions of four vertices. Afterwards, the position of the camera device in three-dimensional space can be determined according to the position and height of the camera device, so that the points used to represent the position of the preset area can be connected to the camera device, and then the points used to characterize the position of the preset area can be determined according to the shooting angle. The position of the point in the captured target image, so that the position of the preset area in the target image can be determined.
为了便于理解,如图2所示,为本说明书实施例提供的一种预设区域映射方法的原理示意图。其中提供了两种预设区域映射方法。For ease of understanding, as shown in FIG. 2 , it is a schematic diagram of a principle of a preset area mapping method provided by an embodiment of this specification. There are two preset area mapping methods provided.
待检测区域可以被预先划分为4个正方形的预设区域,为了便于描述,图2中仅仅示出针对预设区域1进行映射的情况。为了便于理解,通过坐标表示预设区域1的位置。具体为(0,0)、(0,1)、(1,0)和(1,1)。The area to be detected may be pre-divided into 4 square preset areas. For ease of description, FIG. 2 only shows the situation of mapping for preset area 1 . For ease of understanding, the position of the preset area 1 is represented by coordinates. Specifically (0,0), (0,1), (1,0) and (1,1).
在图2中,一种预设区域映射方法,可以是通过摄像装置的俯视视角拍摄待检测区域。其中,摄像装置的位置是(0,0),高度是2,拍摄角度是90度。因此,针对所拍摄的正方形目标图像1,可以确定出目标图像1的边界对应的实际位置是(2,2)、(2,-2)、(-2,2)和(-2,-2)。In FIG. 2 , a preset area mapping method may be to photograph the area to be detected through the top view angle of the camera device. Wherein, the position of the camera is (0,0), the height is 2, and the shooting angle is 90 degrees. Therefore, for the captured square target image 1, it can be determined that the actual positions corresponding to the boundary of the target image 1 are (2,2), (2,-2), (-2,2) and (-2,-2 ).
因此,可以根据预设区域1的位置与目标图像1边界的实际位置之间的位置关系,确定出预设区域1在目标图像1中对应的位置。Therefore, the corresponding position of the preset area 1 in the target image 1 can be determined according to the positional relationship between the position of the preset area 1 and the actual position of the boundary of the target image 1 .
另一种预设区域映射方法,可以是根据摄像装置的位置和高度,确定摄像装置在三维空间中的位置。具体可以是根据摄像装置的位置(0,-2)和高度1,确定出摄像装置在三维空间中的位置。之后可以根据拍摄角度90度,确定出目标图像2所映射的范围。其中,可以确定实际位置(0,-1)落在目标图像2的其中一个边界上。再连接用于表征预设区域1的位置的每个点与摄像装置在三维空间中的位置,可以确定出用于表征预设区域1的位置的每个点映射在目标图像2中的位置,从而可以确定出预设区域1在目标图像2中的位置。Another preset area mapping method may be to determine the position of the camera in three-dimensional space according to the position and height of the camera. Specifically, the position of the camera in the three-dimensional space may be determined according to the position (0, -2) and the height 1 of the camera. After that, the range mapped by the target image 2 can be determined according to the shooting angle of 90 degrees. Wherein, it can be determined that the actual position (0, -1) falls on one of the boundaries of the target image 2 . Then connect each point used to represent the position of the preset area 1 with the position of the camera in three-dimensional space, and the position in the target image 2 mapped to each point used to characterize the position of the preset area 1 can be determined, Therefore, the position of the preset area 1 in the target image 2 can be determined.
可选地,确定预设区域在目标图像中的位置,也可以通过其他方式。Optionally, determining the position of the preset area in the target image may also be done in other ways.
例如,可以借助待检测区域中的特征识别出预设区域的位置,具体地,针对利用白线画出的矩形停车位,可以通过识别白线位置确定出预设区域在目标图像中的位置。For example, the position of the preset area can be identified by means of features in the area to be detected. Specifically, for a rectangular parking space drawn with a white line, the position of the preset area in the target image can be determined by identifying the position of the white line.
本实施例中,可以通过摄像装置的相关信息,确定出摄像装置与待检测区域之间的位置关系,进而准确确定出预设区域在目标图像中的位置,方便后续进行垃圾定位。In this embodiment, the positional relationship between the camera device and the area to be detected can be determined through the relevant information of the camera device, and then the position of the preset area in the target image can be accurately determined, which facilitates subsequent garbage positioning.
在一种可选的实施例中,可以确定出摄像装置在UTM坐标系中的位置,以及确定出预设区域在UTM坐标系中的位置,根据位置之间的关系,确定出预设区域在目标图像中的位置。In an optional embodiment, the position of the imaging device in the UTM coordinate system can be determined, and the position of the preset area in the UTM coordinate system can be determined. According to the relationship between the positions, it can be determined that the preset area is at location in the target image.
三、下面针对S103进行详细的解释。3. A detailed explanation of S103 is given below.
S103中,主要针对目标图像,利用垃圾检测的方法确定出垃圾检测结果。其中,可以使用预先训练的垃圾检测模型进行检测。In S103 , mainly for the target image, a garbage detection method is used to determine a garbage detection result. Among them, the pre-trained garbage detection model can be used for detection.
1、预处理。1. Pretreatment.
在利用垃圾检测模型进行检测之前,针对目标图像,需要执行预处理操作。在一种 可选的实施例中,预处理操作可以包括缩放、归一化、裁剪等操作。Before using the garbage detection model for detection, preprocessing operations need to be performed on the target image. In an optional embodiment, the preprocessing operations may include operations such as scaling, normalization, and cropping.
因此,可选地,可以针对目标图像进行预处理;将预处理结果输入到预先训练的垃圾检测模型,根据垃圾检测模型的输出,确定垃圾检测结果。Therefore, optionally, preprocessing may be performed on the target image; the preprocessing result is input into the pre-trained garbage detection model, and the garbage detection result is determined according to the output of the garbage detection model.
可选地,由于确定出预设区域在目标图像中的位置,并且一般情况下,可以只需要预设区域的内容进行垃圾检测和垃圾定位,因此,可以裁剪目标图像,保留目标图像中的预设区域,从而可以减少输入垃圾检测模型的数据量,从而减少计算资源的损耗,提高垃圾检测的效率。Optionally, since the position of the preset area in the target image is determined, and in general, only the content of the preset area is required for garbage detection and garbage location, the target image can be cropped to retain the preset area in the target image. By setting an area, the amount of data input into the garbage detection model can be reduced, thereby reducing the loss of computing resources and improving the efficiency of garbage detection.
因此,可选地,预处理可以包括:裁剪目标图像,保留目标图像中的预设区域。Therefore, optionally, the preprocessing may include: cropping the target image, and retaining a preset area in the target image.
当然,可选地,预处理还可以包括:缩放目标图像。通过缩放目标图像可以降低图像的分辨率,减少输入垃圾检测模型的数据量,从而减少计算资源的损耗,提高垃圾检测的效率。Of course, optionally, the preprocessing may also include: scaling the target image. By scaling the target image, the resolution of the image can be reduced, and the amount of data input to the garbage detection model can be reduced, thereby reducing the consumption of computing resources and improving the efficiency of garbage detection.
可选地,预处理还可以包括:针对目标图像中RGB通道数据进行归一化处理,从而可以方便后续将预处理结果输入垃圾检测模型,由垃圾检测模型进行检测。Optionally, the preprocessing may also include: performing normalization processing on the RGB channel data in the target image, so that it is convenient to input the preprocessing result into the garbage detection model for subsequent detection by the garbage detection model.
需要注意的是,在无人清扫设备中,通常需要使用无人清扫设备本地的计算资源进行垃圾检测,因此,提高垃圾检测的效率可以使得无人清扫设备提高检测垃圾的速度,并且节约无人清扫设备本地的计算资源。It should be noted that in unmanned cleaning equipment, it is usually necessary to use the local computing resources of the unmanned cleaning equipment for garbage detection. Therefore, improving the efficiency of garbage detection can make unmanned cleaning equipment increase the speed of garbage detection and save unmanned Clean up the local computing resources of the device.
2、垃圾检测模型。2. Garbage detection model.
在一种可选的实施例中,垃圾检测模型具体可以采用深度卷积神经网络进行构建。其中可以包括用于提取图像特征的基础特征网络和用于检测垃圾的检测头部。In an optional embodiment, the garbage detection model may specifically be constructed using a deep convolutional neural network. These can include base feature networks for extracting image features and detection heads for spam detection.
可选地,垃圾检测模型的框架可以采用SSD、RetinaNet、CenterNet或者YoLo等框架。其中,具体可以采用YoLov5的框架进行构建。Optionally, the framework of the garbage detection model may adopt frameworks such as SSD, RetinaNet, CenterNet or YoLo. Among them, the framework of YoLov5 can be used for construction.
需要说明的是,针对垃圾检测这一具体场景,存在较多特定问题。具体可以包括:垃圾样本数量较少、垃圾本身较小等问题。因此,可以基于垃圾检测这一具体场景的特点,适应性根据垃圾检测场景的需求,针对垃圾检测模型进行调整。It should be noted that for the specific scenario of garbage detection, there are many specific problems. Specifically, it can include: the number of garbage samples is small, and the garbage itself is small. Therefore, based on the characteristics of the specific scene of garbage detection, the adaptability can be adjusted according to the needs of the garbage detection scene, and the garbage detection model can be adjusted.
在一种可选的实施例中,垃圾检测模型本身针对输入的图像数据,可以通过缩放的方式进行特征提取。例如,特征金字塔网络。In an optional embodiment, the garbage detection model itself can perform feature extraction by scaling the input image data. For example, feature pyramid networks.
但是,在垃圾检测的场景中,由于存在较小的垃圾,例如纸屑、落叶、石子等,这些较小的垃圾映射在目标图像上也较小,如果进一步通过缩放的方式进行特征提取,则很容易使得这些较小垃圾对应的图像特征变得模糊,从而难以检测出来,垃圾检测模型的效果较差。However, in the scene of garbage detection, due to the existence of smaller garbage, such as paper scraps, fallen leaves, stones, etc., these smaller garbage maps are also smaller on the target image. If feature extraction is further performed by scaling, then It is easy to make the image features corresponding to these smaller garbage blurred, making it difficult to detect, and the effect of the garbage detection model is poor.
因此,针对垃圾检测模型,可以限定缩放的程度,使得缩放图像数据时,可以尽量避免损失垃圾对应的图像特征,从而提高垃圾检测模型的效果。Therefore, for the garbage detection model, the degree of zooming can be limited, so that when zooming the image data, the loss of the image features corresponding to the garbage can be avoided as far as possible, thereby improving the effect of the garbage detection model.
因此,可选地,可以限定缩放图像数据的缩放比例,也可以限定缩放图像数据的分辨率。Therefore, optionally, the scaling ratio of the zoomed image data may be limited, and the resolution of the zoomed image data may also be limited.
可选地,垃圾检测模型至少用于针对目标图像的一个或多个缩放副本进行垃圾检测;其中,任一缩放副本的图像分辨率可以大于预设分辨率,或者缩放比例可以大于预设缩放比例。Optionally, the garbage detection model is used to perform garbage detection on at least one or more scaled copies of the target image; wherein, any scaled copy may have an image resolution greater than a preset resolution, or a scale ratio may be greater than a preset scale ratio .
在一种具体的实施例中,垃圾检测模型中可以包括特征金字塔网络。In a specific embodiment, the garbage detection model may include a feature pyramid network.
通常的特征金字塔网络中可以包括2、3、4、5层用于通过缩放提取特征。具体地,2层可以用于针对输入的图像数据缩放4倍,3层可以用于针对输入的图像数据缩放8 被,4层可以用于针对输入的图像数据缩放16倍,5层可以用于针对输入的图像数据缩放32倍。A typical feature pyramid network can include 2, 3, 4, and 5 layers for extracting features through scaling. Specifically, 2 layers can be used to scale the input image data by 4 times, 3 layers can be used to scale the input image data by 8 times, 4 layers can be used to scale the input image data by 16 times, and 5 layers can be used for Scales by a factor of 32 for the input image data.
而在本实施例中,垃圾检测模型中的特征金字塔网络可以只包含2、3、4层,以便于限定缩放比例,避免损失垃圾的图像特征。In this embodiment, however, the feature pyramid network in the garbage detection model may only include 2, 3, and 4 layers, so as to limit the scaling and avoid loss of image features of garbage.
本实施例中,可以通过限定缩放的比例或者缩放后的图像分辨率,避免损失垃圾在目标图像中的图像特征,从而可以提高垃圾检测模型的检测效果,提高垃圾检测的准确率。In this embodiment, the image features of the garbage in the target image can be avoided by limiting the zoom ratio or the zoomed image resolution, thereby improving the detection effect of the garbage detection model and improving the accuracy of garbage detection.
在一种可选的实施例中,收集到的图像样本中,包含垃圾的垃圾检测框的数量通常远远少于非垃圾检测框,因此,在训练垃圾检测模型时,训练样本集合中,通常正样本(垃圾检测框)的数量要远少于负样本(非垃圾检测框)。In an optional embodiment, in the collected image samples, the number of garbage detection frames containing garbage is usually far less than that of non-garbage detection frames. Therefore, when training the garbage detection model, in the training sample set, usually The number of positive samples (junk detection boxes) is much less than negative samples (non-junk detection boxes).
换言之,在图像样本中,可以评估较多的候选位置,而其中只有少数候选位置包含目标(垃圾),其他的候选位置都是背景图像,从而会导致负样本远远多于正样本。In other words, in image samples, more candidate locations can be evaluated, and only a few of them contain objects (garbage), and the other candidate locations are all background images, resulting in far more negative samples than positive samples.
为了提高垃圾检测模型的训练效率和垃圾检测准确率,避免被负样本拖累,可选地,可以在构建垃圾检测模型时,引入焦点损失。焦点损失可以针对正负样本分别确定权重,提高数量较少的正样本的权重,而降低数量较多的负样本的权重,从而可以提高垃圾检测模型的训练效率、训练效果和垃圾检测准确率。In order to improve the training efficiency and accuracy of the garbage detection model and avoid being dragged down by negative samples, a focal loss can optionally be introduced when building the garbage detection model. Focus loss can determine the weights of positive and negative samples separately, increase the weight of a small number of positive samples, and reduce the weight of a large number of negative samples, so as to improve the training efficiency, training effect and garbage detection accuracy of the garbage detection model.
可选地,垃圾检测模型中的损失函数可以包括焦点损失。其中焦点损失可以用于增加标注有垃圾检测框标签的图像样本的权重。Optionally, the loss function in the garbage detection model can include focal loss. Among them, the focus loss can be used to increase the weight of image samples labeled with garbage detection boxes.
在本实施例中,针对垃圾检测场景中样本不均衡的问题,可以通过引入焦点损失提高正样本的权重,以便于提高垃圾检测模型的训练效率、训练效果和垃圾检测准确率。In this embodiment, aiming at the problem of unbalanced samples in the garbage detection scene, the weight of positive samples can be increased by introducing focal loss, so as to improve the training efficiency, training effect and garbage detection accuracy of the garbage detection model.
在一种可选的实施例中,通常标注有垃圾检测框的图像样本难以进行标注,所获取的数量较少,因此,垃圾检测场景中的训练样本数量较少。In an optional embodiment, usually the image samples marked with garbage detection frames are difficult to label, and the acquired number is small. Therefore, the number of training samples in the garbage detection scene is small.
由于垃圾检测模型中可以包括基础特征网络,用于提取图像特征。为了提高垃圾检测模型的表征能力,可以引入与垃圾相似的其他标签,用于训练基础特征网络。例如,障碍物。Since the basic feature network can be included in the garbage detection model, it is used to extract image features. In order to improve the representation ability of the garbage detection model, other labels similar to garbage can be introduced to train the basic feature network. For example, obstacles.
因此,可选地,垃圾检测模型的训练方法,可以包括:将标注有障碍物检测框标签的图像样本确定为标注有垃圾检测框标签的图像样本,训练垃圾检测模型包括的基础特征网络。Therefore, optionally, the training method of the garbage detection model may include: determining the image sample marked with the obstacle detection frame label as the image sample marked with the garbage detection frame label, and training the basic feature network included in the garbage detection model.
与垃圾检测框相比,障碍物的检测框容易标注,并且应用场景较多,能够获取的样本数量较多,可以用于增加训练基础特征网络的样本数量,提高基础特征网络的表征能力。Compared with the garbage detection frame, the obstacle detection frame is easy to label, and has more application scenarios, and the number of samples that can be obtained is larger. It can be used to increase the number of samples for training the basic feature network and improve the representation ability of the basic feature network.
在一种具体的示例中,无人清扫设备在检测垃圾的同时,由于也需要进行清扫,因此也需要检测障碍物。因此,可以将障碍物检测框标签和垃圾检测框标签共同用于训练基础特征网络,提高表征能力,之后还可以将相同的基础特征网络用于垃圾检测和障碍物检测,减少计算资源的损耗。In a specific example, when the unmanned cleaning device detects garbage, it also needs to detect obstacles because it also needs to clean. Therefore, the obstacle detection frame label and the garbage detection frame label can be used together to train the basic feature network to improve the representation ability, and then the same basic feature network can be used for garbage detection and obstacle detection to reduce the loss of computing resources.
在本实施例中,针对垃圾检测场景中样本数量较少的问题,可以通过引入相似的样本,例如障碍物样本,帮助训练垃圾检测模型的基础特征网络,提高表征能力,从而可以提高垃圾检测模型的检测效果。In this embodiment, in view of the small number of samples in the garbage detection scene, it is possible to introduce similar samples, such as obstacle samples, to help train the basic feature network of the garbage detection model and improve the representation ability, so that the garbage detection model can be improved. detection effect.
3、垃圾检测结果。3. Garbage detection results.
在一种可选的实施例中,垃圾检测模型的输出通常包括垃圾检测框,垃圾检测框 可以用于标记所检测出的目标图像中的垃圾,并且可以具有置信度,即所标记的图像部分包含垃圾的可信度。In an optional embodiment, the output of the garbage detection model usually includes a garbage detection frame, which can be used to mark the detected garbage in the target image, and can have a confidence level, that is, the marked image part Contains the credibility of garbage.
可选地,垃圾检测模型还可以用于针对检测出的垃圾进行种类识别,例如,可以识别出垃圾检测框中包含的垃圾种类,具体可以包括:纸屑、树叶、塑料袋、盒子等。具体地,可以是针对检测出的垃圾检测框,进一步进行垃圾种类的识别。Optionally, the garbage detection model can also be used to identify the type of the detected garbage, for example, can identify the type of garbage contained in the garbage detection frame, which can specifically include: paper scraps, leaves, plastic bags, boxes, etc. Specifically, the type of garbage may be further identified for the detected garbage detection frame.
因此,可选地,垃圾检测模型输出的垃圾检测框还可以具有识别出的垃圾种类。Therefore, optionally, the garbage detection frame output by the garbage detection model may also have the recognized garbage type.
可选地,在得到垃圾检测模型输出的垃圾检测框的情况下,可以直接将所输出的垃圾检测框确定为垃圾检测结果。Optionally, when the garbage detection frame output by the garbage detection model is obtained, the output garbage detection frame may be directly determined as the garbage detection result.
在得到垃圾检测模型输出的垃圾检测框的情况下,可以进一步过滤不可靠或者重复的检测结果,从而提高垃圾检测模型的垃圾检测准确率。In the case of obtaining the garbage detection frame output by the garbage detection model, unreliable or repeated detection results can be further filtered, thereby improving the garbage detection accuracy of the garbage detection model.
可选地,可以将置信度低于预设置信度的垃圾检测框删除,也可以将相近的垃圾检测框认为是同一垃圾检测框。Optionally, garbage detection frames with a confidence level lower than a preset confidence level may be deleted, or similar garbage detection frames may be considered as the same garbage detection frame.
在一种可选的实施例中,垃圾检测模型可能针对相同的垃圾输出多个相近的垃圾检测框,为了过滤这些重复的检测结果,可以根据不同垃圾检测框之间的交并比进行过滤。In an optional embodiment, the garbage detection model may output multiple similar garbage detection frames for the same garbage. In order to filter these repeated detection results, filtering may be performed according to the intersection ratio between different garbage detection frames.
其中,不同垃圾检测框之间的交并比具体可以是,两个垃圾检测框之间重合的面积,与合并面积之间的比值。Wherein, the intersection ratio between different garbage detection frames may specifically be the ratio of the overlap area between two garbage detection frames to the merged area.
可选地,针对目标图像,利用预先训练的垃圾检测模型确定垃圾检测结果,可以包括:垃圾检测模型的输出为垃圾检测框,所输出的垃圾检测框具有置信度;按照置信度从大到小的顺序,遍历垃圾检测模型输出的垃圾检测框;在当前遍历的垃圾检测框,与任一其他垃圾检测框之间的交并比大于预设交并比的情况下,删除该其他垃圾检测框;遍历结束后,将剩余的垃圾检测框确定为垃圾检测结果。Optionally, for the target image, using a pre-trained garbage detection model to determine the garbage detection result may include: the output of the garbage detection model is a garbage detection frame, and the output garbage detection frame has a degree of confidence; In order to traverse the garbage detection frame output by the garbage detection model; if the intersection ratio between the currently traversed garbage detection frame and any other garbage detection frame is greater than the preset intersection ratio, delete the other garbage detection frame ; After the traversal, determine the remaining garbage detection frames as garbage detection results.
可选地,其中具体可以是针对当前遍历的垃圾检测框,在置信度小于当前遍历的垃圾检测框的其他垃圾检测框中,计算当前遍历的垃圾检测框与其他垃圾检测框之间的交并比,删除所计算的交并比大于预设交并比的其他垃圾检测框。Optionally, specifically, for the currently traversed garbage detection frame, in other garbage detection frames whose confidence is lower than the currently traversed garbage detection frame, calculate the intersection and union between the currently traversed garbage detection frame and other garbage detection frames ratio, delete other garbage detection frames whose calculated intersection ratio is greater than the preset intersection ratio.
可选地,为了提高垃圾检测模型的垃圾检测准确率,可以获取在同一位置针对待检测区域拍摄的多张目标图像,从而可以利用多张目标图像进行多次垃圾检测,综合确定出垃圾检测结果。Optionally, in order to improve the garbage detection accuracy of the garbage detection model, multiple target images taken at the same location for the area to be detected can be obtained, so that multiple target images can be used for multiple garbage detections, and the garbage detection results can be determined comprehensively .
具体地,可以是在同一位置针对待检测区域连续拍摄的多张目标图像,也可以是在同一位置针对待检测区域周期性或者不定期拍摄的多张目标图像。Specifically, it may be a plurality of target images taken continuously at the same position for the region to be detected, or a plurality of target images taken periodically or irregularly at the same position for the region to be detected.
由于是在同一位置拍摄的,因此,可以比对不同目标图像中检测出的垃圾检测框。Since it is taken at the same location, the garbage detection frames detected in different target images can be compared.
如果相同的垃圾检测框在多张目标图像中都被检测出来,则可以将该垃圾检测框确定为垃圾检测结果;如果垃圾检测框只在一张目标图像中的被检测出来,而其他目标图像中都无法检测出来,则可以并不将该垃圾检测框确定为垃圾检测结果。If the same garbage detection frame is detected in multiple target images, the garbage detection frame can be determined as the garbage detection result; if the garbage detection frame is only detected in one target image, while other target images If none of them can be detected, the garbage detection frame may not be determined as a garbage detection result.
因此,可选地,如果相同的垃圾检测框在大于第一预设数量的目标图像中被检测出来,则可以将该垃圾检测框确定为垃圾检测结果;如果相同的垃圾检测框只在小于第二预设数量的目标图像中被检测出来,则可以不将该垃圾检测框确定为垃圾检测结果,具体可以删除该垃圾检测框;第二预设数量可以小于第一预设数量。Therefore, optionally, if the same garbage detection frame is detected in target images greater than the first preset number, the garbage detection frame can be determined as the garbage detection result; If two preset numbers of target images are detected, the garbage detection frame may not be determined as a garbage detection result, and specifically, the garbage detection frame may be deleted; the second preset number may be smaller than the first preset number.
本实施例通过针对垃圾检测模型的输出进行后处理,具体可以过滤不可靠或者重复的垃圾检测框,从而可以提高垃圾检测模型的垃圾检测准确率。In this embodiment, by post-processing the output of the garbage detection model, unreliable or repeated garbage detection frames can be filtered, thereby improving the garbage detection accuracy of the garbage detection model.
四、下面针对S104进行详细的解释。4. A detailed explanation of S104 is given below.
在确定垃圾检测结果的情况下,由于明确了目标图像中包含的垃圾,同时,也已经确定了预设区域在目标图像中的位置,因此,可以直接根据目标图像确定出包含垃圾的预设区域。In the case of determining the garbage detection result, since the garbage contained in the target image has been clarified, and the position of the preset area in the target image has also been determined, the preset area containing garbage can be directly determined according to the target image .
具体地,如果任一检测出的垃圾在任一预设区域对应于目标图像中的位置范围内,则可以确定该预设区域包含垃圾。Specifically, if any detected garbage is within the range of any preset area corresponding to the location in the target image, it may be determined that the preset area contains garbage.
当然,由于实际的垃圾检测结果可以是垃圾检测框,因此,需要基于垃圾检测框确定垃圾区域。而垃圾检测框可能整体都包含在任一预设区域的位置范围内,也可能位于不同预设区域的位置范围内。具体可以是根据垃圾检测框的中心点或者与预设区域的重合度确定垃圾区域。Of course, since the actual garbage detection result may be a garbage detection frame, it is necessary to determine the garbage area based on the garbage detection frame. The garbage detection frame may be entirely contained within the position range of any preset area, or may be located within the position range of different preset areas. Specifically, the garbage area may be determined according to the center point of the garbage detection frame or the degree of overlap with the preset area.
在一种可选的实施例中,垃圾检测结果为垃圾检测框,根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域,可以包括:将任一垃圾检测框的中心点所在的预设区域,确定为垃圾区域;或者将与任一垃圾检测框的重合度满足预设重合条件的预设区域,确定为垃圾区域。In an optional embodiment, the garbage detection result is a garbage detection frame, and according to the determined garbage detection result, determining a preset area where garbage exists as a garbage area may include: setting the center point of any garbage detection frame The preset area where it is located is determined as a garbage area; or the preset area whose coincidence degree with any garbage detection frame satisfies the preset coincidence condition is determined as a garbage area.
其中,可选地,预设重合条件可以包括:重合度大于预设重合度,或者重合度最高。Wherein, optionally, the preset coincidence condition may include: the coincidence degree is greater than the preset coincidence degree, or the coincidence degree is the highest.
为了便于理解,如图3所示,为本说明书实施例提供的一种垃圾区域确定方法的原理示意图。For ease of understanding, as shown in FIG. 3 , it is a schematic diagram of the principle of a method for determining a garbage area provided by an embodiment of this specification.
其中包括4个预设区域映射在目标图像中的位置范围和2个垃圾检测框,分别是预设区域1-4和垃圾检测框1-2。其中预设区域通过数字标注出预设区域1-4。It includes 4 preset regions mapped to the position range in the target image and 2 garbage detection frames, which are preset regions 1-4 and garbage detection frames 1-2 respectively. The preset areas are marked with numbers 1-4.
显然,由于垃圾检测框1的中心点位于预设区域2,可以确定预设区域2中存在垃圾,预设区域2为垃圾区域。垃圾检测框2的中心点为了预设区域3,可以确定预设区域3中存在垃圾,预设区域3为垃圾区域。Obviously, since the center point of the garbage detection frame 1 is located in the preset area 2, it can be determined that there is garbage in the preset area 2, and the preset area 2 is a garbage area. The center point of the garbage detection frame 2 is the preset area 3, and it can be determined that there is garbage in the preset area 3, and the preset area 3 is a garbage area.
在本实施例中,可以基于预设区域在目标图像中映射的位置,结合检测出的垃圾检测框,确定出存在垃圾的预设区域,高效快速准确地针对检测出的垃圾进行定位,方便后续的清扫路线规划,节约计算资源,提高计算效率。In this embodiment, based on the mapped position of the preset area in the target image, combined with the detected garbage detection frame, the preset area where garbage exists can be determined, and the detected garbage can be located efficiently, quickly and accurately, which is convenient for follow-up Cleaning route planning saves computing resources and improves computing efficiency.
在一种可选的实施例中,为了提高垃圾区域的确定准确率,可以根据多张目标图像的垃圾检测结果,综合确定出垃圾区域。In an optional embodiment, in order to improve the accuracy of determining the garbage area, the garbage area may be comprehensively determined according to the garbage detection results of multiple target images.
因此,可选地,获取针对待检测区域拍摄的目标图像,可以包括:获取针对待检测区域拍摄的多个目标图像;或者获取在预设时间段内针对待检测区域拍摄的多个目标图像;或者获取针对待检测区域连续拍摄的多个目标图像。Therefore, optionally, acquiring a target image taken for the region to be detected may include: acquiring a plurality of target images taken for the region to be detected; or acquiring a plurality of target images taken for the region to be detected within a preset time period; Or acquire multiple target images shot continuously for the area to be detected.
当然,所获取的多个目标图像并不一定是在同一位置拍摄的,可以分别包含待检测区域的不同部分。Of course, the acquired multiple target images are not necessarily taken at the same position, and may respectively contain different parts of the region to be detected.
而如果任一预设区域只在一张目标图像中检测到存在垃圾,在其他目标图像中并未检测到存在垃圾,那么可能这一检测结果有误,或者垃圾位置发生了变化,因此,可以并不将该预设区域确定为垃圾区域。And if any preset area only detects the presence of garbage in one target image, but does not detect the presence of garbage in other target images, then the detection result may be wrong, or the position of the garbage has changed. Therefore, you can The preset area is not determined as a garbage area.
如果任一预设区域在多张目标图像中都检测到存在垃圾,这些多张目标图像可以是从不同位置针对待检测区域拍摄得到的。那么,该预设区域很可能存在垃圾,可以将该预设区域确定为垃圾区域。If rubbish is detected in multiple target images in any preset area, these multiple target images may be obtained by shooting the area to be detected from different positions. Then, there is likely to be garbage in the preset area, and the preset area can be determined as the garbage area.
相对应的,根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域, 可以包括:如果任一预设区域在针对预设图像数量的目标图像确定的垃圾检测结果中,都存在垃圾,则可以将该预设区域确定为垃圾区域。Correspondingly, according to the determined garbage detection result, determining the preset area with garbage as the garbage area may include: if any preset area is in the garbage detection result determined for the target image of the preset number of images, all If garbage exists, the preset area may be determined as the garbage area.
本实施例中,可以通过多张目标图像的垃圾检测结果,提高垃圾区域的准确率。In this embodiment, the accuracy of the garbage area can be improved by using the garbage detection results of multiple target images.
在无人清扫设备中,可以通过上述实施例,确定出预设区域在目标图像中的位置,进而方便针对检测出的垃圾进行定位,也方便后续无人清扫设备规划清扫路线,针对检测出的垃圾进行清扫。In the unmanned cleaning equipment, the above-mentioned embodiment can be used to determine the position of the preset area in the target image, so as to facilitate the positioning of the detected garbage, and it is also convenient for the subsequent unmanned cleaning equipment to plan cleaning routes. Garbage is cleaned up.
五、此外,上述方法流程中还可以进一步确定清扫路线。5. In addition, the cleaning route can be further determined in the process of the above method.
在一种可选的实施例中,检测出垃圾并且确定垃圾位置之后,可以针对检测出的垃圾进行清扫。In an optional embodiment, after the garbage is detected and the location of the garbage is determined, cleaning may be performed on the detected garbage.
例如,无人清扫设备可以基于本地的计算资源,进行垃圾检测和垃圾定位,并确定清扫路线后进行移动和清扫。For example, unmanned cleaning equipment can detect and locate garbage based on local computing resources, and move and clean after determining the cleaning route.
因此,可选地,本方法流程还可以包括S105:确定待清扫的垃圾区域,并根据待清扫的垃圾区域确定清扫路线。Therefore, optionally, the process of the method may further include S105: determining a garbage area to be cleaned, and determining a cleaning route according to the garbage area to be cleaned.
可选地,所确定的清扫路线可以包括待清扫的垃圾区域。Optionally, the determined cleaning route may include a garbage area to be cleaned.
其中,S105可以在确定垃圾区域之后执行,具体可以是在S104之后执行。Wherein, S105 may be performed after determining the garbage area, specifically, it may be performed after S104.
在确定垃圾区域之后,通常需要由清扫设备进行清扫,规划清扫路线。而规划清扫路线,就需要确定待清扫的垃圾区域。After the garbage area is determined, it is usually necessary to clean it by cleaning equipment and plan the cleaning route. To plan the cleaning route, it is necessary to determine the garbage area to be cleaned.
其中,待清扫的垃圾区域,具体可以是之后需要进行清扫的垃圾区域。Wherein, the garbage area to be cleaned may specifically be a garbage area that needs to be cleaned later.
可选地,可以将每个确定的垃圾区域确定为待清扫的垃圾区域。Optionally, each determined garbage area may be determined as a garbage area to be cleaned.
可选地,也可以将符合要求的垃圾区域确定为待清扫的垃圾区域。换言之,可能存在不符合要求的垃圾区域,暂时不需要清扫,也就并不需要在规划清扫路线时考虑。Optionally, the garbage area that meets the requirements may also be determined as the garbage area to be cleaned. In other words, there may be garbage areas that do not meet the requirements and do not need to be cleaned temporarily, so it does not need to be considered when planning the cleaning route.
例如,当预设区域停车位上检测到有汽车停留,即使确定该停车位中包含垃圾,也因为汽车这一障碍物而无法进行清扫,从而可以并不将该预设区域停车为确定为待清扫的垃圾区域。For example, when a car is detected on the parking space in the preset area, even if it is determined that the parking space contains garbage, it cannot be cleaned because of the obstacle of the car, so that parking in the preset area can not be determined as waiting Garbage area for sweeping.
当然,可选地,可以将包含垃圾数量较多的垃圾区域确定为待清扫的垃圾区域,也可以将包含特定垃圾种类的垃圾区域确定为待清扫的垃圾区域。Of course, optionally, the garbage area containing a large amount of garbage may be determined as the garbage area to be cleaned, or the garbage area containing a specific type of garbage may be determined as the garbage area to be cleaned.
在一种可选的实施例中,所确定的垃圾区域需要整体被清扫。In an optional embodiment, the determined garbage area needs to be cleaned as a whole.
而根据待清扫的垃圾区域,确定清扫路线,可选地,具体可以是确定出一条经过全部待清扫的垃圾区域的路线。According to the garbage areas to be cleaned, the cleaning route is determined. Optionally, a route passing through all the garbage areas to be cleaned may be determined.
可选地,可以从任一待清扫的垃圾区域出发,从距离最近的其他待清扫的垃圾区域中随机选择一个未经过的垃圾区域,向所选择的垃圾区域移动,并进行整体清扫。Optionally, start from any garbage area to be cleaned, randomly select an unpassed garbage area from other nearest garbage areas to be cleaned, move to the selected garbage area, and perform overall cleaning.
为了便于理解,如图4所示,为本说明书实施例提供的一种清扫路线规划的原理示意图。其中包含预设区域1-9,每个预设区域通过包含的数字标注,而预设区域1、3、4、9被确定为垃圾区域。For ease of understanding, as shown in FIG. 4 , it is a schematic diagram of the principle of cleaning route planning provided by the embodiment of this specification. It includes preset areas 1-9, and each preset area is marked by a number contained therein, and preset areas 1, 3, 4, and 9 are determined as garbage areas.
从预设区域1出发,可以确定距离最近的预设区域4,向预设区域4移动;之后由于预设区域4与预设区域3和9之间的距离相同,因此,可以随机选择预设区域3,向预设区域3移动,再向预设区域9移动。Starting from the preset area 1, the nearest preset area 4 can be determined and moved to the preset area 4; since the distance between the preset area 4 and the preset areas 3 and 9 is the same, the preset area can be randomly selected Area 3, move to preset area 3, and then move to preset area 9.
从而可以得到清扫路线。Thus, the cleaning route can be obtained.
在本实施例中,可以基于垃圾定位确定的出垃圾所在的垃圾区域,快速高效地确定出清扫路线,避免计算资源的损耗。尤其是在无人清扫设备中,可以节约无人清扫设 备本地的计算资源。In this embodiment, the cleaning route can be determined quickly and efficiently based on the garbage area where the garbage is located and determined based on the garbage location, so as to avoid the loss of computing resources. Especially in unmanned cleaning equipment, it can save local computing resources of unmanned cleaning equipment.
除了清扫路线,在进行清扫时,在一种可选的实施例中,也可以针对不同种类的垃圾,确定不同的清扫方式。In addition to the cleaning route, when cleaning, in an optional embodiment, different cleaning methods may also be determined for different types of garbage.
需要说明的是,针对细小的垃圾,例如纸屑、树叶等,通常可以采用风力吸取的方式进行清扫,而针对较大的垃圾,例如盒子、易拉罐等,通常可以采用工具,例如扫帚等,进行清扫。It should be noted that for small garbage, such as paper scraps, leaves, etc., usually can be cleaned by wind suction, while for larger garbage, such as boxes, cans, etc., tools, such as brooms, etc., can usually be used to clean up. clean up.
因此,具体在进行清扫时,可以根据垃圾检测模型识别出的垃圾种类,对应确定清扫方式。Therefore, when cleaning, the cleaning method can be determined according to the type of garbage identified by the garbage detection model.
因此,可选地,上述方法流程还可以包括:获取垃圾种类与清扫方式的对应关系;根据所确定的垃圾检测结果,确定垃圾区域中包含垃圾的种类;垃圾检测模型还可以用于检测垃圾种类;根据任一垃圾区域中包含垃圾的种类,确定对应的清扫方式。Therefore, optionally, the above-mentioned method flow may also include: obtaining the corresponding relationship between garbage types and cleaning methods; according to the determined garbage detection results, determining the types of garbage contained in the garbage area; the garbage detection model can also be used to detect garbage types ; Determine the corresponding cleaning method according to the type of garbage contained in any garbage area.
其中,由于垃圾区域中包含垃圾的种类可以是一个或多个,因此,可能确定出一个或多个对应的清扫方式。Wherein, since there may be one or more types of garbage contained in the garbage area, one or more corresponding cleaning methods may be determined.
可选地,不同清扫方式之间可以具有优先级,从而可以选择优先级最高的清扫方式;可选地,可以按照每种确定出的清扫方式清扫一遍,提高清扫效果。Optionally, different cleaning methods may have priorities, so that the cleaning method with the highest priority may be selected; optionally, each determined cleaning method may be used to clean once to improve the cleaning effect.
本实施例可以根据垃圾检测模型检测出的垃圾种类,确定出对应的清扫方式,从而可以方便后续的清扫,使得垃圾的清扫更加方便彻底。In this embodiment, according to the type of garbage detected by the garbage detection model, a corresponding cleaning method can be determined, so that subsequent cleaning can be facilitated, and the cleaning of garbage can be more convenient and thorough.
针对无人清扫设备,可以预先在垃圾检测和垃圾定位之后,针对每个垃圾区域中包含的垃圾种类,快速高效地确定出清扫方式,从而可以在无人清扫设备具体清扫任一垃圾区域时,使用对应的清扫方式进行清扫,提高清扫效率。For unmanned cleaning equipment, after garbage detection and garbage location, the cleaning method can be determined quickly and efficiently according to the type of garbage contained in each garbage area, so that when the unmanned cleaning equipment specifically cleans any garbage area, Use the corresponding cleaning method to clean to improve cleaning efficiency.
六、上述方法流程中,还可以进一步确定障碍物。6. In the process of the above method, obstacles may be further determined.
在进行垃圾检测的情况下,如果使用无人清扫设备清扫检测的垃圾,则通常也需要检测障碍物,从而在清扫检测出的垃圾的同时,避让检测出的障碍物。In the case of garbage detection, if unmanned cleaning equipment is used to clean the detected garbage, it is usually necessary to detect obstacles, so as to avoid the detected obstacles while cleaning the detected garbage.
例如,针对无人清扫车,在清扫垃圾的同时,也需要避让障碍物。因此,无人清扫车针对需要清扫的区域,既需要进行垃圾检测,也需要进行障碍物检测。For example, for an unmanned sweeper, it is necessary to avoid obstacles while cleaning up garbage. Therefore, for the area that needs to be cleaned, the unmanned sweeper needs to perform both garbage detection and obstacle detection.
障碍物检测的方法有很多种,本方法流程并不限定具体的障碍物检测方法。There are many methods for obstacle detection, and this method flow does not limit a specific obstacle detection method.
可选地,障碍物检测可以使用目标检测,针对目标图像利用障碍物检测模型确定其中的障碍物;也可以使用激光雷达等进行扫描等等。Optionally, target detection may be used for obstacle detection, and an obstacle detection model may be used to determine obstacles in the target image; laser radar or the like may also be used for scanning or the like.
在一种可选的实施例中,可以使用多种障碍物检测的方法,并将多种障碍物检测方法的检测结果综合起来,用于确定存在障碍物的预设区域,即障碍区域,以便于无人清扫设备避让障碍区域。In an optional embodiment, multiple obstacle detection methods can be used, and the detection results of multiple obstacle detection methods can be combined to determine a preset area where an obstacle exists, that is, an obstacle area, so that Use unmanned cleaning equipment to avoid obstacle areas.
可选地,可以将多种障碍物检测方法的检测结果,都作为障碍物检测结果,确定障碍区域。Optionally, the detection results of multiple obstacle detection methods may be used as the obstacle detection results to determine the obstacle area.
其中,可选地,使用激光雷达扫描障碍物,可以是针对激光雷达获取的点云数据,确定存在障碍物的预设区域。Wherein, optionally, using laser radar to scan for obstacles may be based on the point cloud data acquired by laser radar to determine a preset area where obstacles exist.
具体可以是针对激光雷达获取的点云数据,根据地平面拟合方法获取地平面点,把其余点作为障碍物点。然后通过投影公式把三维的障碍物点云投影到目标图像中,对预设区域统计障碍物点的数量,大于阈值就认为是存在障碍物的障碍区域。Specifically, for the point cloud data obtained by the lidar, the ground plane points are obtained according to the ground plane fitting method, and the remaining points are used as obstacle points. Then the three-dimensional obstacle point cloud is projected into the target image through the projection formula, and the number of obstacle points is counted for the preset area. If it is greater than the threshold, it is considered as an obstacle area with obstacles.
可选地,可以基于图像,利用目标检测的方法确定出障碍物。Optionally, based on images, obstacles can be determined by using a target detection method.
因此,可选地,可以把基于图像和点云数据的障碍物检测结果进行融合,确定出 合并后的障碍物检测结果,从而方便确定存在障碍物的障碍区域。Therefore, optionally, the obstacle detection results based on images and point cloud data can be fused to determine the combined obstacle detection results, so as to facilitate the determination of obstacle areas where obstacles exist.
而障碍物检测与垃圾检测的执行次序,可以是并行执行,也可以是先后执行。本实施例并不限定。The execution sequence of obstacle detection and garbage detection can be executed in parallel or sequentially. This embodiment is not limited.
在一种可选的实施例中,可以在障碍物检测之后,根据障碍物检测结果,针对检测出的障碍物进行定位,具体可以是将存在障碍物的预设区域确定为障碍区域。障碍区域具体可以是存在障碍物的预设区域。In an optional embodiment, after the obstacle is detected, the detected obstacle may be positioned according to the obstacle detection result, specifically, a preset area where the obstacle exists may be determined as the obstacle area. Specifically, the obstacle area may be a preset area where obstacles exist.
可选地,障碍区域和垃圾区域的确定可以并行执行,也可以先后执行,本实施例并不限定。Optionally, the determination of the obstacle area and the garbage area may be performed in parallel or sequentially, which is not limited in this embodiment.
其中,由于垃圾区域的确定是定位检测出的垃圾,而通常定位检测出的垃圾是用于规划清扫路线,并且,障碍区域通常需要避让,因此,可以根据确定的垃圾区域和障碍区域,确定出清扫路线,所确定的清扫路线可以经过需要清扫的垃圾区域,并且不会经过任一障碍区域。Among them, since the determination of the garbage area is the garbage detected by the positioning, and the garbage detected by the positioning is usually used to plan the cleaning route, and the obstacle area usually needs to be avoided, so it can be determined according to the determined garbage area and the obstacle area. Cleaning route, the determined cleaning route can pass through the garbage area that needs to be cleaned, and will not pass through any obstacle area.
例如,针对停车场中包含的5个停车位1-5,确定其中停车位1、3上停留有汽车,停车位2、4、5上存在垃圾。因此,可以确定停车位1和3是障碍区域,停车位2、4和5是垃圾区域。可以规划清扫路线为停车位2到停车位4再到停车位5,每个停车位都需要整体清扫。For example, for the 5 parking spaces 1-5 contained in the parking lot, it is determined that there are cars parked in the parking spaces 1 and 3, and garbage exists in the parking spaces 2, 4, and 5. Therefore, it can be determined that parking spaces 1 and 3 are obstacle areas, and parking spaces 2, 4, and 5 are garbage areas. The cleaning route can be planned from parking space 2 to parking space 4 and then to parking space 5. Each parking space needs to be cleaned as a whole.
此外,可选地,可能存在预设区域,既被确定为垃圾区域,也被确定为障碍区域。In addition, optionally, there may be a preset area, which is determined as both a garbage area and an obstacle area.
从垃圾检测的角度考虑,可以将预设区域既确定为垃圾区域,也确定为障碍区域。From the perspective of garbage detection, the preset area can be determined as both a garbage area and an obstacle area.
但从清扫路线规划的角度考虑,由于清扫路线既需要经过垃圾区域,又需要避让障碍区域,因此存在矛盾。However, from the perspective of cleaning route planning, there is a contradiction because the cleaning route needs to pass through the garbage area and avoid the obstacle area.
为了解决这一矛盾,其中障碍物,例如汽车、行人,都难以进行移动,因此,在规划清扫路线时,可以并不考虑被确定为障碍区域的垃圾区域。In order to solve this contradiction, obstacles, such as cars and pedestrians, are difficult to move. Therefore, when planning the cleaning route, the garbage area determined as the obstacle area may not be considered.
换言之,确定需要清扫的垃圾区域,具体可以包括:将非障碍区域的垃圾区域,确定为需要清扫的垃圾区域,从而可以只针对非障碍区域的垃圾区域规划清扫路线。In other words, determining the garbage area that needs to be cleaned may specifically include: determining the garbage area in the non-obstacle area as the garbage area that needs to be cleaned, so that the cleaning route can be planned only for the garbage area in the non-obstacle area.
当然,也可以在确定垃圾区域时,根据事先确定的障碍区域,将存在垃圾、并且属于非障碍区域的预设区域,确定为垃圾区域。Of course, when determining the garbage area, a preset area that contains garbage and belongs to the non-obstacle area may also be determined as the garbage area according to the pre-determined obstacle area.
因此,可选地,上述方法流程还可以包括S106:检测待检测区域中的障碍物,将存在障碍物的预设区域确定为障碍区域。Therefore, optionally, the above method flow may further include S106: Detecting obstacles in the area to be detected, and determining a preset area where obstacles exist as an obstacle area.
可选地,根据所确定的垃圾检测结果,将检测到存在垃圾的预设区域确定为垃圾区域,可以包括:根据所确定的垃圾检测结果,将检测到存在垃圾的非障碍区域确定为垃圾区域。Optionally, determining the preset area where garbage is detected as the garbage area according to the determined garbage detection result may include: determining the non-obstacle area where garbage is detected as the garbage area according to the determined garbage detection result .
可选地,确定待清扫的垃圾区域,可以包括:将非障碍区域的垃圾区域,确定为需要清扫的垃圾区域。Optionally, determining the garbage area to be cleaned may include: determining the garbage area in the non-obstacle area as the garbage area to be cleaned.
可选地,在规划清扫路线时,也可以确定出属于障碍区域的垃圾区域,和非障碍区域的垃圾区域,从而可以根据非障碍区域的垃圾区域确定清扫路线,使得规划的清扫路线包括非障碍区域的垃圾区域,而不包括属于障碍区域的垃圾区域,也不会包括任一障碍区域。Optionally, when planning the cleaning route, it is also possible to determine the garbage area belonging to the obstacle area and the garbage area in the non-obstacle area, so that the cleaning route can be determined according to the garbage area in the non-obstacle area, so that the planned cleaning route includes non-obstacle areas. The garbage area of the area, does not include the garbage area that belongs to the obstacle area, and does not include any obstacle area.
上述实施例中,可以进一步结合障碍物检测,帮助规划清扫路线,提高垃圾清扫效率。In the above embodiments, obstacle detection can be further combined to help plan cleaning routes and improve garbage cleaning efficiency.
当然,可选地,也可以在确定出障碍区域之后,直接删除目标图像中障碍区域包 含的图像内容,针对删除后的目标图像进行垃圾检测,可以节约计算资源。Of course, optionally, after the obstacle area is determined, the image content contained in the obstacle area in the target image can be directly deleted, and garbage detection is performed on the deleted target image, which can save computing resources.
在一种可选的实施例中,障碍物检测可以是通过目标检测的方法执行的。因此,检测待检测区域中的障碍物,可以包括:针对目标图像,利用预先训练的障碍物检测模型确定障碍物检测结果。In an optional embodiment, obstacle detection may be performed by a target detection method. Therefore, detecting an obstacle in the region to be detected may include: using a pre-trained obstacle detection model to determine an obstacle detection result for the target image.
其中,可选地,为了节约计算资源,由于障碍物检测和垃圾检测通常都需要针对目标图像提取图像特征,因此,在训练障碍物检测模型和垃圾检测模型时,可选地,可以使用标注有障碍物检测框标签的图像样本,以及标注有垃圾检测框标签的图像样本,共同训练障碍物检测模型和垃圾检测模型的基础特征网络,得到相同的基础特征网络,从而可以提高基础特征网络的表征能力,提高障碍物检测模型和垃圾检测模型的训练效果,还可以节约计算资源。Among them, optionally, in order to save computing resources, since both obstacle detection and garbage detection usually need to extract image features for the target image, when training the obstacle detection model and garbage detection model, optionally, the labels marked with The image samples of the obstacle detection frame label, and the image samples marked with the garbage detection frame label, jointly train the basic feature network of the obstacle detection model and the garbage detection model, and obtain the same basic feature network, which can improve the representation of the basic feature network ability, improve the training effect of obstacle detection model and garbage detection model, and save computing resources.
当然,可选地,针对障碍物检测模型的检测头部,需要只利用标注有障碍物检测框标签的图像样本进行训练,而基础特征网络的参数可以固定不变。Of course, optionally, for the detection head of the obstacle detection model, only the image samples marked with the obstacle detection frame label need to be used for training, and the parameters of the basic feature network can be fixed.
因此,可选地,障碍物检测模型和垃圾检测模型包括的基础特征网络采用相同的训练样本集合进行训练,训练得到的基础特征网络相同。训练样本集合可以包括:标注有障碍物检测框标签的图像样本,以及标注有垃圾检测框标签的图像样本。Therefore, optionally, the basic feature networks included in the obstacle detection model and the garbage detection model are trained using the same training sample set, and the trained basic feature networks are the same. The training sample set may include: image samples marked with obstacle detection frame labels, and image samples marked with garbage detection frame labels.
需要说明的是,本说明书实施例中的垃圾检测模型,可以通过采集不同场景不同垃圾的数据进行训练,并在检测头部输出垃圾检测框和垃圾类别。It should be noted that the garbage detection model in the embodiment of this specification can be trained by collecting data of different garbage in different scenarios, and output the garbage detection frame and garbage category in the detection head.
为了减少模型计算资源的损耗和提高计算速度,同时减少对训练数据的要求,在一种可选的实施例中,可以采用和障碍物检测模型共享基础特征网络,但独立训练检测头部的方法。In order to reduce the loss of model computing resources and improve computing speed, while reducing the requirements for training data, in an optional embodiment, the method of sharing the basic feature network with the obstacle detection model but independently training the detection head can be used .
为了便于理解,如图5所示,为本说明书实施例提供的一种模型结构的原理示意图。其中障碍物检测模型和垃圾检测模型共享基础特征网络。使得目标图像在进行垃圾检测和障碍物检测时,可以只执行一次基础特征网络的特征提取,无需分别执行,从而可以节约计算资源,提高计算速度和效率。For ease of understanding, as shown in FIG. 5 , it is a schematic schematic diagram of a model structure provided by an embodiment of this specification. Among them, the obstacle detection model and the garbage detection model share the basic feature network. When the target image is used for garbage detection and obstacle detection, the feature extraction of the basic feature network can only be performed once without performing separate executions, thereby saving computing resources and improving computing speed and efficiency.
一方面基础特征网络在深度学习模型中占用了最多的计算资源,共享这一部分的计算可以大大减少计算资源损耗。On the one hand, the basic feature network occupies the most computing resources in the deep learning model, and sharing this part of the calculation can greatly reduce the consumption of computing resources.
另一方面障碍物检测和垃圾检测都在同一场景中进行,只是检测目标不一样,所以很多用于检测的基础特征是可以共用的。On the other hand, both obstacle detection and garbage detection are performed in the same scene, but the detection targets are different, so many basic features for detection can be shared.
并且,由于障碍物的数据相比垃圾的数据更容易得到,其训练数据数量远远大于垃圾检测训练数据。因此共享的基础特征也可以大大减少了对于垃圾检测单独训练数据的需求,以更快的达到目标精度。Moreover, since obstacle data is easier to obtain than garbage data, the amount of training data is much larger than garbage detection training data. Therefore, the shared basic features can also greatly reduce the need for separate training data for garbage detection, so as to achieve the target accuracy faster.
具体训练共享基础特征网络的检测模型方式是:在障碍物和垃圾检测数据上一起训练一个检测模型,来获得共同的基础特征网络参数。The specific way to train the detection model of the shared basic feature network is to train a detection model together on the obstacle and garbage detection data to obtain the common basic feature network parameters.
具体可以将障碍物检测框标签和垃圾检测框标签,都视为目标检测框标签,用于训练一个检测模型,获取其中的基础特征网络参数。Specifically, both the obstacle detection frame label and the garbage detection frame label can be regarded as the target detection frame label, which is used to train a detection model and obtain the basic feature network parameters.
之后,可以基于所获取的基础特征网络参数,分别构建垃圾检测模型和障碍物检测模型,其中的基础特征网络参数可以在训练过程中固定不变,利用障碍物数据训练障碍物检测模型的检测头部,利用垃圾检测数据训练垃圾检测模型的检测头部。Afterwards, based on the obtained basic feature network parameters, a garbage detection model and an obstacle detection model can be constructed respectively. The basic feature network parameters can be fixed during the training process, and the detection head of the obstacle detection model can be trained using the obstacle data. part, use the garbage detection data to train the detection head of the garbage detection model.
在一种可选的实施例中,在确定了需要避让的障碍区域后,可以进一步确定出更准确更合适的清扫路线。In an optional embodiment, after the obstacle area to be avoided is determined, a more accurate and suitable cleaning route can be further determined.
可选地,上述方法流程还可以包括:确定需要进行清扫的垃圾区域和需要避让的障碍区域,基于所确定的垃圾区域和障碍区域确定清扫路线。Optionally, the process of the above method may further include: determining a garbage area that needs to be cleaned and an obstacle area that needs to be avoided, and determining a cleaning route based on the determined garbage area and obstacle area.
为了便于理解,如图6所示,为本说明书实施例提供的另一种清扫路线规划的原理示意图。For ease of understanding, as shown in FIG. 6 , it is a schematic diagram of another cleaning route planning provided by the embodiment of this specification.
其中包含预设区域1-9,每个预设区域通过包含的数字标注,预设区域1、3、4、9被确定为垃圾区域,预设区域5和6被确定为障碍区域。It contains preset areas 1-9, and each preset area is marked by a number contained therein. Preset areas 1, 3, 4, and 9 are determined as garbage areas, and preset areas 5 and 6 are determined as obstacle areas.
从预设区域1出发,可以确定距离最近的预设区域4,向预设区域4移动;之后由于预设区域4与预设区域3和9之间的距离相同,因此,可以随机选择预设区域3,向预设区域3移动,由于从预设区域4直线向预设区域3移动,会经过预设区域5(障碍区域),因此,可以通过预设区域1和2进行绕行。Starting from the preset area 1, the nearest preset area 4 can be determined and moved to the preset area 4; since the distance between the preset area 4 and the preset areas 3 and 9 is the same, the preset area can be randomly selected Area 3, moving to the preset area 3, since moving from the preset area 4 to the preset area 3 in a straight line will pass through the preset area 5 (obstacle area), therefore, it can go around through the preset areas 1 and 2.
再向预设区域9移动,由于预设区域5和6是障碍区域,因此,可以从预设区域6外进行绕行,从而可以得到清扫路线。Moving to the preset area 9, since the preset areas 5 and 6 are obstacle areas, it is possible to detour from outside the preset area 6, thereby obtaining a cleaning route.
为了便于理解,本说明书实施例还提供了一种应用实施例。其中针对无人清扫设备进行解释。For ease of understanding, the embodiment of this specification also provides an application embodiment. It explains for unmanned cleaning equipment.
无人清扫设备可以通过自身配置的摄像装置,针对待检测的区域进行拍摄,得到目标图像。待检测的区域可以是商场大厅。待检测的区域被预先划分为多个预设区域,每个预设区域都是商场大厅中的一块正方形地砖。The unmanned cleaning equipment can take pictures of the area to be detected through its own camera device to obtain the target image. The area to be detected may be a hall of a shopping mall. The area to be detected is pre-divided into multiple preset areas, and each preset area is a square floor tile in the hall of the shopping mall.
无人清扫设备可以进行垃圾检测,同时可以进行障碍物检测,具体可以是将目标图像输入基础特征网络,再将基础特征网络输出的图像特征,分别输入到垃圾检测模型中的检测头部和障碍物检测模型中的检测头部,确定垃圾检测结果和障碍物检测结果。障碍物具体可以是行人、货物等。Unmanned cleaning equipment can detect garbage and obstacles at the same time. Specifically, the target image can be input into the basic feature network, and then the image features output by the basic feature network can be input into the detection head and obstacle in the garbage detection model. The detection head in the object detection model determines the garbage detection result and the obstacle detection result. Specifically, obstacles may be pedestrians, goods, and the like.
此外,无人清扫设备还可以确定待检测区域中的预设区域在目标图像中的位置,具体可以是确定商场大厅中的正方形地砖在目标图像中的位置。In addition, the unmanned cleaning device can also determine the position of the preset area in the area to be detected in the target image, specifically, it can determine the position of the square floor tiles in the hall of the shopping mall in the target image.
结合正方形地砖在目标图像中的位置,以及检测出的垃圾和障碍物,无人清扫设备可以确定出存在垃圾的正方形地砖,以及存在障碍物的正方形地砖,进而可以规划清扫路线,避让存在障碍物的正方形地砖,清扫存在垃圾的正方形地砖。Combined with the position of the square floor tiles in the target image, as well as the detected garbage and obstacles, the unmanned cleaning equipment can determine the square floor tiles with garbage and the square floor tiles with obstacles, and then plan the cleaning route to avoid obstacles Clean the square floor tiles with rubbish.
上述方法流程中,可以基于预设区域的位置映射,具体可以是地图信息的映射,将预设区域映射到目标图像中,方便进行垃圾定位,从而可以服务于无人清扫,所得到的垃圾定位信息可以供无人清扫车进行高效的垃圾清扫路径规划。In the process of the above method, based on the location mapping of the preset area, specifically, the mapping of map information, the preset area can be mapped to the target image, which is convenient for garbage positioning, so that it can serve unmanned cleaning, and the obtained garbage positioning The information can be used by unmanned sweepers for efficient garbage cleaning path planning.
此外,还可以将垃圾检测模型与障碍物检测模型共享基础特征网络,从而减少计算资源损耗,减少训练数据要求,提高表征能力。In addition, the garbage detection model can also share the basic feature network with the obstacle detection model, thereby reducing computing resource consumption, reducing training data requirements, and improving representation capabilities.
还可以子啊垃圾检测基础上进行垃圾分类,确定出清扫方式,以更好的服务于无人清扫规划。It is also possible to classify garbage on the basis of garbage detection and determine the cleaning method to better serve unmanned cleaning planning.
对应于上述方法流程,本说明书实施例还提供了一种装置实施例。Corresponding to the above method flow, the embodiment of this specification also provides an apparatus embodiment.
如图7所示,为本说明书实施例提供的一种垃圾检测装置的结构示意图。As shown in FIG. 7 , it is a schematic structural diagram of a garbage detection device provided in the embodiment of this specification.
其中,可以预先将待检测区域划分为至少两个预设区域。垃圾检测装置可以包括以下单元。Wherein, the area to be detected can be divided into at least two preset areas in advance. The rubbish detection device may include the following units.
获取单元201,用于获取针对待检测区域拍摄的目标图像。The obtaining unit 201 is configured to obtain a target image taken for the region to be detected.
映射单元202,用于确定所划分的预设区域在目标图像中的位置。The mapping unit 202 is configured to determine the position of the divided preset area in the target image.
检测单元203,用于针对目标图像,利用预先训练的垃圾检测模型确定垃圾检测结 果。The detection unit 203 is configured to determine a garbage detection result by using a pre-trained garbage detection model for the target image.
定位单元204,用于根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域。The positioning unit 204 is configured to determine a preset area where garbage exists as a garbage area according to the determined garbage detection result.
可选地,映射单元202可以用于:确定拍摄目标图像时,摄像装置的位置、高度和拍摄角度;确定待检测区域中每个预设区域的位置;根据摄像装置的位置、高度和拍摄角度,以及每个预设区域的位置,确定每个预设区域在目标图像中的位置。Optionally, the mapping unit 202 can be used to: determine the position, height and shooting angle of the camera when shooting the target image; determine the position of each preset area in the area to be detected; according to the position, height and shooting angle of the camera , and the position of each preset area to determine the position of each preset area in the target image.
可选地,检测单元203可以包括:预处理子单元203a,用于针对目标图像进行预处理。Optionally, the detection unit 203 may include: a preprocessing subunit 203a, configured to perform preprocessing on the target image.
检测子单元203b,用于将预处理结果输入到预先训练的垃圾检测模型,根据垃圾检测模型的输出,确定垃圾检测结果。The detection subunit 203b is configured to input the preprocessing result into the pre-trained garbage detection model, and determine the garbage detection result according to the output of the garbage detection model.
可选地,预处理子单元203a可以用于:裁剪目标图像,保留目标图像中的预设区域。Optionally, the preprocessing subunit 203a may be configured to: crop the target image, and retain a preset area in the target image.
可选地,垃圾检测模型至少用于针对目标图像的一个或多个缩放副本进行垃圾检测;其中,任一缩放副本的图像分辨率大于预设分辨率,或者缩放比例大于预设缩放比例。Optionally, the garbage detection model is at least used to perform garbage detection on one or more scaled copies of the target image; wherein, any scaled copy has an image resolution greater than a preset resolution, or a scale ratio greater than a preset scale ratio.
可选地,垃圾检测模型中的损失函数包括焦点损失;焦点损失用于增加标注有垃圾检测框标签的图像样本的权重。Optionally, the loss function in the garbage detection model includes a focus loss; the focus loss is used to increase the weight of image samples marked with garbage detection frame labels.
可选地,垃圾检测模型可以包括基础特征网络;垃圾检测模型的训练方法,可以包括:将标注有障碍物检测框标签的图像样本确定为标注有垃圾检测框标签的图像样本,训练垃圾检测模型包括的基础特征网络。Optionally, the garbage detection model may include a basic feature network; the training method of the garbage detection model may include: determining an image sample marked with an obstacle detection frame label as an image sample marked with a garbage detection frame label, and training the garbage detection model Included base feature network.
可选地,垃圾检测模型的输出为垃圾检测框,所输出的垃圾检测框具有置信度;检测单元203可以包括:遍历子单元203c,用于按照置信度从大到小的顺序,遍历垃圾检测模型输出的垃圾检测框。Optionally, the output of the garbage detection model is a garbage detection frame, and the output garbage detection frame has a confidence level; the detection unit 203 may include: a traversal subunit 203c for traversing the garbage detection The garbage detection box output by the model.
删除子单元203d,用于在当前遍历的垃圾检测框,与任一其他垃圾检测框之间的交并比大于预设交并比的情况下,删除该其他垃圾检测框;遍历结束后,将剩余的垃圾检测框确定为垃圾检测结果。The deletion subunit 203d is used to delete the other garbage detection frame when the intersection ratio between the currently traversed garbage detection frame and any other garbage detection frame is greater than the preset intersection ratio; after the traversal, the The remaining garbage detection boxes are determined as garbage detection results.
可选地,垃圾检测结果为垃圾检测框,定位单元204可以用于:将任一垃圾检测框的中心点所在的预设区域,确定为垃圾区域;或者将与任一垃圾检测框的重合度满足预设重合条件的预设区域,确定为垃圾区域。Optionally, the garbage detection result is a garbage detection frame, and the positioning unit 204 can be used to: determine the preset area where the center point of any garbage detection frame is located as the garbage area; or determine the coincidence degree with any garbage detection frame The preset area that satisfies the preset coincidence condition is determined as a garbage area.
可选地,获取单元201可以用于:获取针对待检测区域拍摄的多个目标图像;或者获取在预设时间段内针对待检测区域拍摄的多个目标图像;或者获取针对待检测区域连续拍摄的多个目标图像。Optionally, the acquiring unit 201 can be used to: acquire multiple target images taken for the area to be detected; or acquire multiple target images taken for the area to be detected within a preset time period; or acquire continuous shooting of the area to be detected multiple target images.
相对应地,定位单元204可以用于:如果任一预设区域在针对预设图像数量的目标图像确定的垃圾检测结果中,都存在垃圾,则将该预设区域确定为垃圾区域。Correspondingly, the positioning unit 204 may be configured to: if any preset area contains garbage in the garbage detection results determined for the preset number of target images, determine the preset area as a garbage area.
可选地,垃圾检测装置,还可以包括:清扫路线确定单元205,用于确定待清扫的垃圾区域,并根据待清扫的垃圾区域确定清扫路线。Optionally, the garbage detection device may further include: a cleaning route determining unit 205, configured to determine a garbage area to be cleaned, and determine a cleaning route according to the garbage area to be cleaned.
可选地,垃圾检测装置,还可以包括:清扫方式确定单元206,用于获取垃圾种类与清扫方式的对应关系;根据所确定的垃圾检测结果,确定垃圾区域中包含垃圾的种类;垃圾检测模型还用于检测垃圾种类;根据任一垃圾区域中包含垃圾的种类,确定对应的清扫方式。Optionally, the garbage detection device may also include: a cleaning mode determination unit 206, configured to obtain the correspondence between garbage types and cleaning modes; according to the determined garbage detection results, determine the types of garbage contained in the garbage area; the garbage detection model It is also used to detect the type of garbage; according to the type of garbage contained in any garbage area, determine the corresponding cleaning method.
可选地,垃圾检测装置,还可以包括:障碍物检测单元207,用于检测待检测区域中的障碍物,将存在障碍物的预设区域确定为障碍区域。Optionally, the garbage detection device may further include: an obstacle detection unit 207, configured to detect obstacles in the area to be detected, and determine a preset area where obstacles exist as an obstacle area.
相对应地,定位单元204可以用于:根据所确定的垃圾检测结果,将检测到存在垃圾的非障碍区域确定为垃圾区域。Correspondingly, the positioning unit 204 may be configured to: determine the non-obstacle area in which garbage is detected as the garbage area according to the determined garbage detection result.
可选地,障碍物检测单元207可以用于:针对所述目标图像,利用预先训练的障碍物检测模型确定障碍物检测结果。Optionally, the obstacle detection unit 207 may be configured to: use a pre-trained obstacle detection model to determine an obstacle detection result for the target image.
可选地,障碍物检测模型和垃圾检测模型包括的基础特征网络可以采用相同的训练样本集合进行训练,训练得到的基础特征网络相同;训练样本集合可以包括:标注有障碍物检测框标签的图像样本,以及标注有垃圾检测框标签的图像样本。Optionally, the basic feature network included in the obstacle detection model and the garbage detection model can be trained using the same training sample set, and the trained basic feature network is the same; the training sample set can include: an image marked with an obstacle detection frame label samples, and image samples annotated with spam detection box labels.
上述装置实施例的详细解释可以参见上述方法流程的解释。For detailed explanations of the above device embodiments, reference may be made to the explanations of the above method flow.
本说明书实施例还提供一种计算机设备,具体可以是无人清扫设备,其至少包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现上述任一方法实施例中的一种垃圾检测方法。The embodiment of this specification also provides a computer device, which can be specifically an unmanned cleaning device, which at least includes a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor executes the program When implementing a garbage detection method in any one of the above method embodiments.
图8示出了本说明书实施例所提供的一种更为具体的计算机设备硬件结构示意图,该设备可以包括:处理器1010、存储器1020、输入/输出接口1030、通信接口1040和总线1050。其中处理器1010、存储器1020、输入/输出接口1030和通信接口1040通过总线1050实现彼此之间在设备内部的通信连接。FIG. 8 shows a schematic diagram of a more specific hardware structure of a computer device provided by the embodiment of this specification. The device may include: a processor 1010 , a memory 1020 , an input/output interface 1030 , a communication interface 1040 and a bus 1050 . The processor 1010 , the memory 1020 , the input/output interface 1030 and the communication interface 1040 are connected to each other within the device through the bus 1050 .
处理器1010可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本说明书实施例所提供的技术方案。The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute related programs to realize the technical solutions provided by the embodiments of this specification.
存储器1020可以采用ROM(Read Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器1020可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器1020中,并由处理器1010来调用执行。The memory 1020 can be implemented in the form of ROM (Read Only Memory, read-only memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, etc. The memory 1020 can store operating systems and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and invoked by the processor 1010 for execution.
输入/输出接口1030用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input/output interface 1030 is used to connect the input/output module to realize information input and output. The input/output/module can be configured in the device as a component (not shown in the figure), or can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
通信接口1040用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The communication interface 1040 is used to connect a communication module (not shown in the figure), so as to realize the communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.), and can also realize communication through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
总线1050包括一通路,在设备的各个组件(例如处理器1010、存储器1020、输入/输出接口1030和通信接口1040)之间传输信息。 Bus 1050 includes a path that carries information between the various components of the device (eg, processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
需要说明的是,尽管上述设备仅示出了处理器1010、存储器1020、输入/输出接口1030、通信接口1040以及总线1050,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that although the above device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components. In addition, those skilled in the art can understand that the above-mentioned device may only include components necessary to implement the solutions of the embodiments of this specification, and does not necessarily include all the components shown in the figure.
本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程 序被处理器执行时实现上述任一方法实施例中的一种垃圾检测方法。The embodiment of this specification also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, a garbage detection method in any of the above method embodiments is implemented.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, A magnetic tape cartridge, disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。It can be known from the above description of the implementation manners that those skilled in the art can clearly understand that the embodiments of this specification can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the essence of the technical solutions of the embodiments of this specification or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, A magnetic disk, an optical disk, etc., include several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this specification.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, devices, modules, or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementing device is a computer, which may take the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, e-mail device, game control device, etc. desktops, tablets, wearables, or any combination of these.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiment. The device embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated, and the functions of each module may be integrated in the same or multiple software and/or hardware implementations. Part or all of the modules can also be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上所述仅是本说明书实施例的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护。The above is only the specific implementation of the embodiment of this specification. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the embodiment of this specification, some improvements and modifications can also be made. These Improvements and modifications should also be regarded as protections for the embodiments of this specification.

Claims (18)

  1. 一种垃圾检测方法,预先将待检测区域划分为至少两个预设区域;所述方法包括:A garbage detection method, which divides the area to be detected into at least two preset areas in advance; the method includes:
    获取针对所述待检测区域拍摄的目标图像;Acquiring a target image taken for the region to be detected;
    确定所划分的预设区域在所述目标图像中的位置;determining the position of the divided preset area in the target image;
    针对所述目标图像,利用预先训练的垃圾检测模型确定垃圾检测结果;For the target image, using a pre-trained garbage detection model to determine a garbage detection result;
    根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域。According to the determined garbage detection result, a preset area where garbage exists is determined as a garbage area.
  2. 根据权利要求1所述的方法,所述确定所划分的预设区域在所述目标图像中的位置,包括:The method according to claim 1, the determining the position of the divided preset area in the target image comprises:
    确定拍摄所述目标图像时,摄像装置的位置、高度和拍摄角度;When determining the shooting of the target image, the position, height and shooting angle of the camera;
    确定所述待检测区域中每个预设区域的位置;determining the position of each preset area in the area to be detected;
    根据所述摄像装置的位置、高度和拍摄角度,以及每个预设区域的位置,确定每个预设区域在所述目标图像中的位置。The position of each preset area in the target image is determined according to the position, height and shooting angle of the camera device, and the position of each preset area.
  3. 根据权利要求1所述的方法,所述针对所述目标图像,利用预先训练的垃圾检测模型确定垃圾检测结果,包括:The method according to claim 1, said using a pre-trained garbage detection model to determine a garbage detection result for said target image, comprising:
    针对所述目标图像进行预处理;Preprocessing the target image;
    将预处理结果输入到预先训练的垃圾检测模型,根据所述垃圾检测模型的输出,确定垃圾检测结果。The preprocessing result is input into the pre-trained garbage detection model, and the garbage detection result is determined according to the output of the garbage detection model.
  4. 根据权利要求3所述的方法,所述预处理包括:裁剪所述目标图像,保留所述目标图像中的预设区域。The method according to claim 3, wherein the preprocessing comprises: cropping the target image, and retaining a preset area in the target image.
  5. 根据权利要求1所述的方法,所述垃圾检测模型至少用于针对所述目标图像的一个或多个缩放副本进行垃圾检测;其中,任一缩放副本的图像分辨率大于预设分辨率,或者缩放比例大于预设缩放比例。The method of claim 1, wherein the garbage detection model is used to perform garbage detection on at least one or more scaled copies of the target image; wherein any scaled copy has an image resolution greater than a preset resolution, or The zoom ratio is greater than the preset zoom ratio.
  6. 根据权利要求1所述的方法,所述垃圾检测模型中的损失函数包括焦点损失;所述焦点损失用于增加标注有垃圾检测框标签的图像样本的权重。The method according to claim 1, wherein the loss function in the garbage detection model includes a focus loss; and the focus loss is used to increase the weight of image samples labeled with garbage detection frame labels.
  7. 根据权利要求1所述的方法,所述垃圾检测模型包括基础特征网络;所述垃圾检测模型的训练方法,包括:The method according to claim 1, the garbage detection model comprising a basic feature network; the training method of the garbage detection model comprising:
    将标注有障碍物检测框标签的图像样本确定为标注有垃圾检测框标签的图像样本,训练所述垃圾检测模型包括的基础特征网络。The image samples marked with the obstacle detection frame label are determined as the image samples marked with the garbage detection frame label, and the basic feature network included in the garbage detection model is trained.
  8. 根据权利要求1所述的方法,所述针对所述目标图像,利用预先训练的垃圾检测模型确定垃圾检测结果,包括:The method according to claim 1, said using a pre-trained garbage detection model to determine a garbage detection result for said target image, comprising:
    所述垃圾检测模型的输出为垃圾检测框,所输出的垃圾检测框具有置信度;The output of the garbage detection model is a garbage detection frame, and the output garbage detection frame has a degree of confidence;
    按照置信度从大到小的顺序,遍历所述垃圾检测模型输出的垃圾检测框;According to the order of confidence from large to small, traverse the garbage detection frame output by the garbage detection model;
    在当前遍历的垃圾检测框,与任一其他垃圾检测框之间的交并比大于预设交并比的情况下,删除所述任一其他垃圾检测框;When the currently traversed garbage detection frame has an intersection ratio with any other garbage detection frame that is greater than a preset intersection ratio, delete any other garbage detection frame;
    遍历结束后,将剩余的垃圾检测框确定为垃圾检测结果。After the traversal, the remaining garbage detection frames are determined as garbage detection results.
  9. 根据权利要求1所述的方法,所述垃圾检测结果为垃圾检测框,所述根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域,包括:The method according to claim 1, wherein the garbage detection result is a garbage detection frame, and according to the determined garbage detection result, determining a preset area where garbage exists as a garbage area includes:
    将任一垃圾检测框的中心点所在的预设区域,确定为垃圾区域;或者Determining the preset area where the center point of any garbage detection frame is located as the garbage area; or
    将与任一垃圾检测框的重合度满足预设重合条件的预设区域,确定为垃圾区域。A preset area whose coincidence degree with any garbage detection frame satisfies a preset coincidence condition is determined as a garbage area.
  10. 根据权利要求1所述的方法,所述获取针对所述待检测区域拍摄的目标图像,包括:The method according to claim 1, said acquiring the target image taken for said region to be detected comprises:
    获取针对所述待检测区域拍摄的多个目标图像;或者获取在预设时间段内针对所述待检测区域拍摄的多个目标图像;或者获取针对所述待检测区域连续拍摄的多个目标图像;Acquiring a plurality of target images taken for the region to be detected; or acquiring a plurality of target images taken for the region to be detected within a preset period of time; or acquiring a plurality of target images continuously taken for the region to be detected ;
    所述根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域,包括:According to the determined garbage detection result, determining the preset area where garbage exists as the garbage area includes:
    如果任一预设区域在针对预设图像数量的目标图像确定的垃圾检测结果中,都存在垃圾,则将所述任一预设区域确定为垃圾区域。If any preset area contains garbage in the garbage detection results determined for the preset number of target images, then any preset area is determined as a garbage area.
  11. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    确定待清扫的垃圾区域,并根据所述待清扫的垃圾区域确定清扫路线;所述清扫路线包括所述待清扫的垃圾区域。A garbage area to be cleaned is determined, and a cleaning route is determined according to the garbage area to be cleaned; the cleaning route includes the garbage area to be cleaned.
  12. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    获取垃圾种类与清扫方式的对应关系;Obtain the corresponding relationship between garbage types and cleaning methods;
    根据所确定的垃圾检测结果,确定垃圾区域中包含垃圾的种类;所述垃圾检测模型还用于检测垃圾种类;According to the determined garbage detection result, determine the type of garbage contained in the garbage area; the garbage detection model is also used to detect the type of garbage;
    根据任一垃圾区域中包含垃圾的种类,确定对应的清扫方式。According to the type of garbage contained in any garbage area, determine the corresponding cleaning method.
  13. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    检测所述待检测区域中的障碍物,将存在障碍物的预设区域确定为障碍区域;Detecting obstacles in the area to be detected, and determining a preset area where obstacles exist as an obstacle area;
    所述根据所确定的垃圾检测结果,将检测到存在垃圾的预设区域确定为垃圾区域,包括:According to the determined garbage detection result, determining the preset area where garbage is detected as the garbage area includes:
    根据所确定的垃圾检测结果,将检测到存在垃圾的非障碍区域确定为垃圾区域。According to the determined garbage detection result, the non-obstacle area in which garbage is detected is determined as the garbage area.
  14. 根据权利要求13所述的方法,所述检测所述待检测区域中的障碍物,包括:The method according to claim 13, said detecting obstacles in said region to be detected, comprising:
    针对所述目标图像,利用预先训练的障碍物检测模型确定障碍物检测结果。For the target image, a pre-trained obstacle detection model is used to determine an obstacle detection result.
  15. 根据权利要求14所述的方法,所述障碍物检测模型和所述垃圾检测模型包括的基础特征网络采用相同的训练样本集合进行训练,训练得到的基础特征网络相同;所述训练样本集合包括:标注有障碍物检测框标签的图像样本,以及标注有垃圾检测框标签的图像样本。The method according to claim 14, the basic feature network included in the obstacle detection model and the garbage detection model is trained using the same training sample set, and the basic feature network obtained through training is the same; the training sample set includes: Image samples labeled with obstacle detection boxes, and image samples labeled with garbage detection boxes.
  16. 一种垃圾检测装置,预先将待检测区域划分为至少两个预设区域;所述装置包括:A garbage detection device, which divides the area to be detected into at least two preset areas in advance; the device includes:
    获取单元,用于获取针对所述待检测区域拍摄的目标图像;an acquisition unit, configured to acquire a target image taken for the region to be detected;
    映射单元,用于确定所划分的预设区域在所述目标图像中的位置;a mapping unit, configured to determine the position of the divided preset area in the target image;
    检测单元,用于针对所述目标图像,利用预先训练的垃圾检测模型确定垃圾检测结果;A detection unit, configured to use a pre-trained garbage detection model to determine a garbage detection result for the target image;
    定位单元,用于根据所确定的垃圾检测结果,将存在垃圾的预设区域确定为垃圾区域。The positioning unit is configured to determine a preset area where garbage exists as a garbage area according to the determined garbage detection result.
  17. 一种无人清扫设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如权利要求1至15任一项所述的方法。An unmanned cleaning device, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein, when the processor executes the program, the process described in any one of claims 1 to 15 is realized. described method.
  18. 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1至15任一项所述的方法。A computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method according to any one of claims 1 to 15 is implemented.
PCT/CN2022/070517 2021-09-30 2022-01-06 Garbage detection WO2023050637A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111163884.9 2021-09-30
CN202111163884.9A CN115240094A (en) 2021-09-30 2021-09-30 Garbage detection method and device

Publications (1)

Publication Number Publication Date
WO2023050637A1 true WO2023050637A1 (en) 2023-04-06

Family

ID=83666404

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/070517 WO2023050637A1 (en) 2021-09-30 2022-01-06 Garbage detection

Country Status (2)

Country Link
CN (1) CN115240094A (en)
WO (1) WO2023050637A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116342895A (en) * 2023-05-31 2023-06-27 浙江联运知慧科技有限公司 Method and system for improving sorting efficiency of renewable resources based on AI (advanced technology attachment) processing
CN117314704A (en) * 2023-09-28 2023-12-29 光谷技术有限公司 Emergency event management method, electronic device and storage medium
CN117315541A (en) * 2023-10-12 2023-12-29 浙江净禾智慧科技有限公司 Ground garbage identification method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190347486A1 (en) * 2018-05-08 2019-11-14 Electronics And Telecommunications Research Institute Method and apparatus for detecting a garbage dumping action in real time on video surveillance system
CN111037554A (en) * 2019-12-12 2020-04-21 杭州翼兔网络科技有限公司 Garbage cleaning method, device, equipment and medium based on machine learning
CN111458721A (en) * 2020-03-31 2020-07-28 江苏集萃华科智能装备科技有限公司 Exposed garbage identification and positioning method, device and system
CN111767822A (en) * 2020-06-23 2020-10-13 浙江大华技术股份有限公司 Garbage detection method and related equipment and device
CN111797829A (en) * 2020-06-24 2020-10-20 浙江大华技术股份有限公司 License plate detection method and device, electronic equipment and storage medium
CN113255588A (en) * 2021-06-24 2021-08-13 杭州鸿泉物联网技术股份有限公司 Garbage cleaning method and device for garbage sweeper, electronic equipment and storage medium
CN113377111A (en) * 2021-06-30 2021-09-10 杭州电子科技大学 Task scheduling system and method for unmanned sweeper

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190347486A1 (en) * 2018-05-08 2019-11-14 Electronics And Telecommunications Research Institute Method and apparatus for detecting a garbage dumping action in real time on video surveillance system
CN111037554A (en) * 2019-12-12 2020-04-21 杭州翼兔网络科技有限公司 Garbage cleaning method, device, equipment and medium based on machine learning
CN111458721A (en) * 2020-03-31 2020-07-28 江苏集萃华科智能装备科技有限公司 Exposed garbage identification and positioning method, device and system
CN111767822A (en) * 2020-06-23 2020-10-13 浙江大华技术股份有限公司 Garbage detection method and related equipment and device
CN111797829A (en) * 2020-06-24 2020-10-20 浙江大华技术股份有限公司 License plate detection method and device, electronic equipment and storage medium
CN113255588A (en) * 2021-06-24 2021-08-13 杭州鸿泉物联网技术股份有限公司 Garbage cleaning method and device for garbage sweeper, electronic equipment and storage medium
CN113377111A (en) * 2021-06-30 2021-09-10 杭州电子科技大学 Task scheduling system and method for unmanned sweeper

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116342895A (en) * 2023-05-31 2023-06-27 浙江联运知慧科技有限公司 Method and system for improving sorting efficiency of renewable resources based on AI (advanced technology attachment) processing
CN116342895B (en) * 2023-05-31 2023-08-11 浙江联运知慧科技有限公司 Method and system for improving sorting efficiency of renewable resources based on AI (advanced technology attachment) processing
CN117314704A (en) * 2023-09-28 2023-12-29 光谷技术有限公司 Emergency event management method, electronic device and storage medium
CN117314704B (en) * 2023-09-28 2024-04-19 光谷技术有限公司 Emergency event management method, electronic device and storage medium
CN117315541A (en) * 2023-10-12 2023-12-29 浙江净禾智慧科技有限公司 Ground garbage identification method and system

Also Published As

Publication number Publication date
CN115240094A (en) 2022-10-25

Similar Documents

Publication Publication Date Title
WO2023050637A1 (en) Garbage detection
Tan et al. Toronto-3D: A large-scale mobile LiDAR dataset for semantic segmentation of urban roadways
WO2020052530A1 (en) Image processing method and device and related apparatus
US11386672B2 (en) Need-sensitive image and location capture system and method
JP2019149150A (en) Method and apparatus for processing point cloud data
EP2458336A1 (en) Method and system for reporting errors in a geographic database
CN111325788B (en) Building height determination method based on street view picture
CN106871906B (en) Navigation method and device for blind person and terminal equipment
WO2020093939A1 (en) Positioning method, device, and electronic apparatus
WO2021253245A1 (en) Method and device for identifying vehicle lane changing tendency
US11295521B2 (en) Ground map generation
WO2020093966A1 (en) Positioning data generation method, apparatus, and electronic device
Józsa et al. Towards 4D virtual city reconstruction from Lidar point cloud sequences
US20230249353A1 (en) Method for building a local point cloud map and Vision Robot
WO2021017211A1 (en) Vehicle positioning method and device employing visual sensing, and vehicle-mounted terminal
JP2021103160A (en) Autonomous traveling vehicle meaning map establishment system and establishment method
CN106687931A (en) Electronic equipment and method and device for monitoring monitored target
WO2022166606A1 (en) Target detection method and apparatus
JP5577312B2 (en) Data analysis apparatus, data analysis method, and program
CN106996785A (en) A kind of method and device being updated to navigation data
RU2638638C1 (en) Method and system of automatic constructing three-dimensional models of cities
WO2020135325A1 (en) Mobile device positioning method, device and system, and mobile device
CN113838129B (en) Method, device and system for obtaining pose information
CN111709354B (en) Method and device for identifying target area, electronic equipment and road side equipment
CN110660113A (en) Method and device for establishing characteristic map, acquisition equipment and storage medium