node-opencv icon indicating copy to clipboard operation
node-opencv copied to clipboard

how to write analog code in node-opencv?

Open vinnitu opened this issue 9 years ago • 0 comments

void rotate2D(const Mat & src, Mat & dst, double angle, Mat & irot)
{
    Point2f center(src.cols/2.0, src.rows/2.0);
    Mat rot = getRotationMatrix2D(center, angle, 1.0);
    Rect bbox = RotatedRect(center, src.size(), angle).boundingRect();
    rot.at<double>(0, 2) += bbox.width/2.0 - center.x;
    rot.at<double>(1, 2) += bbox.height/2.0 - center.y;
    invertAffineTransform(rot, irot);
    warpAffine(src, dst, rot, bbox.size());
}

I use this code in C++ version app, but now I want to convert it to javascript, but don't understand how...

I can't find equivalent of RotatedRect

Can somebody help me?

Thanks.

vinnitu avatar Nov 11 '16 16:11 vinnitu