简体   繁体   中英

Virtual dog fence with ImageAI

I'd like to detect when my dog sets foot in the lawn. In the attached image, that brown-reddish dirt strip will eventually become my lawn.

I have a fixed camera that streams a live video of my backyard, including the lawn. With the help of ImageAI I was able to quickly create code that tracks my dog in the video.

I'm wondering how should I detect when the dog actually sets foot in the lawn, as opposed to just roaming about the backyard. My current naive approach is to create a polygon that traces the contour of the lawn in the video feed, and see if the tracked dog's bounding box is mostly within this lawn polygon.

Surely there are better ways to do it.

在此处输入图像描述

Any advice?

As the camera is fixed, the area of the lawn is fixed in one frame. So just use 0-1 mask to mark this area and check whether the bounding box of dog has intersection with this mask. I think it is easier than checking the polygonal bounding of lawn.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM