-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from luxonis/fov_tutorial
Added maximizing FoV docs
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
How to maximize FOV | ||
=================== | ||
|
||
By default, when you are using :code:`preview` output from :ref:`ColorCamera`, the DepthAI will crop the | ||
frames to get the desired aspect ratio. For example, if you are using Mobilenet-SSD model, you need | ||
:code:`300x300` frames. DepthAI will crop 1080P frames to :code:`1080x1080` and then resize them to :code:`300x300`. | ||
This means you will lose some part of the image. | ||
|
||
If you would like to maximize the FOV of the image, you can either: | ||
|
||
#. Change the aspect ratio (stretch the image) | ||
#. Apply letterboxing to the image | ||
|
||
Change aspect ratio | ||
******************* | ||
|
||
Use :code:`camRgb.setPreviewKeepAspectRatio(False)`. This means the aspect ratio will not be preserved and the image | ||
will be "stretched". This might be problematic for some off-the-shelf NN models, so model fine-tuning it might be required. | ||
`Usage example here <https://github.com/luxonis/depthai-python/blob/main/examples/rgb_mobilenet_4k.py#L42>`__. | ||
|
||
Letterboxing | ||
************ | ||
|
||
`Letterboxing <https://en.wikipedia.org/wiki/Letterboxing_%28filming%29>`__ the frames. This method will decrease | ||
the size of the image and apply "black bars" above and below the image, so the aspect ratio is preserved. You can | ||
achieve this by using :ref:`ImageManip` with :code:`manip.setResizeThumbnail(x,y)` (for Mobilenet :code:`x=300,y=300`). | ||
The downside of using this method is that your actual image will be smaller, so some features might not be preserved, | ||
which can mean the NN accuracy could decrease. | ||
`Usage example here <https://github.com/luxonis/depthai-python/blob/main/examples/object_tracker_video.py#L44>`__. | ||
|
||
.. image:: /_static/images/tutorials/fov.jpeg | ||
|