I'm trying to rotate image using
void rotate(cv::Mat& src, double angle, cv::Mat& dst)
{
int len = std::max(src.cols, src.rows);
cv::Point2f pt(len / 2., len / 2.);
cv::Mat r = cv::getRotationMatrix2D(pt, angle, 1.0);
cv::warpAffine(src, dst, r, cv::Size(src.cols, src.rows));
}
by giving angle, source and destination image. Rotation works correctly as follows.
I want to make black areas white. I have tried with
cv::Mat dst = cv::Mat::ones(src.cols, src.rows, src.type());
before calling rotate, but no change in result. How can I achieve this?
Note: I am looking for solution which achieve this while doing the rotation. obviously by making black areas white after the rotation this can be achieved.