Separate IVS Rules for Cloned Spotter Camera - Is it possible?

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
Noticed this in the API...

Find media files with IVS info


IVS rule condition. It can be: "CrossLineDetection" , "CrossRegionDetection" , "LeftDetection" , "WanderDetection"
"MoveDetection" , "RioterDetection" , "CrossFenceDetection" , "TakenAwayDetection" , "PasteDetection" , "Preservation" , "StayDetection" , "TailDetection"

IVS action. It can be: "Appear" , "Disappear" , "Inside" ,"Cross"

IVS object type, item in array can be: "Unknown" , "Human" ,"Vehicle" , "NonMotor"
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,833
Reaction score
6,394
You'd need the clone since you can't differentiate what happens as far as moving the PTZ by rule within the same cam. i.e., Whatever triggers the cam also moves the PTZ (if checked to do so). So you need to separate out the clone to do the move based ONLY on human vs the other events that may trigger the spotter.

I have it working now in a way that (I think) should adapt in a general way for your purposes. Here's what I did:
  • Set the PTZ up to work as I wanted as far as IVS/presets. That controls where the PTZ can be moved with presets and the tracking part after that.
  • In BI for the "spotter" cam, I set that to work with all ONVIF events checked and otherwise set to capture both vehicles and humans as you'd normally have it but set it so that it does NOT move the PTZ. That captures events/triggers for both vehicles and humans to record/alert/whatever as you want for that cam but it no longer really works as a "spotter" since it's not moving the PTZ.
  • In the web config for spotter cam itself you need to somehow differentiate IVS rules for vehicle vs human. I made an intrusion box that detects both vehicles and humans as Rule 1 and a tripwire that only detects humans as Rule 2. (You need both in your case since you still want to detect vehicles and people for the BI "spotter" cam. If you didn't then you could just use one rule with human detection and done.)
  • I made a clone of the spotter cam and set it to move the PTZ to the desired preset.
  • On the clone under ONVIF config I unchecked RuleEngine/FieldDetector/ObjectsInside to exclude events generated from the Rule 1 intrusion box (as above) that picks up vehicles in addition to humans.

That works. Vehicles go by, they're captured by the "spotter" cam as normal but the PTZ doesn't move. Humans walk by, they're also captured by the spotter cam and by the clone and the PTZ moves to the desired preset to capture and follow them.

You'd need to adapt the ONVIF config events selected/unchecked to match however you set up the IVS rules. e.g., if you were using an intrusion box instead of a tripwire to do the human-only detection, then you'd have RuleEngine/FieldDetector/ObjectsInside checked and the LineDetector event not checked, etc. A lot of the rest don't need to be there but I don't have enough foot traffic going by now to do that easily and I'm tired of walking out there. I had it working and then started paring it down and it stopped so need to wait to have more to test with. If you were using regular motion or other ways, you'd need to exclude/include that too as you'd want.

In any case, that shows that you can now differentiate some of the ONVIF events from the cam and do something different with it using the same physical spotter cam.

Regarding the "trigger now" I remember from testing some other things that triggering the cam manually in BI like that doesn't generate the same messages as external triggers so you won't see any equivalent ONVIF message there. You'd need to actually trigger the cam in some way to test that. The IVS-1 (or whatever) shows in ONVIF Device Manager as part of the event message so I know that it's generated but not sure whether BI can pick that up. I was thinking that we could do that as a "contains" to make our own event listener for that but haven't gotten that far with it. Also, the way that "Most recent events box" works sucks. It only has a limited amount of space and you can see things go by when something happens but then that scrolls off and you can't scroll back to see.
 
Last edited:

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
Implementing your instructions. Testing with two questions.

1) In place of using Rule 1 as an IVS tripwire for both human and vehicle for the spotter cam (cul-de-sac) could the alternative choice be made to use one rule for each such as Rule 1 IVS tripwire for vehicle and Rule 2 IVS tripwire of human. Thus no single IVS rule that contains both.

2) For the "Listen For" profiles on the cloned spotter cam (cul-de-sac) unchecked RulesEngine/MyRuleDetector/VehicleDetect and RulesEngine/FieldDectector/ObjectInside. Are these the correct choices for the tripwire?

Waiting for vehicle and foot traffic for more testing.

Appreciate the time and effort you put into testing and the write up. Your insight into how all of this works together is amazing!!
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,833
Reaction score
6,394
Implementing your instructions. Testing with two questions.

1) In place of using Rule 1 as an IVS tripwire for both human and vehicle for the spotter cam (cul-de-sac) could the alternative choice be made to use one rule for each such as Rule 1 IVS tripwire for vehicle and Rule 2 IVS tripwire of human. Thus no single IVS rule that contains both.
If you mean for the spotter that you want to capture both then, yes, as long as you don't care if it's either and the way that you set up the rule works to detect what you want to capture. You do need the separate human-only one to key off for the clone if you only want the PTZ to be moved only to react to humans.

2) For the "Listen For" profiles on the cloned spotter cam (cul-de-sac) unchecked RulesEngine/MyRuleDetector/VehicleDetect and RulesEngine/FieldDectector/ObjectInside. Are these the correct choices for the tripwire?
I'm not sure yet how the PeopleDetect and VehicleDetect work. I don't see that BI ever reports those in the logs so I wouldn't use them at this point. I know that BI can distinguish between tripwires and intrusion boxes. I'd stick with those two for now. However you wanted to set them up for humans vs vehicles should work either way. You'd just EXCLUDE what you don't want. If you use a tripwire, then you'd UNcheck the entry for RulesEngine/FieldDectector/ObjectInside. i.e., you're not listening for the intrusion box events. If using intrusion box, then UNcheck RuleEngine/LineDetector/Crossed. What triggers whatever event is determined by how you set the rule up in the cam. e.g., The intrusion box for cars, tripwire for people or however so the cam is already doing the selection up front when it generates the event and you don't need to detect it on the back end on the clone. If that makes sense.

A lot of the others don't really need to be there but unless you have some other things going on like regular motion detection then it's easier to just do it by exclusion and the rest don't affect it. I think that you could exclude the VehicleDetect one and that wouldn't affect anything.

Waiting for vehicle and foot traffic for more testing.

Appreciate the time and effort you put into testing and the write up. Your insight into how all of this works together is amazing!!
I don't really have any insight. lol I'm just poking at it until it either works or I get tired of messing with it. I've been curious how it worked anyway.

The biggest problem that I've seen is that my PTZ seems slow to trigger and get there and then to pick up motion and start tracking. The trigger and move works reliably but not always fast enough or great once it gets there. Could be my scene. The cam that I'm using isn't really set up well for where I'm trying to catch people and cars. Or maybe I need to set the PTZ rules up better.
 
Last edited:

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
Changed the setting from two IVS tripwire rules to the same as in your post. Rule 1 as an intrusion box with both human and vehicle. Rule 2 as a tripwire for human only.

Also unchecked For the "Listen For" profiles on the cloned spotter cam (cul-de-sac) RulesEngine/MyRuleDetector/VehicleDetect with the remaining profiles all set green or checked.

Kept thinking that BI could differentiate between different tripwire settings that were based on human or vehicle. However, that does not seem possible at the moment. But BI at present can tell the difference between a tripwire or an intrusion box. That will work....

Excellent explanation of the setup. Just now made the changes and will test this evening as foot and auto traffic increase.

Also noticed the same slow to detect issue with the PTZ. A person is almost half way through the detection zone before it picks up. Trying several tripwire sets, within the detection zone, to see if multiple sets of tripwires would decrease that delay in place of one overly large tripwire zigzag.

Thanks again for all of your fine assistance....
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
After testing for a few days this works as expected. There are zero vehicles triggering the PTZ. Only the spotter cam (cul-de-sac) displays timeline hits for both humans and vehicles. The BI cloned spotter (cul-de-sac) camera also shows the same timeline hits, but now have it set to not record video as duplicate video is not needed.

One rather interesting aspect of this setup is that the FOVs of both the spotter and PTZ must be considered when adding tripwires or the intrusion box. If human activity originates within the trigger zone of the spotter cam, then the PTZ will go to preset 2 but not track until the PTZ human trigger zone is activated. Thus proper placement of these zones becomes an important factor to consider.

A two thumbs up to Mike A. for coming up with the solution... thank you
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,833
Reaction score
6,394
Glad that you got it working. It's pretty simple in principle - just exclude whatever ONVIF events you don't want to listen for on the clone that's doing the move. But as you say you've got 3 different places where things are going on so need to consider what's happening where.

Biggest thing that I've seen trying it with SD4A425DB-HNY is that, first, it's a little slow to respond to the move initially and, second, it takes a moment for it to settle in after the move and do whatever AI evaluation before it starts the tracking. So, at least with my view here, by the time that it gets there and triggers, the target is nearly gone from the frame. That cam in particular seems a little limited on compute resources. I had it recording to an SD card at first and it was missing most all. Turning off recording improved both how quickly it responds to the initial move and to how quickly it started tracking so I'm catching them at about 1/2 to 2/3rds of the way through the view. Not really related to the selective ONVIF triggers as above, would apply to moving with any spotter, but it does affect the end result.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,028
Reaction score
48,796
Location
USA
BI version 5.8.5.6 has added a lot more flexibility and getting us very close to this goal. Actually I think it is probably as close as it can get unless BI sets up a section just for Dahua IVS cams.

Before this version it still didn't do what I wanted (wouldn't allow me to have a camera trigger for BI motion and then allow me to alert based on different IVS rules and wouldn't allow it to trigger different functions based on which IVS rule was triggered) without the use of clones, which can get messy and complicated and remembering what does what later.

It is now possible!!!!

With my 180 camera I was able to set up different IVS rules and have it send the PTZ to all these different areas.

So I can set up a zone one one side of the street with a PTZ preset zoomed in tighter to that side of the road and a zone on my side of the street with a PTZ preset zoomed in tighter to this side of the road instead of my before just generally more wide PTZ preset to get either side of the road.

Takes a little bit of work and isn't plug-n-play, but wow is it a game changer.

Here is how it is done.

Under the ONVIF Triggers comes up all of the camera events it listens to. Each one corresponds to something in the camera - motion detection, SMD, IVS tripwire, IVS intrusion, etc.

1707346290728.png


There is no need to figure out which is what if you are using IVS rules, so you can turn all of those off.

Instead, either keep track of what each IVS rule is named (IVS-1, IVS-2, etc.) or rename each rule in the camera GUI.

Then simply hit the + sign and in the Contains block put in the name of the IVS rule (IVS-1 or if you renamed it something else) and then in the memo you cut put down what it is for.

1707346729163.png


As they populate, they will show up in the Listen for:


1707346565911.png


Then you go into the alerts tab and the stuff you put in the Memo field can be used for the required AI:

1707346880280.png


Then you go to the spotter camera in BI and go to the Alerts tab and select one of the bottom two depending on your use case.

Use the "New zones/sources only (additive)" option if you are going to have several IVS rules being used in one camera and want to be able to do something with each rule separately.

The "New zones/sources only (exclusive)" option is a cool feature if you want to primarily use IVS rules for triggering your alerts, but you want to use BI motion to capture wildlife and other things. Prior to this option, you would need to use a clone because if the motion triggered first, then the IVS wouldn't trigger. Now you can use one camera and this trigger option and the object can trigger BI motion first and if it then triggers IVS, it will alert you of the IVS trigger.

1707346981408.png
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,028
Reaction score
48,796
Location
USA
That's a good addition. Much cleaner.
Yeah the ability to have multiple rules and each do something else is a game changer. Like you had IVS intrusion for car and tripwire for person because we couldn't separate out the different triggers of the same function (tripwire or intrusion). Now I can have 3 tripwires and have BI differentiate them.

I am glad to have got rid of clones. It just made is messy months later trying to figure out what was what.
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,833
Reaction score
6,394
Exactly. Was clunky and I'd forget what I had going on where and don't really like the hidden clones. Guess I'll have to renew again and upgrade for this one. I've been sitting out for a while.
 

jazzy1

Getting the hang of it
Joined
Mar 23, 2015
Messages
300
Reaction score
38
Hi...trying to follow this great thread....quick question...I have a couple cams which are quite high up and far from the area I have my IVS rules defined....in a 5231 cam, nothing seems to be triggering...I've turned off Motion detection in the cam AND BI....trying to rely only on only IVS and CPAI for people/vehicle id....then wanted to use those to trigger a PTZ for the different IVS rules...any ideas?
 

looney2ns

IPCT Contributor
Joined
Sep 25, 2016
Messages
15,634
Reaction score
22,891
Location
Evansville, In. USA
Hi...trying to follow this great thread....quick question...I have a couple cams which are quite high up and far from the area I have my IVS rules defined....in a 5231 cam, nothing seems to be triggering...I've turned off Motion detection in the cam AND BI....trying to rely only on only IVS and CPAI for people/vehicle id....then wanted to use those to trigger a PTZ for the different IVS rules...any ideas?
Post a shot of the cameras view and how you have the IVS rules drawn.
 

jazzy1

Getting the hang of it
Joined
Mar 23, 2015
Messages
300
Reaction score
38
Post a shot of the cameras view and how you have the IVS rules drawn.
So, against the good advice of everyone, I thought I'd upgrade the 5231 firmware to the 22.12.20 version....the IVS seems to work now...however, I'm seeing a lot of No Signal errors in Blueiris now, and not only on that one camera....there weren't any before...from what I see, the SD card in the cam has failed (impossible to format)..unfortunately the cam is high up in a difficult spot to reach so I will need to get help pulling it down to remove the card....is it possible this problem is causing the No Signal errors? could they be impacting other cams? Should I try downgrading the firmware on this 5231 cam?
 
Top