Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is my version of putRotateText()

void putRotateText(InputOutputArray img, const String& text, Point org,double angle,int fontFace, double fontScale, Scalar color, int thickness, int lineType,   bool bottomLeftOrigin ){

    Mat text_image_color = Mat::zeros(static_cast<int>(img.rows * 1.2), (img.cols*1.2), img.type());
    Mat text_image_white = Mat::zeros(static_cast<int>(img.rows * 1.2), (img.cols*1.2), imgl.type());
    putText(text_image_color , text, org, frontFace,frontScale,color,thickness);
    putText(text_image_white, text, org, frontFace, frontScale,color,thickness);
    Mat rotationMatrix = cv::getRotationMatrix2D(orgr, angle, 1.0);//couter clockwise rotation
    warpAffine(text_image_color, text_image_color, rotationMatrix,Size(img.width,img.height));
    warpAffine(text_image_white, text_image_white, rotationMatrix,Size(img.width,imgheight));
    img-=text_image_white;
    img+=text_image_color;
}

anyone any suggestion?

Here is my version of putRotateText()

void putRotateText(InputOutputArray img, const String& text, Point org,double angle,int fontFace, double fontScale, Scalar color, int thickness, int lineType,   bool bottomLeftOrigin thicknes ){

    Mat text_image_color = Mat::zeros(static_cast<int>(img.rows * 1.2), (img.cols*1.2), img.type());
    Mat text_image_white = Mat::zeros(static_cast<int>(img.rows * 1.2), (img.cols*1.2), imgl.type());
    putText(text_image_color , text, org, frontFace,frontScale,color,thickness);
    putText(text_image_white, text, org, frontFace, frontScale,color,thickness);
    Mat rotationMatrix = cv::getRotationMatrix2D(orgr, angle, 1.0);//couter clockwise rotation
    warpAffine(text_image_color, text_image_color, rotationMatrix,Size(img.width,img.height));
    warpAffine(text_image_white, text_image_white, rotationMatrix,Size(img.width,imgheight));
    img-=text_image_white;
    img+=text_image_color;
}

anyone any suggestion?

Here is my version of putRotateText()

void putRotateText(InputOutputArray img, const String& text, Point org,double angle,int fontFace, double fontScale, Scalar color, int thicknes ){

    Mat text_image_color = Mat::zeros(static_cast<int>(img.rows * 1.2), (img.cols*1.2), img.type());
    Mat text_image_white = Mat::zeros(static_cast<int>(img.rows * 1.2), (img.cols*1.2), imgl.type());
    putText(text_image_color , text, org, frontFace,frontScale,color,thickness);
frontFace, frontScale, color                       ,thickness);
    putText(text_image_white, text, org, frontFace, frontScale,color,thickness);
frontScale, Scalar(255,255,255),thickness);
    Mat rotationMatrix = cv::getRotationMatrix2D(orgr, angle, 1.0);//couter clockwise rotation
    warpAffine(text_image_color, text_image_color, rotationMatrix,Size(img.width,img.height));
    warpAffine(text_image_white, text_image_white, rotationMatrix,Size(img.width,imgheight));
    img-=text_image_white;
    img+=text_image_color;
}

anyone any suggestion?