0


I have 1 function image processing call is: automatic license plate recognition .
But this function process image only true when horizontal images.

I want image auto rotate each level like rotate 1" > not success, 2" > not success, 3" > ok, success and break foreach.

I just think.

bool processimageflag = false;    //processimage represent function.
private void RotateImage()
{
    foreach(...)
    {
         if(processimageflag == true)
         {
               rotatefunction();
         }
    }
}

private void ProcessImage()
{
     return processimageflag;
}

I don't know write function RotateImage().

Until function process image success.

Thank you.

Konamiman
  • 49,681
  • 17
  • 108
  • 138

2 Answers2

0

You can rotate the image by angle each increment. And you can use the Rectangle to redraw the image.

You can use the Math.Atan for this computation and there is a similar explanation here that you might want to learn:

How to calculate rotation angle from rectangle points?

Another implementation in C# Rotate image math (C#)

Community
  • 1
  • 1
Joel Legaspi Enriquez
  • 1,236
  • 1
  • 10
  • 14
0

I'm feeding in a Bitmap image to my C# program to be able to perform OCR to identify the characters in the image. I can do this fairly well if the image is not rotated.

One of the program requirements, however, is that the program automatically determines if the image has been rotated, and that it automatically corrects these rotations.

I've tried implementing a simple method where lines are traced across the image and points which contact a character are recorded, and then performing a simple linear regression on the line points. This works to an extent, although it has not proven very accurate due to curvature of characters, etc.