xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/v4l/ext-ctrls-detect.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun.. _detect-controls:
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun************************
6*4882a593SmuzhiyunDetect Control Reference
7*4882a593Smuzhiyun************************
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThe Detect class includes controls for common features of various motion
10*4882a593Smuzhiyunor object detection capable devices.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun.. _detect-control-id:
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunDetect Control IDs
16*4882a593Smuzhiyun==================
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun``V4L2_CID_DETECT_CLASS (class)``
19*4882a593Smuzhiyun    The Detect class descriptor. Calling
20*4882a593Smuzhiyun    :ref:`VIDIOC_QUERYCTRL` for this control will
21*4882a593Smuzhiyun    return a description of this control class.
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun``V4L2_CID_DETECT_MD_MODE (menu)``
24*4882a593Smuzhiyun    Sets the motion detection mode.
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun.. tabularcolumns:: |p{7.7cm}|p{9.8cm}|
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun.. flat-table::
29*4882a593Smuzhiyun    :header-rows:  0
30*4882a593Smuzhiyun    :stub-columns: 0
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun    * - ``V4L2_DETECT_MD_MODE_DISABLED``
33*4882a593Smuzhiyun      - Disable motion detection.
34*4882a593Smuzhiyun    * - ``V4L2_DETECT_MD_MODE_GLOBAL``
35*4882a593Smuzhiyun      - Use a single motion detection threshold.
36*4882a593Smuzhiyun    * - ``V4L2_DETECT_MD_MODE_THRESHOLD_GRID``
37*4882a593Smuzhiyun      - The image is divided into a grid, each cell with its own motion
38*4882a593Smuzhiyun	detection threshold. These thresholds are set through the
39*4882a593Smuzhiyun	``V4L2_CID_DETECT_MD_THRESHOLD_GRID`` matrix control.
40*4882a593Smuzhiyun    * - ``V4L2_DETECT_MD_MODE_REGION_GRID``
41*4882a593Smuzhiyun      - The image is divided into a grid, each cell with its own region
42*4882a593Smuzhiyun	value that specifies which per-region motion detection thresholds
43*4882a593Smuzhiyun	should be used. Each region has its own thresholds. How these
44*4882a593Smuzhiyun	per-region thresholds are set up is driver-specific. The region
45*4882a593Smuzhiyun	values for the grid are set through the
46*4882a593Smuzhiyun	``V4L2_CID_DETECT_MD_REGION_GRID`` matrix control.
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun``V4L2_CID_DETECT_MD_GLOBAL_THRESHOLD (integer)``
51*4882a593Smuzhiyun    Sets the global motion detection threshold to be used with the
52*4882a593Smuzhiyun    ``V4L2_DETECT_MD_MODE_GLOBAL`` motion detection mode.
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun``V4L2_CID_DETECT_MD_THRESHOLD_GRID (__u16 matrix)``
55*4882a593Smuzhiyun    Sets the motion detection thresholds for each cell in the grid. To
56*4882a593Smuzhiyun    be used with the ``V4L2_DETECT_MD_MODE_THRESHOLD_GRID`` motion
57*4882a593Smuzhiyun    detection mode. Matrix element (0, 0) represents the cell at the
58*4882a593Smuzhiyun    top-left of the grid.
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun``V4L2_CID_DETECT_MD_REGION_GRID (__u8 matrix)``
61*4882a593Smuzhiyun    Sets the motion detection region value for each cell in the grid. To
62*4882a593Smuzhiyun    be used with the ``V4L2_DETECT_MD_MODE_REGION_GRID`` motion
63*4882a593Smuzhiyun    detection mode. Matrix element (0, 0) represents the cell at the
64*4882a593Smuzhiyun    top-left of the grid.
65