Flip, rotation, HW ROI gives "Roi out of limits"
With a camera that supports HW ROI, say PCO Edge,
- initially setting flip (1, 0), no ROI set.
- then setting in sequence
- rotation(90)
- rotation(0)
leads to error Roi out of limits
.
The invalid code has been cornered in:
inline int Roi::complementX(const Size& image_size, bool swapped) const
{
int width = swapped ? image_size.getHeight() : image_size.getWidth();
return width - m_top_left.x - m_size.getWidth();
}
With a rotation of 90, image_size
and m_size
have swapped coordinates.
A possible fix would be to use either image_size
or m_size
. Or make sure that they are the same... Or rewrite the all CtImage thing.
The simplified backtrace is:
#0 Roi::complementX
#1 Roi::getFlipped
#2 CtImage::_setHSRoi
Reported by @muzelle on ID19.