Hi,
I am testing Analytics Events using two Milestone examples: Trigger Analytics Event; and SC Overlay on Event. When I send an Analytics Event, I receive it on the Alarms Panel and event information is displayed as text for the relevant camera. Everything works well without errors.
However, when I include overlay, the overlay is not displayed. I still receive the event without error and even the of the overlay object is displayed as text, but no polygon.
I have tried suggestions at below link: https://force.milestonesys.com/support/MccSupportCommunity#!/feedtype=SINGLE_ARTICLE_SEARCH_RESULT&id=kA4200000008csO
Do you have any suggestions?
Regards,
Oz
There are two samples: Smart Client Overlay on Event plugin sample displays text and Smart Client Overlay Graph on Event plugin sample displays bounding boxes.
Note that Smart Client Overlay Graph on Event displays only briefly and only in live mode, make sure you have the camera in live mode on the screen and your eyes on the screen when you submit the event.
If you use the Analytics Event trigger via MIP .Net library sample you can test without using the Smart Client Overlay Graph on Event plugin sample, this is described in the documentation for the Analytics Event trigger via MIP .Net library sample. Please see if this works as a first step. -It would be a first step indicating if we should suspect the data coming in or should suspect the display of analytics events overlay to be where it goes wrong.
Thanks Bo,
I tried both of your suggestions:
- Using Smart Client Overlay Graph on Event:
When I send the Analytics Event, a pop-up window displays on client with message:
Draw Overlay
Object Does not match target type (mscorlib)
- Using Analytics Event trigger via MIP .Net library
Compiles fine, but when run, the below error message is displayed:
An unhandled exception of type ‘System.BadImageFormatException’ occurred in mscorlib.dll
Regards,
Oz
Hi Bo,
In answer to your questions:
- I am using MIP SDK 2014 and Smart Client 2014 (on 64 bit machine); and
- I was previously testing using Trigger Analytics Event via XML found in Protocol Samples.
When I built the Analytics Event trigger via MIP .Net library using x86 configuration, it built and run without errors, but similar to via XML version, no overlay. The issue seems, as you suggested, related to 64 vs 32 bit.
This is the code that results in error (Object Does not match target type) for Overlay Graph on Event example:
Bitmap bitmap =VideoOS.Platform.Util.AnalyticsOverlayBuilder.BuildOverlay(320, 240, (BaseEvent)oo.eventObject);
addOn.SetOverlay(bitmap, _overlayId, Keepaspect, Scalewithzoom, Scale, 1.0,
System.Windows.Forms.DockStyle.Top,
System.Windows.Forms.DockStyle.Left, 0.0, 0.0);
I am going to refocus on this in a few days and post if I find the exact dll that is causing the issue. Should I be only looking at dlls within Smart Client.
Thanks for your help.
Oz
When building a plugin where all is .NET you can build for “Any CPU” which should also be the setup of the PlatformSamples. So in the plugin it is not the issue (unless your plugin again calls a dll build in c++ or similar). (Could be an issue in the standalone but not in the plugin.) I cannot reproduce the issue you see and I am using the newest Smart Client and MIP SDK. Did you do any modification to the Analytics Event trigger via MIP .Net library sample?
I have another document that introduces Analytics Events, and perhaps in a more thorough way than the MIP Documentation. Could you please consult the document and double-check your setup?
http://download.milestonesys.com/MIPSDK/Samples/TriggerAlarmFromExternal-ConceptSolution.pdf
Hi Bo,
I saw a post by Eli Dori who suggested that "In order to have SCOverlayGraphOnEvent work, I had to change Program.cs, and to wrap the call to addOn.SetOverlay with ClientControl.Instance.CallOnUiThread(() => …);
When I did above, the overlays started working.
Cheers,
Oz