Object Detection in Images

Posted on
Tue Jul 11, 2017 10:34 pm
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Object Detection in Images

Looking for general thoughts/advice from the community...

I'd like improve the motion detection in my Security Camera plugin by detecting shapes. I am currently just calculating an average % pixel difference between images. Thoughts or opinions on approach:

1) Use Pillow (which my plugin already uses) to create bounding boxes around changes. Changes could be more localized in the image and, therefore (hopefully) more exact. I could look for bounding boxes of specific dimensions or area versus just general pixel changes.

2) Use OpenCV to detect shapes. There are many built in functions to do human detection and even facial recognition (not looking to do facial recognition at this time but might be a interesting future enhancement).

Benefit of #1 is that Pillow is a pretty simple install and it is already used by the plugin. However, it would require a bit more coding and would not be as accurate as OpenCV.

Benefit of #2 is that the features I am looking for are built in and can be done in a few lines of code - examples on how to do it are easily copied. Drawback is that it seems to be a pretty complicated install - even using homebrew still requires many steps.

I am open to other options or thoughts as well.

I have been going back and forth for a couple weeks now and am just looking for wisdom from the community.

Thanks

Posted on
Wed Jul 12, 2017 8:57 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Object Detection in Images

It is rather expensive, but the Sighthound has what looks like a good product with some intelligence and computer vision / recognition. I really want to play with this at some point when I have time -- but that just hasn't happened. The cost was like $250 for unlimited cameras but I guess that is in line with Security Spy and other DVR style recorders.

OpenCV's setup is what made me not try it a long while back -- I just wanted to play around with it, nothing too serious, but it looked involved and had many chances to have hiccups and I didn't feel like fighting it.

Just make sure you have decent horsepower, these computer vision platforms taking a lot of computing power.

Adam

Posted on
Wed Jul 12, 2017 11:57 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Object Detection in Images

Don't bother with sighthound. I own and use the unlimited version. It's "ok" but frankly security spy and even the now-defunct Evocam are superior. The people detection is ok in perfect conditions but it uses bounding boxes so something tall and thin will trigger it, even reflections in lighting changes. Development is slow and the apps/interfaces are painful. Spend some time on their forums, you won't find a lot of happiness.

As far as the op question, go with OpenCV! :-)

Terry

Sent from my iPhone using Tapatalk

Posted on
Wed Jul 12, 2017 2:22 pm
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Re: Object Detection in Images

I do have some concern with horse power and OpenCV. My current plugin combines the camera functions and the motion detection into a single device - my plan is to separate the two in the future release. This will allow users to either use the current motion detection - which isn't a terrible CPU hog, or the new, to be written, version.

Guess I'll be installing OpenCV this weekend...


Sent from my iPhone using Tapatalk

Posted on
Wed Jul 12, 2017 2:50 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Object Detection in Images

bkmar1192 wrote:
I do have some concern with horse power and OpenCV.

It'd be cool if OpenCV could be installed on a remote machine (think cheap linux box, RPi even) and called form the plugin. I've played with OpenCV a little, but have no clue if that's even possible, just a thought...

Terry

Posted on
Wed Jul 12, 2017 2:58 pm
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Re: Object Detection in Images

I've thought about that. Getting all the pieces to sync together may be the challenge.


Sent from my iPhone using Tapatalk

Posted on
Wed Jul 12, 2017 3:28 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Object Detection in Images

Don't bother with sighthound. I own and use the unlimited version. It's "ok" but frankly security spy and even the now-defunct Evocam are superior.

That's a bummer - it looks like really good software on the website. I'm not a huge fan of Security Spy for some reason.

It'd be cool if OpenCV could be installed on a remote machine (think cheap linux box, RPi even) and called form the plugin. I've played with OpenCV a little, but have no clue if that's even possible, just a thought...

Seems like you would be slinging a lot of video around the network unnecessarily -- at least assuming one machine / device is doing recording and the OpenCV is running and reading the feed as well? Unless I am misunderstanding the architecture here...

Really, ideally OpenCV would be installed and running on my NVR -- but I haven't found any NVRs that would be powerful enough... they are running stripped down Linux installations on under-powered processors from what I have seen. I suppose you could somewhat custom build one with a good processor and a Linux or Windows version of software (I know there are quite a few NVR software packages available on those platforms).

Adam

Posted on
Wed Jul 12, 2017 5:42 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Object Detection in Images

RogueProeliator wrote:
That's a bummer - it looks like really good software on the website. I'm not a huge fan of Security Spy for some reason.

Security Spy *seems* overpriced for each license step, that and the nice Sighthound website is exactly what pulled me in to SH.

Seems like you would be slinging a lot of video around the network unnecessarily...

I sometimes forget everyone doesn't have 10gig fiber and 1gig copper in their homes. :shock:

Really, ideally OpenCV would be installed and running on my NVR -- but I haven't found any NVRs that would be powerful enough... they are running stripped down Linux installations on under-powered processors from what I have seen. I suppose you could somewhat custom build one with a good processor and a Linux or Windows version of software (I know there are quite a few NVR software packages available on those platforms).

Adam


I hear ya. My whole thinking behind separating OpenCV is that I don't like the idea of anything sucking enough CPU to affect Indigo timings and would rather that be elsewhere, safely tucked away. I currently run Sighthound on a VM with 8 vcpus. 7 cameras (a mix of 640x480 up to full HD) consumes about 30% resources on that VM 24/7 and it will spike to 50-60% when processing a lot of rules, some of which are more CPU intensive than others. the "Entering an area" is particularly CPU hungry when processing oddly-shaped polygons on a HD cam.

Terry

Posted on
Wed Jul 12, 2017 7:45 pm
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Re: Object Detection in Images

The Security Camera plugin is a very poor mans version of a security program like sight hound or security spy. Since it is directly part of Indigo it just uses still images which would not be as much of a network hog as full video.

One idea is to use basic pixel difference to capture potential images that have a person and only pass those images to the OpenCV for the more intensive human detection. Not sure if that would create too much latency to make it useful. Ok - the wheels are turnin...

Btw - I'm running 8 high def cameras on my Indigo box with no impact on the Indigo app.


Sent from my iPhone using Tapatalk

Posted on
Thu Jul 13, 2017 1:17 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Object Detection in Images

Anyone heard anything about YOLO?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 13, 2017 1:53 pm
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

Re: Object Detection in Images

What about CoreML?

Posted on
Thu Jul 13, 2017 2:07 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Object Detection in Images

Shutter wrote:
What about CoreML?


The trick there is trying to call it from Python...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 13, 2017 4:49 pm
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Re: Object Detection in Images

jay (support) wrote:
Anyone heard anything about YOLO?


I have not - I'll do some research tonight.


Sent from my iPhone using Tapatalk

Posted on
Thu Jul 13, 2017 4:53 pm
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Object Detection in Images

I sometimes forget everyone doesn't have 10gig fiber and 1gig copper in their homes


Are you TRYING to make me cry? Here I am, only a few miles outside of one of my state's major metro areas, and I'm stuck with 10Mbps up/0.895 up!

In fact, this is one of the major reasons I went with Indigo. Totally local execution.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Thu Jul 13, 2017 9:41 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Object Detection in Images

I sometimes forget everyone doesn't have 10gig fiber and 1gig copper in their homes. :shock:

Well, to be fair my internal switches are all 1Gbps with Cat6 wiring -- and I have been trying to make sure all the cameras are on one switch along with the NVR just for organization / less hops. I am jealous of the fiber, and I had considered it, but in the end didn't own any equipment for, nor have the necessary knowledge to do all the terminations. The extent of my fiber work has pretty much been to look at the end of a cable and say "yet, getting light through there" and plug it in. I can at least terminate and run Cat6 :) #NotANetworkingExpert

Are you TRYING to make me cry? Here I am, only a few miles outside of one of my state's major metro areas, and I'm stuck with 10Mbps up/0.895 up!

I think he was talking internal network... but, yeah, that stinks! I might even stop complaining about the new bandwidth caps COX put in place.... nah, I'll keep complaining.

Anyone heard anything about YOLO?

I had not -- looked at the repository but there isn't too much documentation or information about it or integrating it. Doesn't appear, from the meager docs, difficult but no idea of the speed and throughput and such.

Adam

Who is online

Users browsing this forum: No registered users and 3 guests