Skip to content

Commit 8381592

Browse files
committed
Added rst documentation for both imagemanip rotate and tiling
1 parent ee3e198 commit 8381592

File tree

5 files changed

+91
-1
lines changed

5 files changed

+91
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
ImageManip Rotate
2+
=================
3+
4+
This example showcases how to rotate color and mono frames with the help of :ref:`ImageManip` node.
5+
In the example, we are rotating by 90°.
6+
7+
.. note::
8+
Due to HW warp constraint, input image (to be rotated) has to have **width value of multiples of 16.**
9+
10+
Demos
11+
####
12+
13+
.. image:: https://user-images.githubusercontent.com/18037362/128074634-d2baa78e-8f35-40fc-8661-321f3a3c3850.png
14+
:alt: Rotated mono and color frames
15+
16+
Here I have DepthAI device positioned vertically on my desk.
17+
18+
Setup
19+
#####
20+
21+
.. include:: /includes/install_from_pypi.rst
22+
23+
Source code
24+
###########
25+
26+
.. tabs::
27+
28+
.. tab:: Python
29+
30+
Also `available on GitHub <https://github.com/luxonis/depthai-python/blob/main/examples/image_manip_rotate.py>`__
31+
32+
.. literalinclude:: ../../../examples/image_manip_rotate.py
33+
:language: python
34+
:linenos:
35+
36+
.. tab:: C++
37+
38+
Also `available on GitHub <https://github.com/luxonis/depthai-core/blob/main/examples/src/image_manip_rotate.cpp>`__
39+
40+
.. literalinclude:: ../../../depthai-core/examples/src/image_manip_rotate.cpp
41+
:language: cpp
42+
:linenos:
43+
44+
.. include:: /includes/footer-short.rst
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
ImageManip Tiling
2+
=================
3+
4+
Frame tiling could be useful for eg. feeding large frame into a :ref:`NeuralNetwork` whose input size isn't as large. In such case,
5+
you can tile the large frame into multiple smaller ones and feed smaller frames to the :ref:`NeuralNetwork`.
6+
7+
In this example we use 2 :ref:`ImageManip` for splitting the original :code:`1000x500` preview frame into two :code:`500x500` frames.
8+
9+
Demo
10+
####
11+
12+
.. image:: https://user-images.githubusercontent.com/18037362/128074673-045ed4b6-ac8c-4a76-83bb-0f3dc996f7a5.png
13+
:alt: Tiling preview into 2 frames/tiles
14+
15+
Setup
16+
#####
17+
18+
.. include:: /includes/install_from_pypi.rst
19+
20+
Source code
21+
###########
22+
23+
.. tabs::
24+
25+
.. tab:: Python
26+
27+
Also `available on GitHub <https://github.com/luxonis/depthai-python/blob/main/examples/image_manip_tiling.py>`__
28+
29+
.. literalinclude:: ../../../examples/image_manip_tiling.py
30+
:language: python
31+
:linenos:
32+
33+
.. tab:: C++
34+
35+
Also `available on GitHub <https://github.com/luxonis/depthai-core/blob/main/examples/src/image_manip_tiling.cpp>`__
36+
37+
.. literalinclude:: ../../../depthai-core/examples/src/image_manip_tiling.cpp
38+
:language: cpp
39+
:linenos:
40+
41+
.. include:: /includes/footer-short.rst

docs/source/tutorials/code_samples.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Code samples are used for automated testing. They are also a great starting poin
3030
- :ref:`IMU Accelerometer & Gyroscope` - Accelerometer and gyroscope at 500hz rate
3131
- :ref:`IMU Rotation Vector` - Rotation vector at 400 hz rate
3232
- :ref:`Edge detector` - Edge detection on input frame
33+
- :ref:`ImageManip tiling` - Using ImageManip for frame tiling
34+
- :ref:`ImageManip rotate` - Using ImageManip to rotate color/mono frames
3335

3436
.. rubric:: Complex
3537

docs/source/tutorials/simple_samples.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Simple
2222
../samples/imu_accelerometer_gyroscope.rst
2323
../samples/imu_rotation_vector.rst
2424
../samples/edge_detector.rst
25+
../samples/image_manip_tiling.rst
26+
../samples/image_manip_rotate.rst
2527

2628
These samples are great starting point for the gen2 API.
2729

@@ -39,3 +41,5 @@ These samples are great starting point for the gen2 API.
3941
- :ref:`Mono & MobilenetSSD` - Runs MobileNetSSD on mono frames and displays detections on the frame
4042
- :ref:`Video & MobilenetSSD` - Runs MobileNetSSD on the video from the host
4143
- :ref:`Edge detector` - Edge detection on input frame
44+
- :ref:`ImageManip Tiling` - Using ImageManip for frame tiling
45+
- :ref:`ImageManip Rotate` - Using ImageManip to rotate color/mono frames

examples/image_manip_rotate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
camRgb.setInterleaved(False)
1414

1515
manipRgb = pipeline.createImageManip()
16-
manipRgb.setMaxOutputFrameSize(2000 * 1500 * 3)
1716
rgbRr = dai.RotatedRect()
1817
rgbRr.center.x, rgbRr.center.y = camRgb.getPreviewWidth() // 2, camRgb.getPreviewHeight() // 2
1918
rgbRr.size.width, rgbRr.size.height = camRgb.getPreviewHeight(), camRgb.getPreviewWidth()

0 commit comments

Comments
 (0)