Skip to content

Commit

Permalink
Merge pull request #379 from onvif/development
Browse files Browse the repository at this point in the history
23.12 release
  • Loading branch information
HansBusch authored Dec 21, 2023
2 parents 464b988 + d841201 commit 45b5dc4
Show file tree
Hide file tree
Showing 21 changed files with 2,458 additions and 3,737 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.dia~
163 changes: 25 additions & 138 deletions doc/Analytics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<info>
<title>Analytics Service Specification</title>
<titleabbrev>Analytics</titleabbrev>
<releaseinfo>23.06</releaseinfo>
<releaseinfo>23.12</releaseinfo>
<author>
<orgname>ONVIF™</orgname>
<uri>www.onvif.org</uri>
</author>
<pubdate>June, 2023</pubdate>
<pubdate>December, 2023</pubdate>
<mediaobject>
<imageobject>
<imagedata fileref="media/logo.png" contentwidth="60mm"/>
Expand Down Expand Up @@ -259,6 +259,14 @@
</author>
<revremark>Addition of spherical coordinate descriptor, direction descriptor and barcode information. Rule additions for abondoned and removed objects.</revremark>
</revision>
<revision>
<revnumber>23.12</revnumber>
<date>Dec-2023</date>
<author>
<personname>Sriram Bhetanabottla, Hans Busch, Sujith Raman</personname>
</author>
<revremark>JSON Payload section moved to Core spec, fix EyeShape definition, clarify metadata image format and add optional event object description.</revremark>
</revision>
</revhistory>
</info>
<chapter>
Expand All @@ -281,8 +289,6 @@
<para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.iso.org/standard/63545.html"></link>&gt;</para>
<para>RFC 7159 The JavaScript Object Notation (JSON) Data Interchange Format</para>
<para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.rfc-editor.org/rfc/rfc7159.txt"></link>&gt;</para>
<para>JSON-LD 1.1 A JSON-based Serialization for Linked Data</para>
<para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://json-ld.org/spec/latest/json-ld/"></link>&gt;</para>
</chapter>
<chapter>
<title>Terms and Definitions</title>
Expand Down Expand Up @@ -1375,7 +1381,7 @@
</section>
<section xml:id="_Ref515972960">
<title>Image Data</title>
<para>Frames where objects have been detected can also carry image data within the Scene Description. Image Data relating to a detected object are added in the Appearance Node. Below, the definitions of Image and ImageRef are given for convenience:</para>
<para>Frames where objects have been detected can also carry image data within the Scene Description. Image Data relating to a detected object are added in the Appearance Node. When embedding Image Data as base64Binary, image format shall be either JPG or PNG (On receiving end, start bytes may be used to identify the image type). Below, the definitions of Image and ImageRef are given for convenience:</para>
<programlisting><![CDATA[<xs:complexType name="Appearance">
<xs:sequence>
<xs:element name="Transformation" type="tt:Transformation" minOccurs="0"/>
Expand Down Expand Up @@ -2443,9 +2449,9 @@
</listitem>
</itemizedlist></para>

<para>The following sections describe how topics and payload shall be
structured by an ONVIF metadata producer when published to an MQTT
broker.</para>
<para>The following section describe how topics shall be structured by an ONVIF metadata
producer when published to an MQTT broker. The payload shall be encoded as defined in
Annex E of the ONVIF Core Specification.</para>
</section>
<section>
<title>MQTT topic structure</title>
Expand Down Expand Up @@ -2569,120 +2575,6 @@
</itemizedlist></para>
</section>

<section>
<title>JSON payload format</title>

<para>Instead of creating a full fledged schema for XML to JSON conversion, <xref
linkend="xmlToJson"/> provides a set of generic rules that devices shall need to
implement to express ONVIF metadata in JSON format as defined by RFC 7159.</para>

<table xml:id="xmlToJson">
<title>ONVIF Metadata XML to JSON conversion</title>

<tgroup cols="3">
<thead>
<row>
<entry align="center"><para>ONVIF XML Element</para></entry>

<entry align="center"><para>ONVIF JSON
Representation</para></entry>

<entry align="center"><para>Description</para></entry>
</row>
</thead>

<tbody>
<row>
<entry><para>&lt;xmltag/&gt;</para></entry>

<entry><para>“xmltag”: null</para></entry>

<entry><para>Null tag</para></entry>
</row>

<row>
<entry><para>&lt;xmltag&gt;text&lt;/xmltag&gt;</para></entry>

<entry><para>“xmltag”: "text"</para></entry>

<entry><para>Simple tag with value</para></entry>
</row>

<row>
<entry><para>&lt; xmltag name="value" /&gt;</para></entry>

<entry><para>“xmltag”:{"@name": "value"}</para></entry>

<entry><para>Tag with attribute</para></entry>
</row>

<row>
<entry><para>&lt;xmltag name="value"&gt;text&lt;/
xmltag&gt;</para></entry>

<entry><para>“xmltag”: { "@name": "value", "#text": "text"
}</para></entry>

<entry><para>Tag with attribute and value</para></entry>
</row>

<row>
<entry><para>&lt;xmltag&gt; &lt;tag1&gt;text&lt;/tag1&gt;
&lt;tag2&gt;text&lt;/tag2&gt; &lt;/xmltag</para></entry>

<entry><para>“xmltag”: { "tag1": "text", "tag2": "text"
}</para></entry>

<entry><para>Tag with multiple child tags</para></entry>
</row>

<row>
<entry><para>&lt;xmltag&gt; &lt;tag1&gt;text&lt;/tag1&gt;
&lt;tag1&gt;text&lt;/tag1&gt; &lt;/ xmltag&gt;</para></entry>

<entry><para>“xmltag”: { "tag1": ["text", "text"]
}</para></entry>

<entry><para>Tag with multiple child tags of same type
(similar to minOccurs &gt; 1)</para></entry>
</row>
</tbody>
</tgroup>
</table>

<para>All extension elements and attributes shall be included within
the same parent JSON object.</para>
<para>Note, that quotes may be omitted for integer and floating point values as well as logical states true and false.</para>
<para>Namespace prefixes for ONVIF defined namespaces shall be
dropped, i.e. elements and attributes that belong to the following
namespaces:</para>

<itemizedlist>
<listitem>
<para>http://www.onvif.org/ver10/schema</para>
</listitem>

<listitem>
<para>http://www.onvif.org/ver20/analytics/humanface</para>
</listitem>

<listitem>
<para>http://www.onvif.org/ver20/analytics/humanbody</para>
</listitem>

<listitem>
<para>http://www.onvif.org/ver20/analytics/radiometry</para>
</listitem>
</itemizedlist>

<para>XML elements and attributes that belong to a different namespace
shall have their names prepended with their corresponding namespace
prefix joined by a ':' as shown in the example while defining
the namespace in the "context" object as per JSON-LD specification.<xref
linkend="example"/>. See specifically the acme:ColorName
exampe.</para>
</section>

<section xml:id="example">
<title>Example</title>

Expand Down Expand Up @@ -2805,6 +2697,7 @@ xmlns:acme="http://www.acme.com/schema"&gt;
}, {
"@x": 20.0, "@y": 80.0
}]
}
},
"Color": {
"ColorCluster": [{
Expand Down Expand Up @@ -3887,6 +3780,8 @@ xmlns:acme="http://www.acme.com/schema"&gt;
<para role="text">Optional list of objects triggering this rule.</para>
<para role="param">ClassTypes - optional [tt:StringList]</para>
<para role="text">Optional list of class types of the detected objects, one for each object, in the same order as object ids are listed.</para>
<para role="param">Object - optional, unbounded [tt:Object]</para>
<para role="text">Optional description of objects triggering this rule. </para>
</listitem>
</varlistentry>
</variablelist>
Expand All @@ -3901,9 +3796,12 @@ xmlns:acme="http://www.acme.com/schema"&gt;
...
<tt:SimpleItemDescription Name="ObjectId" Type="tt:StringList"/>
<tt:SimpleItemDescription Name="ClassTypes" Type="tt:StringList"/>
<tt:ElementItemDescription Name="Object" Type="tt:Object"/>
</tt:Data>
<tt:ParentTopic>tns1:RuleEngine/Xxxx</tt:ParentTopic>
</tt:Messages>]]></programlisting>
<para>Note that if the message includes Object information there is no need to include
ObjectIds, because each Object includes its ID.</para>
</section>
<section>
<title>Parameters</title>
Expand Down Expand Up @@ -6428,7 +6326,7 @@ xmlns:acme="http://www.acme.com/schema"&gt;
</thead>
<tbody valign="top">
<row>
<entry morerows="2">
<entry morerows="1">
<para>EyeShape</para>
</entry>
<entry>
Expand All @@ -6438,26 +6336,12 @@ xmlns:acme="http://www.acme.com/schema"&gt;
<para>
<inlinemediaobject>
<imageobject>
<imagedata fileref="media/Analytics/image35.png" contentwidth="45mm"/>
<imagedata fileref="media/Analytics/image36.png" contentwidth="45mm"/>
</imageobject>
</inlinemediaobject>
</para>
</entry>
</row>
<row>
<entry>
<para>Slitty</para>
</entry>
<entry>
<para>
<inlinemediaobject>
<imageobject>
<imagedata fileref="media/Analytics/image36.png" contentwidth="45mm" />
</imageobject>
</inlinemediaobject>
</para>
</entry>
</row>
<row>
<entry>
<para>Round</para>
Expand Down Expand Up @@ -7496,6 +7380,7 @@ xmlns:acme="http://www.acme.com/schema"&gt;
<tt:Data>
<tt:SimpleItemDescription Name="Class" Type="tt:StringList"/>
<tt:SimpleItemDescription Name="Score" Type="tt:FloatList"/>
<tt:SimpleItemDescription Name="Loudness" Type="xs:float"/>
</tt:Data >
<tt:ParentTopic>tns1:RuleEngine/AudioDetector/Class</tt:ParentTopic>
</tt:MessageDescription>
Expand Down Expand Up @@ -7538,6 +7423,8 @@ xmlns:acme="http://www.acme.com/schema"&gt;
<para role="text">List of detected audio classifications of type tt:AudioClassification. </para>
<para role="param">Score - optional [tt:FloatList]</para>
<para role="text">Optional list of scores of detected audio classifications. </para>
<para role="param">Loudness - optional [xs:float]</para>
<para role="text">Optional loudness of the detected sound in dB. </para>
</listitem>
</varlistentry>
</variablelist>
Expand Down
Loading

0 comments on commit 45b5dc4

Please sign in to comment.