29 ROI() : m_roi(0.0,0.0,1.0,1.0) {}
35 ROI(
const QRectF &roi) : m_roi(roi) {}
41 ROI(
const cv::Rect2f &roi) : m_roi(roi.x,roi.y,roi.width,roi.height) {}
60 bool isDefault()
const {
return m_roi == QRectF(0.0,0.0,1.0,1.0); }
62 cv::Rect2f toCvRect()
const {
return cv::Rect2f(m_roi.left(), m_roi.top(), m_roi.width(), m_roi.height()); }
63 QRectF toQRectF()
const {
return QRectF(m_roi.left(), m_roi.top(), m_roi.width(), m_roi.height()); }
70 QRect
cropAsQRect(
const Resolution& resolution)
const {
return QRect(m_roi.left() * resolution.getWidth(), m_roi.top() * resolution.getHeight(), m_roi.width() * resolution.getWidth(), m_roi.height() * resolution.getHeight()); }
77 cv::Rect
cropAsCvRect(
const Resolution& resolution)
const {
return cv::Rect(m_roi.left() * resolution.getWidth(), m_roi.top() * resolution.getHeight(), m_roi.width() * resolution.getWidth(), m_roi.height() * resolution.getHeight()); }
90 void crop(cv::Mat &img)
const {
crop(img,img); }
void crop(const cv::Mat &src, cv::Mat &dest) const
Crops an image using the ROI and stores the result in dest.
Definition roi.h:84