Detection method and device

文档序号:1001178 发布日期:2020-10-23 浏览:6次 中文

阅读说明:本技术 一种检测方法及装置 (Detection method and device ) 是由 张士林 谢宇 于 2020-06-28 设计创作,主要内容包括:本发明公开了一种检测方法及装置,用以智能检测狗是否被合理看管,以提高社区居民的安全性。由于本发明可以在确定第一图像中存在狗时,通过目标检测模型确定第一图像中人与狗的距离小于预设的距离阈值,且狗绳被人牵引时,确定该狗被合理看管,否则,确定该狗没有被合理看管,此时控制报警设备报警,从而可以提高社区居民的安全性。(The invention discloses a detection method and a detection device, which are used for intelligently detecting whether a dog is reasonably watched or not so as to improve the safety of community residents. According to the invention, when the dog exists in the first image, the distance between the person and the dog in the first image is determined to be smaller than the preset distance threshold value through the target detection model, and when the dog rope is pulled by the person, the dog is determined to be reasonably watched, otherwise, the dog is determined not to be reasonably watched, and the alarm equipment is controlled to give an alarm, so that the safety of community residents can be improved.)

1. A method of detection, the method comprising:

acquiring a first image to be detected;

when the dog exists in the first image, through a pre-trained target detection model, if the distance between a person and the dog in the first image is smaller than a preset distance threshold value and a dog rope is pulled by the person, the dog is determined to be reasonably watched, and otherwise, an alarm device is controlled to give an alarm.

2. The method of claim 1, wherein after determining that the dog is present in the first image, determining whether the person is less than a preset distance threshold from the dog in the first image and before the dog leash is pulled by the person through a pre-trained object detection model, the method further comprises:

acquiring first position information of the dog in the first image;

and judging whether the first position information of the dog is in a preset target area, and if so, performing subsequent steps.

3. The method of claim 1, wherein if it is determined that no person is present in the first image, before controlling an alarm device to alarm, the method further comprises:

acquiring a second image within a first set time length after the first image;

judging whether a person exists in the second image or not through the pre-trained target detection model;

and if no person exists in the second image, performing subsequent alarm control on alarm equipment.

4. The method of claim 1, wherein if it is determined that a dog leash is not present in the first image, before controlling an alarm device to alarm, the method further comprises:

acquiring a third image within a second set time length after the first image;

judging whether a dog leash exists in the third image or not through the pre-trained target detection model;

and if the dog leash does not exist in the third image, performing subsequent alarm control on alarm equipment.

5. The method of claim 1, wherein determining that a person is present in the first image through a pre-trained target detection model when it is determined that a dog is present in the first image, and the distance between the person and the dog is smaller than a preset distance threshold comprises:

determining that a dog exists in the first image and first position information where the dog is located and determining that a person exists in the first image and second position information where the person is located through the pre-trained target detection model;

judging whether the distance between the dog and the person is smaller than a preset distance threshold value or not according to the first position information and the second position information; if yes, the determined distance is smaller than a preset distance threshold.

6. The method of claim 5, wherein determining that a dog leash is present in the first image through a pre-trained object detection model, the dog leash being pulled by the person comprises:

determining that a dog leash and third position information of the dog leash exist in the first image through a pre-trained target detection model;

and judging whether the third position information of the dog leash is positioned between the dog and the person or not based on the first position information, the second position information and the third position information, and if so, determining that the dog leash is pulled by the person.

7. The method of claim 1, wherein prior to determining that the dog is properly attended, the method further comprises:

acquiring a fourth image within a third set time length after the first image;

determining the position offset of the dog, the person and the dog leash in the fourth image and the first image, and respectively determining a first moving speed of the dog, a second moving speed of the person and a third moving speed of the dog leash;

and judging whether the third moving speed is between the first moving speed and the second moving speed, and if so, carrying out subsequent steps of determining that the dog is reasonably watched.

8. The method of claim 7, further comprising:

and if the second moving speed is not between the first moving speed and the third moving speed, controlling the alarm equipment to alarm.

9. The method of claim 1, wherein training the target detection model comprises:

acquiring any sample image containing a target object in a sample set, wherein the sample image corresponds to a sample class label and sample position information of the target object corresponding to the sample class label in the sample image; wherein the sample class label is used to identify a class of a target object contained in the sample image;

determining the identification category label and the corresponding identification position information of the target object contained in the sample image through an original target detection model;

and training an original target detection model according to the sample class label, the identification class label, the sample position information and the identification position information to obtain a trained target detection model.

10. A detection device, the device comprising:

the acquisition module is used for acquiring a first image to be detected;

and the determining module is used for determining that the dog exists in the first image, determining that the dog is reasonably watched if the distance between the person and the dog in the first image is smaller than a preset distance threshold value and the dog rope is pulled by the person through a pre-trained target detection model, and otherwise, controlling an alarm device to give an alarm.

Technical Field

The present invention relates to the field of detection technologies, and in particular, to a detection method, apparatus, device, and medium.

Background

With the improvement of living standard of people, more and more residents like to raise dogs, resulting in the rising of the dog hurting events. Among them, a large number of dog injuring events are caused by the reason that dogs are not properly watched.

For example, although dog-keeping regulations in various cities stipulate that "when dogs are carried out, a dog chain should be restricted to dogs and pulled by adults", there are not many owners capable of doing so. There are surveys showing that in the 53 dog injuring event, 48 dog injuring events, which are caused by the dog not being properly attended by dog leashes and the like, account for 90% of the dog injuring events.

It can be seen that the behavior of dogs that are not properly watched has had a certain impact on the security of community residents.

Disclosure of Invention

The embodiment of the invention provides a detection method, a detection device, equipment and a detection medium, which are used for intelligently detecting whether a dog is reasonably watched or not so as to improve the safety of community residents.

In a first aspect, the present invention provides a detection method, comprising:

acquiring a first image to be detected;

when the dog exists in the first image, through a pre-trained target detection model, if the distance between a person and the dog in the first image is smaller than a preset distance threshold value and a dog rope is pulled by the person, the dog is determined to be reasonably watched, and otherwise, an alarm device is controlled to give an alarm.

In a second aspect, the present invention provides a detection apparatus, the apparatus comprising:

the acquisition module is used for acquiring a first image to be detected;

and the determining module is used for determining that the dog exists in the first image, determining that the dog is reasonably watched if the distance between the person and the dog in the first image is smaller than a preset distance threshold value and the dog rope is pulled by the person through a pre-trained target detection model, and otherwise, controlling an alarm device to give an alarm.

In a third aspect, the present invention provides an electronic device, comprising at least a processor and a memory, the processor being configured to implement the steps of any of the detection methods described above when executing a computer program stored in the memory.

In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the detection methods described above.

According to the embodiment of the invention, when the dog exists in the first image, the distance between the person and the dog in the first image is determined to be smaller than the preset distance threshold value through the target detection model, and the dog is determined to be reasonably watched and managed when the dog rope is pulled by the person, otherwise, the dog is determined not to be reasonably watched and the alarm device is controlled to alarm, so that the safety of community residents can be improved.

Drawings

Fig. 1 is a schematic diagram of a detection process according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a target area being set in the center area of a first image according to an embodiment of the present invention;

FIG. 3 is a schematic illustration of determining a distance between a person and a dog in accordance with an embodiment of the present invention;

FIG. 4 is a schematic diagram of an embodiment of the present invention for determining the size of the abscissa of the dog leash between the abscissa of the person and the abscissa of the dog;

FIG. 5 is a schematic diagram of another detection process provided by the embodiment of the present invention;

FIG. 6 is a schematic diagram of a detecting apparatus according to an embodiment of the present invention;

fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In order to intelligently detect whether the dog is reasonably watched or not and improve the safety of community residents, the embodiment of the invention provides a detection method, a detection device, detection equipment and a detection medium.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于AGV与激光跟踪仪的组合定位装置及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!