The ROI class manages a region of interest represented as a rectangle in the [0,1]x[0,1] square. We refer to this as a normalized ROI. The ROI can be scaled to a given resolution (width x height), in this case we refert o it as a crop region. the crop region is only valid with the resolution it was scaled to because the resulting QRect or OpenCV rectangle is gicen as pixels in [0,width]x[0,height] scale.
More...
#include <roi.h>
|
|
| ROI () |
| | Default constructor initializing ROI to the full image (normalized [0,1] scale).
|
| |
| | ROI (const QRectF &roi) |
| | Constructs an ROI object from a QRectF.
|
| |
| | ROI (const cv::Rect2f &roi) |
| | Constructs an ROI object from an OpenCV Rect2f.
|
| |
| | ROI (const QRect &roi, const Resolution &resolution) |
| | Constructs an ROI object from a QRect in pixel coordinates and the corresponding reolution for normalization.
|
| |
| | ROI (const cv::Rect &roi, const Resolution &resolution) |
| | Constructs an ROI object from an OpenCV Rect in pixel coordinates and the corresponding reolution for normalization.
|
| |
| bool | isDefault () const |
| | Checks if the ROI matches the default ROI which is the entire image.
|
| |
| QRect | cropAsQRect (const Resolution &resolution) const |
| | Converts to a QRect, scaled to the given resolution.
|
| |
| cv::Rect | cropAsCvRect (const Resolution &resolution) const |
| | Converts to an OpenCV rect, scaled to the given resolution.
|
| |
| void | crop (const cv::Mat &src, cv::Mat &dest) const |
| | Crops an image using the ROI and stores the result in dest.
|
| |
| void | crop (cv::Mat &img) const |
| | Crops an image in-place.
|
| |
The ROI class manages a region of interest represented as a rectangle in the [0,1]x[0,1] square. We refer to this as a normalized ROI. The ROI can be scaled to a given resolution (width x height), in this case we refert o it as a crop region. the crop region is only valid with the resolution it was scaled to because the resulting QRect or OpenCV rectangle is gicen as pixels in [0,width]x[0,height] scale.
- Author
- Dominik Wüst
- Date
- March 2025
◆ ROI() [1/4]
| ROI::ROI |
( |
const QRectF & |
roi | ) |
|
|
inline |
Constructs an ROI object from a QRectF.
- Parameters
-
| roi | The QRectF defining the region in [0,1] scale. |
◆ ROI() [2/4]
| ROI::ROI |
( |
const cv::Rect2f & |
roi | ) |
|
|
inline |
Constructs an ROI object from an OpenCV Rect2f.
- Parameters
-
| roi | The OpenCV rectangle defining the region in [0,1] scale. |
◆ ROI() [3/4]
| ROI::ROI |
( |
const QRect & |
roi, |
|
|
const Resolution & |
resolution |
|
) |
| |
Constructs an ROI object from a QRect in pixel coordinates and the corresponding reolution for normalization.
- Parameters
-
| roi | The QRect defining the region in [0,width]x[0,height] scale. |
| resolution | The Resolution (width x height) for normalizing the roi to [0,1] scale. |
◆ ROI() [4/4]
| ROI::ROI |
( |
const cv::Rect & |
roi, |
|
|
const Resolution & |
resolution |
|
) |
| |
Constructs an ROI object from an OpenCV Rect in pixel coordinates and the corresponding reolution for normalization.
- Parameters
-
| roi | The OpenCV rectangle defining the region in [0,width]x[0,height] scale. |
| resolution | The Resolution (width x height) for normalizing the roi to [0,1] scale. |
◆ crop() [1/2]
| void ROI::crop |
( |
const cv::Mat & |
src, |
|
|
cv::Mat & |
dest |
|
) |
| const |
|
inline |
Crops an image using the ROI and stores the result in dest.
- Parameters
-
| src | Input image. |
| dest | Output cropped image. |
◆ crop() [2/2]
| void ROI::crop |
( |
cv::Mat & |
img | ) |
const |
|
inline |
Crops an image in-place.
- Parameters
-
◆ cropAsCvRect()
| cv::Rect ROI::cropAsCvRect |
( |
const Resolution & |
resolution | ) |
const |
|
inline |
Converts to an OpenCV rect, scaled to the given resolution.
- Parameters
-
| resolution | The resolution (width x height) to scale the roi to. |
- Returns
- The ROI as an OpenCV rectangle in [0,width]x[0,height] scale.
◆ cropAsQRect()
| QRect ROI::cropAsQRect |
( |
const Resolution & |
resolution | ) |
const |
|
inline |
Converts to a QRect, scaled to the given resolution.
- Parameters
-
| resolution | The resolution (width x height) to scale the roi to. |
- Returns
- The ROI as a QRect in [0,width]x[0,height] scale.
◆ isDefault()
| bool ROI::isDefault |
( |
| ) |
const |
|
inline |
Checks if the ROI matches the default ROI which is the entire image.
- Returns
- true if the ROI matches is the entire image.
The documentation for this class was generated from the following files:
- iVS3D/src/iVS3D-core/model/reader/roi.h
- iVS3D/src/iVS3D-core/model/reader/roi.cpp