I don't find any method in OpenCV to support degree symbol (º) Special Character. Please comment if anyone finds any method for the same. I have resolved the above issue by drawing a circle in place of degree symbol (º).
Please find the code below:
private Bitmap setImageWithText(ImageView imageView) {
Bitmap icon = BitmapFactory.decodeResource(getResources(), drawableID);
Mat mat = new Mat();
Bitmap bmp32 = icon.copy(Bitmap.Config.ARGB_8888, true);
Utils.bitmapToMat(bmp32, mat);
Point position = new Point(300, 300);
Scalar color = new Scalar(255.0, 0.0, 0.0);
int font = Imgproc.FONT_HERSHEY_SIMPLEX;
int scale = 1;
int thickness = 3;
//Adding text to the image
Imgproc.cvtColor(mat2, mat, 1, 4);
Imgproc.putText(mat, "98.452", position, font, scale, color, thickness);
int baseline[] = {0};
Size textSize = Imgproc.getTextSize("98.452", Imgproc.FONT_HERSHEY_SIMPLEX, 1.0, 3, baseline);
//Drawing a Circle
Imgproc.circle(
mat, //Matrix obj of the image
new Point(300 + textSize.width+20, 300 -(textSize.height+20)), //Center of the circle
7, //Radius
new Scalar(255.0, 0.0, 0.0), //Scalar object for color
3 //Thickness of the circle
);
Imgproc.putText(mat, "F", new Point(300 + (textSize.width+textSize.height), 300), font, scale, color, thickness);
Bitmap output = Bitmap.createBitmap(bmp32.getWidth(), bmp32.getHeight(), bmp32.getConfig());
Utils.matToBitmap(mat, output);
return output;
}