Reputation: 31738
I would like to rotate an image in OpenCV (I'm currently doing it this way image manipulation SO answer) but would like to specify the colour used to fill the gaps created by the rotation - by default, it's black (see below)
How could this be done?
Upvotes: 1
Views: 320
Reputation: 3407
I think the answer lies in the official doc:
C: void cvWarpAffine(const CvArr* src, CvArr* dst, const CvMat* map_matrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
where
CvScalar fillval=cvScalarAll(0)
specifies the fill color of the "gap".
Just specify the fillval
with a color scalar when calling this function.
Upvotes: 2