【发布时间】:2014-02-17 16:18:15
【问题描述】:
我有边界框,我想用这个边界框裁剪图像。
但是我想增加边界框的大小,所以我这样做了
if ((roi_.x - 5) > 0) // i test here in case the component at the left near border we do not minus otherwise it will be error
{
roi_.x += (-5);
}
if ((roi_.y - 5) > 0) // i test here in case the component at the left near border we do not minus otherwise it will be error
{
roi_.y += (-5);
}
if (&(roi_ + cv::Size(10, 0)) != NULL)
{
roi_.width += 10;
}
if (&(roi_ + cv::Size(0, 10)) != NULL)
{
roi_.height += 10;
}
对于最靠近边框的组件,如果我增加宽度会出错。如果组件位于边框附近的底部,高度也是如此
有没有办法处理这个异常?
【问题讨论】:
标签: c++ exception opencv exception-handling rect