-
Notifications
You must be signed in to change notification settings - Fork 0
/
GstAnalytics-1.0.gir
1637 lines (1607 loc) · 84.1 KB
/
GstAnalytics-1.0.gir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations. -->
<repository xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0" version="1.2">
<include name="Gst" version="1.0"/>
<include name="GstBase" version="1.0"/>
<include name="GstVideo" version="1.0"/>
<package name="gstreamer-analytics-1.0"/>
<namespace name="GstAnalytics" version="1.0" shared-library="libgstanalytics-1.0.so.0" c:identifier-prefixes="GstAnalytics,Gst" c:symbol-prefixes="gst_analytics,gst">
<alias name="MtdType" c:type="GstAnalyticsMtdType">
<doc xml:space="preserve">Type of analytics meta data</doc>
<type name="guintptr" c:type="guintptr"/>
</alias>
<record name="ClsMtd" c:type="GstAnalyticsClsMtd" version="1.24">
<doc xml:space="preserve">Handle containing data required to use gst_analytics_cls_mtd APIs. This type
is generally expected to be allocated on the stack.</doc>
<field name="id" writable="1">
<doc xml:space="preserve">Instance identifier</doc>
<type name="guint" c:type="guint"/>
</field>
<field name="meta" writable="1">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta where the analytics-metadata
identified by @id is stored.</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</field>
<method name="get_index_by_quark" c:identifier="gst_analytics_cls_mtd_get_index_by_quark" version="1.24">
<return-value transfer-ownership="none">
<doc xml:space="preserve">index of the class associated with @quarks ( and label) or
a negative value on failure.</doc>
<type name="gint" c:type="gint"/>
</return-value>
<parameters>
<instance-parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve">Instance handle</doc>
<type name="ClsMtd" c:type="const GstAnalyticsClsMtd*"/>
</instance-parameter>
<parameter name="quark" transfer-ownership="none">
<doc xml:space="preserve">Quark of the class
Get index of class represented by @quark</doc>
<type name="GLib.Quark" c:type="GQuark"/>
</parameter>
</parameters>
</method>
<method name="get_length" c:identifier="gst_analytics_cls_mtd_get_length" version="1.24">
<return-value transfer-ownership="none">
<doc xml:space="preserve">Number of classes in this classification instance</doc>
<type name="gsize" c:type="gsize"/>
</return-value>
<parameters>
<instance-parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve">Instance handle
Get number of classes</doc>
<type name="ClsMtd" c:type="const GstAnalyticsClsMtd*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_level" c:identifier="gst_analytics_cls_mtd_get_level" version="1.24">
<doc xml:space="preserve">Get confidence level for class at @index</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">confidence level for @index, <0.0 if the call failed.</doc>
<type name="gfloat" c:type="gfloat"/>
</return-value>
<parameters>
<instance-parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve">instance handle</doc>
<type name="ClsMtd" c:type="const GstAnalyticsClsMtd*"/>
</instance-parameter>
<parameter name="index" transfer-ownership="none">
<doc xml:space="preserve">Object class index</doc>
<type name="gsize" c:type="gsize"/>
</parameter>
</parameters>
</method>
<method name="get_quark" c:identifier="gst_analytics_cls_mtd_get_quark" version="1.24">
<return-value transfer-ownership="none">
<doc xml:space="preserve">Quark of this class (label) associated with @index</doc>
<type name="GLib.Quark" c:type="GQuark"/>
</return-value>
<parameters>
<instance-parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve">Instance handle</doc>
<type name="ClsMtd" c:type="const GstAnalyticsClsMtd*"/>
</instance-parameter>
<parameter name="index" transfer-ownership="none">
<doc xml:space="preserve">index of the class
Get quark of the class at @index</doc>
<type name="gsize" c:type="gsize"/>
</parameter>
</parameters>
</method>
<function name="get_mtd_type" c:identifier="gst_analytics_cls_mtd_get_mtd_type" version="1.24">
<doc xml:space="preserve">Get an id identifying #GstAnalyticsMtd type.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">opaque id of #GstAnalyticsMtd type</doc>
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
</return-value>
</function>
</record>
<constant name="INF_RELATION_SPAN" value="-1" c:type="GST_INF_RELATION_SPAN" version="1.24">
<doc xml:space="preserve">Passes to functions asking for a relation span when the span is
infinite.</doc>
<type name="gint" c:type="gint"/>
</constant>
<function-macro name="MTD_CAST" c:identifier="GST_ANALYTICS_MTD_CAST" version="1.24" introspectable="0">
<parameters>
<parameter name="mtd">
</parameter>
</parameters>
</function-macro>
<constant name="MTD_TYPE_ANY" value="0" c:type="GST_ANALYTICS_MTD_TYPE_ANY" version="1.24">
<doc xml:space="preserve">A wildcard matching any type of analysis</doc>
<type name="gint" c:type="gint"/>
</constant>
<record name="Mtd" c:type="GstAnalyticsMtd" version="1.24">
<doc xml:space="preserve">Handle containing data required to use gst_analytics_mtd API. This type
is generally expected to be allocated on the stack.</doc>
<field name="id" writable="1">
<doc xml:space="preserve">Instance identifier</doc>
<type name="guint" c:type="guint"/>
</field>
<field name="meta" writable="1">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta where the analytics-metadata
identified by @id is stored.</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</field>
<method name="get_id" c:identifier="gst_analytics_mtd_get_id" version="1.24">
<doc xml:space="preserve">Get instance id</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">Id of @instance</doc>
<type name="guint" c:type="guint"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsMtd</doc>
<type name="Mtd" c:type="const GstAnalyticsMtd*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_mtd_type" c:identifier="gst_analytics_mtd_get_mtd_type" version="1.24">
<return-value transfer-ownership="none">
<doc xml:space="preserve">opaque id of the type</doc>
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsMtd
Get analysis result type.</doc>
<type name="Mtd" c:type="const GstAnalyticsMtd*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_size" c:identifier="gst_analytics_mtd_get_size" version="1.24">
<doc xml:space="preserve">Get instance size</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">Size (in bytes) of this instance or 0 on failure.</doc>
<type name="gsize" c:type="gsize"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsMtd</doc>
<type name="Mtd" c:type="const GstAnalyticsMtd*"/>
</instance-parameter>
</parameters>
</method>
<function name="type_get_name" c:identifier="gst_analytics_mtd_type_get_name" version="1.24">
<doc xml:space="preserve">Gets the string version of the name of this type of analytics data</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the name</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
<parameters>
<parameter name="type" transfer-ownership="none">
<doc xml:space="preserve">The type of analytics data</doc>
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
</parameter>
</parameters>
</function>
</record>
<record name="MtdImpl" c:type="GstAnalyticsMtdImpl" version="1.24">
<doc xml:space="preserve">This structure must be provided when registering a new type of Mtd. It must
have a static lifetime (never be freed).</doc>
<field name="name" writable="1">
<doc xml:space="preserve">The name of the metadata type</doc>
<type name="utf8" c:type="const char*"/>
</field>
<field name="mtd_meta_transform">
<doc xml:space="preserve">A pointer to a function that will be called
when the containing meta is transform to potentially copy the data
into a new Mtd into the new meta.</doc>
<callback name="mtd_meta_transform">
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="transbuf" transfer-ownership="none">
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</parameter>
<parameter name="transmtd" transfer-ownership="none">
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
</parameter>
<parameter name="buffer" transfer-ownership="none">
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</parameter>
<parameter name="type" transfer-ownership="none">
<type name="GLib.Quark" c:type="GQuark"/>
</parameter>
<parameter name="data" transfer-ownership="none">
<type name="gpointer" c:type="gpointer"/>
</parameter>
</parameters>
</callback>
</field>
<field name="mtd_meta_clear">
<doc xml:space="preserve">A pointer to a function that will be called when the
containing meta is cleared to potetially do cleanup (ex. _unref or release)
resources it was using.</doc>
<callback name="mtd_meta_clear">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="buffer" transfer-ownership="none">
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</parameter>
<parameter name="mtd" transfer-ownership="none">
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
</parameter>
</parameters>
</callback>
</field>
<field name="_reserved" readable="0" private="1">
<array zero-terminated="0" fixed-size="19">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
</record>
<record name="ODMtd" c:type="GstAnalyticsODMtd" version="1.24">
<doc xml:space="preserve">Handle containing data required to use gst_analytics_od_mtd APIs. This type
is generally expected to be allocated on the stack.</doc>
<field name="id" writable="1">
<doc xml:space="preserve">Instance identifier</doc>
<type name="guint" c:type="guint"/>
</field>
<field name="meta" writable="1">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta where the analytics-metadata
identified by @id is stored.</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</field>
<method name="get_confidence_lvl" c:identifier="gst_analytics_od_mtd_get_confidence_lvl" version="1.24">
<doc xml:space="preserve">Retrieve location confidence level.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE on success, otherwise FALSE.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">instance</doc>
<type name="ODMtd" c:type="const GstAnalyticsODMtd*"/>
</instance-parameter>
<parameter name="loc_conf_lvl" direction="out" caller-allocates="0" transfer-ownership="full">
<doc xml:space="preserve">Confidence on object location</doc>
<type name="gfloat" c:type="gfloat*"/>
</parameter>
</parameters>
</method>
<method name="get_location" c:identifier="gst_analytics_od_mtd_get_location" version="1.24">
<doc xml:space="preserve">Retrieve location and location confidence level.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE on success, otherwise FALSE.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">instance</doc>
<type name="ODMtd" c:type="const GstAnalyticsODMtd*"/>
</instance-parameter>
<parameter name="x" direction="out" caller-allocates="0" transfer-ownership="full">
<doc xml:space="preserve">x component of upper-left corner of the object location</doc>
<type name="gint" c:type="gint*"/>
</parameter>
<parameter name="y" direction="out" caller-allocates="0" transfer-ownership="full">
<doc xml:space="preserve">y component of upper-left corner of the object location</doc>
<type name="gint" c:type="gint*"/>
</parameter>
<parameter name="w" direction="out" caller-allocates="0" transfer-ownership="full">
<doc xml:space="preserve">bounding box width of the object location</doc>
<type name="gint" c:type="gint*"/>
</parameter>
<parameter name="h" direction="out" caller-allocates="0" transfer-ownership="full">
<doc xml:space="preserve">bounding box height of the object location</doc>
<type name="gint" c:type="gint*"/>
</parameter>
<parameter name="loc_conf_lvl" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve">Confidence on object location</doc>
<type name="gfloat" c:type="gfloat*"/>
</parameter>
</parameters>
</method>
<method name="get_obj_type" c:identifier="gst_analytics_od_mtd_get_obj_type" version="1.24">
<doc xml:space="preserve">Quark of the class of object associated with this location.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">Quark different from on success and 0 on failure.</doc>
<type name="GLib.Quark" c:type="GQuark"/>
</return-value>
<parameters>
<instance-parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve">Instance handle</doc>
<type name="ODMtd" c:type="const GstAnalyticsODMtd*"/>
</instance-parameter>
</parameters>
</method>
<function name="get_mtd_type" c:identifier="gst_analytics_od_mtd_get_mtd_type" version="1.24">
<doc xml:space="preserve">Get an id that represent object-detection metadata type</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">Opaque id of the #GstAnalyticsMtd type</doc>
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
</return-value>
</function>
</record>
<bitfield name="RelTypes" version="1.24" c:type="GstAnalyticsRelTypes">
<member name="none" value="0" c:identifier="GST_ANALYTICS_REL_TYPE_NONE">
<doc xml:space="preserve">No relation</doc>
</member>
<member name="is_part_of" value="2" c:identifier="GST_ANALYTICS_REL_TYPE_IS_PART_OF">
<doc xml:space="preserve">First analysis-meta is part of second analysis-meta</doc>
</member>
<member name="contain" value="4" c:identifier="GST_ANALYTICS_REL_TYPE_CONTAIN">
<doc xml:space="preserve">First analysis-meta contain second analysis-meta.</doc>
</member>
<member name="relate_to" value="8" c:identifier="GST_ANALYTICS_REL_TYPE_RELATE_TO">
</member>
<member name="last" value="16" c:identifier="GST_ANALYTICS_REL_TYPE_LAST">
<doc xml:space="preserve">reserved</doc>
</member>
<member name="any" value="2147483647" c:identifier="GST_ANALYTICS_REL_TYPE_ANY">
<doc xml:space="preserve">Only use for criteria.</doc>
</member>
</bitfield>
<record name="RelationMeta" c:type="GstAnalyticsRelationMeta" disguised="1" opaque="1" version="1.24">
<doc xml:space="preserve">An opaque #GstMeta that can be used to hold various types of results
from analysis processes.
The content should be accessed through the API.</doc>
<method name="add_cls_mtd" c:identifier="gst_analytics_relation_meta_add_cls_mtd" version="1.24">
<doc xml:space="preserve">Add analytic classification metadata to @instance.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">Added successfully</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta where to add classification instance</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="length" transfer-ownership="none">
<doc xml:space="preserve">length of @confidence_levels</doc>
<type name="gsize" c:type="gsize"/>
</parameter>
<parameter name="confidence_levels" transfer-ownership="none">
<doc xml:space="preserve">confidence levels</doc>
<array length="0" zero-terminated="0" c:type="gfloat*">
<type name="gfloat" c:type="gfloat"/>
</array>
</parameter>
<parameter name="class_quarks" transfer-ownership="none">
<doc xml:space="preserve">labels of this
classification. Order define index, quark, labels relation. This array
need to exist as long has this classification meta exist.</doc>
<array length="0" zero-terminated="0" c:type="GQuark*">
<type name="GLib.Quark" c:type="GQuark"/>
</array>
</parameter>
<parameter name="cls_mtd" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve">Handle updated to newly added classification meta.</doc>
<type name="ClsMtd" c:type="GstAnalyticsClsMtd*"/>
</parameter>
</parameters>
</method>
<method name="add_mtd" c:identifier="gst_analytics_relation_meta_add_mtd" version="1.24" introspectable="0">
<doc xml:space="preserve">Add a relatable metadata to @meta. This method is meant to be used by
new struct sub-classing GstAnalyticsRelatableMtd.</doc>
<return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">A pointer to a memory area of size @size where to put the data</doc>
<type name="gpointer" c:type="gpointer"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">Instance</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="impl" transfer-ownership="none">
<doc xml:space="preserve">Implementation of relatable (#GstAnalyticsRelatableMtd)</doc>
<type name="MtdImpl" c:type="const GstAnalyticsMtdImpl*"/>
</parameter>
<parameter name="size" transfer-ownership="none">
<doc xml:space="preserve">Size required</doc>
<type name="gsize" c:type="gsize"/>
</parameter>
<parameter name="rlt_mtd" transfer-ownership="none">
<doc xml:space="preserve">Updated handle</doc>
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
</parameter>
</parameters>
</method>
<method name="add_od_mtd" c:identifier="gst_analytics_relation_meta_add_od_mtd" version="1.24">
<return-value transfer-ownership="none">
<doc xml:space="preserve">Added successfully</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta where to add classification instance</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="type" transfer-ownership="none">
<doc xml:space="preserve">Quark of the object type</doc>
<type name="GLib.Quark" c:type="GQuark"/>
</parameter>
<parameter name="x" transfer-ownership="none">
<doc xml:space="preserve">x component of bounding box upper-left corner</doc>
<type name="gint" c:type="gint"/>
</parameter>
<parameter name="y" transfer-ownership="none">
<doc xml:space="preserve">y component of bounding box upper-left corner</doc>
<type name="gint" c:type="gint"/>
</parameter>
<parameter name="w" transfer-ownership="none">
<doc xml:space="preserve">bounding box width</doc>
<type name="gint" c:type="gint"/>
</parameter>
<parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">bounding box height</doc>
<type name="gint" c:type="gint"/>
</parameter>
<parameter name="loc_conf_lvl" transfer-ownership="none">
<doc xml:space="preserve">confidence level on the object location</doc>
<type name="gfloat" c:type="gfloat"/>
</parameter>
<parameter name="od_mtd" direction="out" caller-allocates="1" transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Handle updated with newly added object detection
meta. Add an object-detetion metadata to @instance.</doc>
<type name="ODMtd" c:type="GstAnalyticsODMtd*"/>
</parameter>
</parameters>
</method>
<method name="add_one_cls_mtd" c:identifier="gst_analytics_relation_meta_add_one_cls_mtd" version="1.24">
<doc xml:space="preserve">Add analytic classification metadata to @instance.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">Added successfully</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta where to add classification instance</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="confidence_level" transfer-ownership="none">
<doc xml:space="preserve">confidence levels</doc>
<type name="gfloat" c:type="gfloat"/>
</parameter>
<parameter name="class_quark" transfer-ownership="none">
<doc xml:space="preserve">labels of this
classification. Order define index, quark, labels relation. This array
need to exist as long has this classification meta exist.</doc>
<type name="GLib.Quark" c:type="GQuark"/>
</parameter>
<parameter name="cls_mtd" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve">Handle updated to newly added classification meta.</doc>
<type name="ClsMtd" c:type="GstAnalyticsClsMtd*"/>
</parameter>
</parameters>
</method>
<method name="add_segmentation_mtd" c:identifier="gst_analytics_relation_meta_add_segmentation_mtd" version="1.26">
<doc xml:space="preserve">Add analytics segmentation metadata to @instance. The rectangle (@masks_loc_x,
@mask_loc_y, @mask_loc_w, @mask_loc_h) define a area of the image that
correspond to the segmentation masks stored in @buffer. For example if the
segmentation masks stored in @buffer describe the segmented regions for the
entire image the rectangular area will be (@masks_loc_x = 0, @masks_loc_y = 0,
@masks_loc_w = image_width, @masks_loc_h = image_height).</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE if added successfully, otherwise FALSE</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta where to add segmentation
instance.</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="buffer" transfer-ownership="full">
<doc xml:space="preserve">Buffer containing segmentation masks. @buffer
must have a #GstVideoMeta attached</doc>
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</parameter>
<parameter name="segmentation_type" transfer-ownership="none">
<doc xml:space="preserve">Segmentation type</doc>
<type name="SegmentationType" c:type="GstSegmentationType"/>
</parameter>
<parameter name="region_count" transfer-ownership="none">
<doc xml:space="preserve">Number of regions in the masks</doc>
<type name="gsize" c:type="gsize"/>
</parameter>
<parameter name="region_ids" transfer-ownership="none">
<doc xml:space="preserve">Arrays of region ids present in the mask.</doc>
<array length="2" zero-terminated="0" c:type="guint*">
<type name="guint" c:type="guint"/>
</array>
</parameter>
<parameter name="masks_loc_x" transfer-ownership="none">
<doc xml:space="preserve">Left coordinate of the rectangle corresponding to the masks in the image.</doc>
<type name="gint" c:type="gint"/>
</parameter>
<parameter name="masks_loc_y" transfer-ownership="none">
<doc xml:space="preserve">Top coordinate of the rectangle corresponding to the masks in the image.</doc>
<type name="gint" c:type="gint"/>
</parameter>
<parameter name="masks_loc_w" transfer-ownership="none">
<doc xml:space="preserve">Width of the rectangle corresponding to the masks in the image.</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="masks_loc_h" transfer-ownership="none">
<doc xml:space="preserve">Height of the rectangle corresponding to the masks in the image.</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="segmentation_mtd" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve">Handle update with newly added segmentation meta.</doc>
<type name="SegmentationMtd" c:type="GstAnalyticsSegmentationMtd*"/>
</parameter>
</parameters>
</method>
<method name="add_tracking_mtd" c:identifier="gst_analytics_relation_meta_add_tracking_mtd" version="1.24">
<return-value transfer-ownership="none">
<doc xml:space="preserve">Added successfully</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="instance" transfer-ownership="none">
<doc xml:space="preserve">Instance of GstAnalyticsRelationMeta where to add tracking mtd</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="tracking_id" transfer-ownership="none">
<doc xml:space="preserve">Tracking id</doc>
<type name="guint64" c:type="guint64"/>
</parameter>
<parameter name="tracking_first_seen" transfer-ownership="none">
<doc xml:space="preserve">Timestamp of first time the object was observed.</doc>
<type name="Gst.ClockTime" c:type="GstClockTime"/>
</parameter>
<parameter name="trk_mtd" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve">Handle updated with newly added tracking meta.
Add an analytic tracking metadata to @instance.</doc>
<type name="TrackingMtd" c:type="GstAnalyticsTrackingMtd*"/>
</parameter>
</parameters>
</method>
<method name="exist" c:identifier="gst_analytics_relation_meta_exist" version="1.24">
<doc xml:space="preserve">Verify existence of relation(s) between @an_meta_first_d and
@an_meta_second_id according to relation condition @cond_types. It optionally
also return a shortest path of relations ( compliant with @cond_types)
between @an_meta_first_id and @an_meta_second_id.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE if a relation between exit between @an_meta_first_id and
@an_meta_second_id, otherwise FALSE.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="rmeta" transfer-ownership="none">
<doc xml:space="preserve">a #GstAnalyticsRelationMeta describing analysis-meta
relation</doc>
<type name="RelationMeta" c:type="const GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="an_meta_first_id" transfer-ownership="none">
<doc xml:space="preserve">First analysis-meta</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="an_meta_second_id" transfer-ownership="none">
<doc xml:space="preserve">Second analysis-meta</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="max_relation_span" transfer-ownership="none">
<doc xml:space="preserve">Maximum number of relation between @an_meta_first_id and
@an_meta_second_id.
A value of 1 mean only only consider direct relation.</doc>
<type name="gint" c:type="gint"/>
</parameter>
<parameter name="cond_types" transfer-ownership="none">
<doc xml:space="preserve">condition on relation types.</doc>
<type name="RelTypes" c:type="GstAnalyticsRelTypes"/>
</parameter>
<parameter name="relations_path" direction="out" caller-allocates="1" transfer-ownership="full" nullable="1">
<doc xml:space="preserve">
If not NULL this list will be filled with relation path between
@an_meta_first_id and
@an_meta_second_id. List value should be access with GSList API. Use
GPOINTER_TO_INT(iter->data) where iter is a GSList element to get
analysis-meta id on the relation path. Free this list with g_slist_free
(@relations_path) after using.</doc>
<array zero-terminated="0" name="GLib.Array" c:type="GArray**">
<type name="gint"/>
</array>
</parameter>
</parameters>
</method>
<method name="get_cls_mtd" c:identifier="gst_analytics_relation_meta_get_cls_mtd" version="1.24">
<doc xml:space="preserve">Fill @rlt if a analytics-meta with id == @an_meta_id exist in @meta instance,
otherwise this method return FALSE and @rlt is invalid.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE if successful.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="an_meta_id" transfer-ownership="none">
<doc xml:space="preserve">Id of #GstAnalyticsClsMtd instance to retrieve</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="rlt" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve">Will be filled with relatable
meta</doc>
<type name="ClsMtd" c:type="GstAnalyticsClsMtd*"/>
</parameter>
</parameters>
</method>
<method name="get_direct_related" c:identifier="gst_analytics_relation_meta_get_direct_related" version="1.24">
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE if @rlt_mtd was updated, other wise FALSE</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">GstAnalyticsRelationMeta instance where to query for
GstAnalyticsRelatableMtd.</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="an_meta_id" transfer-ownership="none">
<doc xml:space="preserve">Id of GstAnalyticsMtd involved in relation to query</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="relation_type" transfer-ownership="none">
<doc xml:space="preserve">Type of relation to filter on.</doc>
<type name="RelTypes" c:type="GstAnalyticsRelTypes"/>
</parameter>
<parameter name="type" transfer-ownership="none">
<doc xml:space="preserve">Type of GstAnalyticsMtd to filter on</doc>
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
</parameter>
<parameter name="state" direction="inout" caller-allocates="0" transfer-ownership="full">
<doc xml:space="preserve">Opaque data to store state of the query.
If @state point to NULL, the first analytics-metadata directly related
to @an_meta_id will be set in @rlt_mtd. Doesn't need to be free.</doc>
<type name="gpointer" c:type="gpointer*"/>
</parameter>
<parameter name="rlt_mtd" transfer-ownership="none">
<doc xml:space="preserve">Handle updated to directly related relatable meta.</doc>
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
</parameter>
</parameters>
</method>
<method name="get_mtd" c:identifier="gst_analytics_relation_meta_get_mtd" version="1.24">
<doc xml:space="preserve">Fill @rlt if a analytics-meta with id == @an_meta_id exist in @meta instance,
otherwise this method return FALSE and @rlt is invalid.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE if successful.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">Instance of GstAnalyticsRelationMeta</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="an_meta_id" transfer-ownership="none">
<doc xml:space="preserve">Id of GstAnalyticsMtd instance to retrieve</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="type" transfer-ownership="none">
<doc xml:space="preserve">Filter on a specific type of analysis, use
%GST_ANALYTICS_MTD_TYPE_ANY to match any type</doc>
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
</parameter>
<parameter name="rlt" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve">Will be filled with relatable
meta</doc>
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
</parameter>
</parameters>
</method>
<method name="get_mtd_data" c:identifier="gst_analytics_relation_meta_get_mtd_data" version="1.24" introspectable="0">
<return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Analytics data pointer</doc>
<type name="gpointer" c:type="gpointer"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">Instance of GstAnalyticsRelationMeta</doc>
<type name="RelationMeta" c:type="const GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="an_meta_id" transfer-ownership="none">
<doc xml:space="preserve">Id of GstAnalyticsMtd instance to retrieve</doc>
<type name="guint" c:type="guint"/>
</parameter>
</parameters>
</method>
<method name="get_od_mtd" c:identifier="gst_analytics_relation_meta_get_od_mtd" version="1.24">
<doc xml:space="preserve">Fill @rlt if a analytics-meta with id == @an_meta_id exist in @meta instance,
otherwise this method return FALSE and @rlt is invalid.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE if successful.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="an_meta_id" transfer-ownership="none">
<doc xml:space="preserve">Id of #GstAnalyticsODMtd instance to retrieve</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="rlt" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve">Will be filled with relatable
meta</doc>
<type name="ODMtd" c:type="GstAnalyticsODMtd*"/>
</parameter>
</parameters>
</method>
<method name="get_relation" c:identifier="gst_analytics_relation_meta_get_relation" version="1.24">
<doc xml:space="preserve">Get relations between first and second analysis-meta.
Ids (@an_meta_first_id and @an_meta_second_id) must be from a call to
@gst_analytics_mtd_get_id (handle).</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">relation description between first and second analysis-meta.</doc>
<type name="RelTypes" c:type="GstAnalyticsRelTypes"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">a #GstAnalyticsRelationMeta</doc>
<type name="RelationMeta" c:type="const GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="an_meta_first_id" transfer-ownership="none">
<doc xml:space="preserve">Id of first analysis-meta</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="an_meta_second_id" transfer-ownership="none">
<doc xml:space="preserve">Id of second analysis-meta</doc>
<type name="guint" c:type="guint"/>
</parameter>
</parameters>
</method>
<method name="get_tracking_mtd" c:identifier="gst_analytics_relation_meta_get_tracking_mtd" version="1.24">
<doc xml:space="preserve">Fill @rlt if a analytics-meta with id == @an_meta_id exist in @meta instance,
otherwise this method return FALSE and @rlt is invalid.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE if successful.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">Instance of GstAnalyticsRelationMeta</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="an_meta_id" transfer-ownership="none">
<doc xml:space="preserve">Id of GstAnalyticsMtd instance to retrieve</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="rlt" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve">Will be filled with relatable
meta</doc>
<type name="TrackingMtd" c:type="GstAnalyticsTrackingMtd*"/>
</parameter>
</parameters>
</method>
<method name="iterate" c:identifier="gst_analytics_relation_meta_iterate" version="1.24">
<return-value transfer-ownership="none">
<doc xml:space="preserve">FALSE if end was reached and iteration is completed.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">Instance of GstAnalyticsRelationMeta</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="state" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">Opaque data to store iteration state, initialize to NULL, no need to
free it.</doc>
<type name="gpointer" c:type="gpointer*"/>
</parameter>
<parameter name="type" transfer-ownership="none">
<doc xml:space="preserve">Type of GstAnalyticsMtd to iterate on or use
%GST_ANALYTICS_MTD_TYPE_ANY for any.</doc>
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
</parameter>
<parameter name="rlt_mtd" transfer-ownership="none">
<doc xml:space="preserve">Handle updated to iterated GstAnalyticsRelatableMtd.</doc>
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
</parameter>
</parameters>
</method>
<method name="set_relation" c:identifier="gst_analytics_relation_meta_set_relation" version="1.24">
<doc xml:space="preserve">Sets the relation (#GstAnalyticsRelTypes) between @an_meta_first and
@an_meta_second.
Ids must have been obtained a call to
@gst_analytics_mtd_get_id(handle).</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">TRUE on success and FALSE on failure.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="meta" transfer-ownership="none">
<doc xml:space="preserve">Parameter to receive new maximum number of
analysis-meta described by relation.</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</instance-parameter>
<parameter name="type" transfer-ownership="none">
<doc xml:space="preserve">a #GstAnalyticsRelTypes defining relation between two analysis-meta</doc>
<type name="RelTypes" c:type="GstAnalyticsRelTypes"/>
</parameter>
<parameter name="an_meta_first_id" transfer-ownership="none">
<doc xml:space="preserve">first meta id</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="an_meta_second_id" transfer-ownership="none">
<doc xml:space="preserve">second meta id</doc>
<type name="guint" c:type="guint"/>
</parameter>
</parameters>
</method>
<function name="get_info" c:identifier="gst_analytics_relation_meta_get_info" version="1.24" introspectable="0">
<doc xml:space="preserve">Get the meta info</doc>
<return-value transfer-ownership="none">
<type name="Gst.MetaInfo" c:type="const GstMetaInfo*"/>
</return-value>
</function>
</record>
<record name="RelationMetaInitParams" c:type="GstAnalyticsRelationMetaInitParams" version="1.24">
<doc xml:space="preserve">GstAnalyticsRelationMeta initialization parameters.</doc>
<field name="initial_relation_order" writable="1">
<doc xml:space="preserve">Initial relations order.</doc>
<type name="gsize" c:type="gsize"/>
</field>
<field name="initial_buf_size" writable="1">
<doc xml:space="preserve">Buffer size in bytes to store relatable metadata</doc>
<type name="gsize" c:type="gsize"/>
</field>
</record>
<record name="SegmentationMtd" c:type="GstAnalyticsSegmentationMtd" version="1.26">
<doc xml:space="preserve">This type of metadata holds information on which pixels belongs to
a region of the image representing a type of object.
It supports two types of segmentation, semantic or instance:
* Semantic: All objects of the same type have the same id
* Instance: Each instance of an object has a different id
The results of the segmentation are stored in a #GstBuffer that has a
#GstVideoMeta associated with it. This buffer is stored in the
GstAnalyticsSegmentationMtd using
#gst_analytics_relation_meta_add_segmentation_mtd(). The #GstBuffer
containing the segmentation mask is image-like but the color values are
arbitrary values, referred by region-id in this API, without meaning beyond
specifying that two pixels in the original image with the same values in
their corresponding mask value belong to the same region.
To further describe a region, the #GstAnalyticsSegmentationMtd can be
associated with other #GstAnalyticsMtd. Since region ids are
generated by the segmentation process itself and are not always sequential,
we use a map of indexes to region ids starting with 0 without discontinuity
which facilitate N-to-N mapping with other #GstAnalyticsMtd. For
example it can be associated with #GstAnalyticsClsMtd to describe the class
of object matching the pixels of a segmented region.
Example: Associate Instance Segmentation with Classification
In the following example the segmentation process will fill segmask with
values of 0 for background, 12 for the first region which correspond to a
to a strawberry, 7 for the second region that also correspond to a
strawberry in the image and 31 for the third region that correspond to a
leaf in the image.
region_ids is fill during segmentation post-processing
region_ids:
|region-index | region-id |
|-------------|-----------|
| 0 | 0 |
| 1 | 12 |
| 2 | 7 |
| 3 | 31 |
region_count = 4
``` C
GstAnalyticsSegmentationMtd segmtd;
GstAnalyticsClassificationMtd clsmtd;
GstBuffer *segmask, *img;
guint *region_ids;
gsize region_count, class_count;
gfloat *class_confidence;
GQuark *classes;
... (segmentation filling segmask based on img)
gst_analytics_relation_meta_add_segmentation_mtd (rmeta, segmask,
GST_SEGMENTATION_TYPE_INSTANCE, region_count, region_ids, &segmtd);
class_count = region_count;
... (class-index must match and correspond to region-index)
classes [0] = g_quark_from_string ("background");
classes [1] = g_quark_from_string ("strawberry");
classes [2] = g_quark_from_string ("strawberry");
classes [3] = g_quark_from_string ("leaf");
... (set confidence level for each class associated with a region
... where -1.0 mean undefined.)
class_confidence [0] = -1.0;
class_confidence [1] = 0.6;
class_confidence [2] = 0.9;
class_confidence [3] = 0.8;
gst_analytics_relation_meta_add_cls_mtd (rmeta, class_count,
class_confidence, classes, &clsmtd);
gst_analytics_relation_meta_set_relation (rmeta,
GST_ANALYTICS_REL_TYPE_RELATE_TO, segmtd.id, clsmtd.id);
```
Example: Associate Semantic Segmentation with Classification
Assuming the same context as for Instance Segmentation above but instead
a semantic segmentation is performed, therefore region-id-12 and region-id-7
are now represented by the same region-id-12
region_ids: (here
|region-index | region-id |
|-------------|-----------|
| 0 | 0 |
| 1 | 12 |
| 2 | 31 |
Code remain the same except that we set all confidence level to undefined
(-1.0).
```
... (class-index must match and correspond to region-index)
classes [0] = g_quark_from_string ("background");
classes [1] = g_quark_from_string ("strawberry");
classes [2] = g_quark_from_string ("leaf");
... (set confidence level for each class associated with a region
... where -1.0 mean undefined.)
class_confidence [0] = -1.0;
class_confidence [1] = -1.0;
class_confidence [2] = -1.0;
gst_analytics_relation_meta_add_cls_mtd (rmeta, class_count,
class_confidence, classes, &clsmtd);
gst_analytics_relation_meta_set_relation (rmeta,
GST_ANALYTICS_REL_TYPE_RELATE_TO, segmtd.id, clsmtd.id);
```
Example: Retrieving class associated with a segmentation region-id-12
This the typical case for an overlay as we visit the segmentation mask we
we find region-id values
```
gsize idx;
gst_analytics_segmentation_mtd_get_region_index (&segmtd, &idx, 12);
gst_analytics_relation_meta_get_direct_related (rmeta, segmtd.id,
GST_ANALYTICS_REL_TYPE_RELATE_TO, gst_analytics_cls_mtd_get_type (),
NULL, &clsmtd);
GQuark region_class = gst_analytics_cls_mtd_get_quark (&segmtd, idx)
...
```
Since: 1.26</doc>
<field name="id" writable="1">
<doc xml:space="preserve">Instance identifier</doc>
<type name="guint" c:type="guint"/>
</field>
<field name="meta" writable="1">
<doc xml:space="preserve">Instance of #GstAnalyticsRelationMeta where the analytics-metadata
identified by @id is stored.</doc>
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
</field>
<method name="get_mask" c:identifier="gst_analytics_segmentation_mtd_get_mask" version="1.26">
<doc xml:space="preserve">Get segmentation mask data.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">Segmentation mask data stored in a #GstBuffer</doc>
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</return-value>
<parameters>
<instance-parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve">Instance</doc>
<type name="SegmentationMtd" c:type="const GstAnalyticsSegmentationMtd*"/>
</instance-parameter>
<parameter name="masks_loc_x" direction="out" caller-allocates="1" transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Left coordinate of the
rectangle corresponding to the mask in the image.</doc>