help me rotate text image, i want the text to be smooth all the examples that are written in python. My code.
var src = Cv2.ImRead("NzGFw.png");
var gray = new Mat();
Cv2.CvtColor(src, gray, ColorConversionCodes.BGR2GRAY);
var output = new Mat();
Cv2.BitwiseNot(gray, output);
Mat points = Mat.Zeros(output.Size(), output.Type());
Cv2.FindNonZero(output, points);
var box = Cv2.MinAreaRect(points);
Mat squares = src.Clone();
Mat rot = Cv2.GetRotationMatrix2D(box.Center, box.Angle, 1);
Mat rotated = new Mat();
Cv2.WarpAffine(squares, rotated, rot, squares.Size(), InterpolationFlags.Cubic);
Cv2.ImWrite("inclined_text_squares_rotated.jpg", rotated);[![enter image description here][1]][1]