![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
#include <WinCvIoI.h>
Public Member Functions | |
| WinCvIoI (cv::Size &sizeIoI, cv::Size &sizeTgt, RotOp eOpRot, AlignOp eOpAlign, bool bCropToFit) | |
| Image of Interest class initialization constructor. More... | |
| virtual | ~WinCvIoI () |
| Destructor. | |
| void | setTransformParams (cv::Size &sizeIoI, cv::Rect &rectRoIIoI, cv::Size &sizeTgt, RotOp eOpRot, AlignOp eOpAlign, bool bCropToFit) |
| Set Image of Interest transfromation parameters. More... | |
| virtual void | transform (cv::Mat &imgIoI, cv::Mat &imgTgt) |
| Transform Image of Interest into the target image. More... | |
| cv::Point | mapPoint (cv::Point &ptDisplay) |
| Map display pixel coordinates to Image of Interest pixel coordinates. More... | |
| cv::Size | getOriginalSize () |
| cv::Size | getTransformedSize () |
| Get the transformed target size. More... | |
| cv::Size | calcMaxFit43 (cv::Size &sizeSrc, cv::Size &sizeTgt) |
| Calculate the maximal size the source can fit into the target size while keeping a 4:3 aspect ratio. More... | |
Protected Attributes | |
| cv::Size | m_sizeIoI |
| image native size | |
| cv::Rect | m_rectRoIIoI |
| image of interest region of interest | |
| cv::Size | m_sizeTgt |
| target workspace size | |
| cv::Rect | m_rectRoITgt |
| target workspace region of interest | |
| RotOp | m_eOpRot |
| image rotation operator | |
| cv::Mat | m_matRot |
| 2x3 transformation matrix | |
| cv::Size | m_sizeRotated |
| rotated image size | |
| bool | m_bOpRotate |
| do [not] apply rotation operation | |
| bool | m_bOpScale |
| do [not] apply resize operation | |
| cv::Size | m_sizeScaled |
| scaled image size | |
| bool | m_bOpCrop |
| do [not] apply crop operation | |
| cv::Rect | m_rectRoICropped |
| cropped region of interest | |
| AlignOp | m_eOpAlign |
| image alignment operator | |
Window OpenCV Image of Interest (IoI) Class.
An IoI is typically at a higher resolution the what can be showed on a display. Moreover, the display of IoI may require rotation and alignment.
Definition at line 81 of file WinCvIoI.h.
| WinCvIoI::WinCvIoI | ( | cv::Size & | sizeIoI, |
| cv::Size & | sizeTgt, | ||
| RotOp | eOpRot, | ||
| AlignOp | eOpAlign, | ||
| bool | bCropToFit | ||
| ) |
Image of Interest class initialization constructor.
Initialize the transformations needed to place a IoI in the window.
| sizeIoI | Size of hi-res Image of Interest. |
| sizeTgt | Size of target workspace, oriented at 0 degrees. |
| eOpRot | Target image rotation operation. See rnmpwin_rot. |
| eOpAlign | Target image alignment operation. See rnmpwin_align. |
| bCropToFit | If true, the transformed image is cropped to fit into target size. Otherwise the transformed image is scaled to fit. |
Definition at line 82 of file WinCvIoI.cxx.
| Size WinCvIoI::calcMaxFit43 | ( | cv::Size & | sizeSrc, |
| cv::Size & | sizeTgt | ||
| ) |
Calculate the maximal size the source can fit into the target size while keeping a 4:3 aspect ratio.
| sizeSrc | Source size. |
| sizeTgt | Target size. |
Definition at line 365 of file WinCvIoI.cxx.
References rnr::ar43height(), and rnr::ar43width().
Referenced by getTransformedSize().
|
inline |
Get the IoI original size.
Definition at line 157 of file WinCvIoI.h.
References m_sizeIoI.
|
inline |
Get the transformed target size.
Definition at line 167 of file WinCvIoI.h.
References calcMaxFit43(), and m_rectRoITgt.
| Point WinCvIoI::mapPoint | ( | cv::Point & | ptDisplay | ) |
Map display pixel coordinates to Image of Interest pixel coordinates.
| ptDisplay | Point in display coordinates. |
Definition at line 302 of file WinCvIoI.cxx.
References rnr::RotOp0, rnr::RotOp180, rnr::RotOp270, and rnr::RotOp90.
Referenced by ~WinCvIoI().
| void WinCvIoI::setTransformParams | ( | cv::Size & | sizeIoI, |
| cv::Rect & | rectRoIIoI, | ||
| cv::Size & | sizeTgt, | ||
| RotOp | eOpRot, | ||
| AlignOp | eOpAlign, | ||
| bool | bCropToFit | ||
| ) |
Set Image of Interest transfromation parameters.
Initialize the transformations needed to place a IoI in the window.
| sizeIoI | Size of hi-res Image of Interest. |
| rectRoIIoI | Region of Interest within Image of Interest. |
| sizeTgt | Size of target workspace, oriented at 0 degrees. |
| eOpRot | Target image rotation operation. See rnmpwin_rot. |
| eOpAlign | Target image alignment operation. See rnmpwin_align. |
| bCropToFit | If true, the transformed image is cropped to fit into target size. Otherwise the transformed image is scaled to fit. |
Definition at line 94 of file WinCvIoI.cxx.
References rnr::AlignOpCenter, rnr::AlignOpDefault, rnr::AlignOpLeft, rnr::AlignOpRight, rnr::RotOp0, rnr::RotOp180, rnr::RotOp270, and rnr::RotOp90.
Referenced by ~WinCvIoI().
|
virtual |
Transform Image of Interest into the target image.
| imgIoI | Image of Interest. | |
| [in,out] |
Definition at line 266 of file WinCvIoI.cxx.
Referenced by ~WinCvIoI().