-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pixOrientDetect with .bmp file #733
Comments
To get the pixconv value I have used below Api and 130 is the random threshold value. With threshold 255, my issue was resolved but I have doubt about threshold value. |
This is working as expected. There is a note in pixUpDownDetect() that the image should have a resolution between 150 and 300 ppi. This note is easy to miss and should have been put in a more obvious place, and I will do that. Your image was made at a high resolution of 600 ppi., so I scaled it down with a scalefactor of 0.35, binarized it with a threshold of 128 (a reasonable value to use for a clean scan such as yours), and ran
with the result:
which says there is a very high confidence that it is rightside up. |
Thank you DanBloomberg for sorting this out. Your inputs helped me to solve my issue. |
There are many functions that adapt the local threshold based on a measurement of the background value. Adaptive binarization is done in two steps: There are several high level functions in leptonica for doing adaptive binarization on grayscale and color images, such as:
|
Thank you @DanBloomberg for the information. I have a query on below Api's
File: |
I don't know what you are doing. Before you can use the orientation detector, you must convert to 1 bpp with resolution between 150 and 300, as I have previously described. This gets rid of the color. So if you do this:
the result is:
which says that the orientation is correct as it is. This is finding a global angle for rotation; it is essentially ignoring the stamp, which the algorithm sees as a blob of pixels without any small text orientation. |
I'm using below Leptonica Api [1.81.1] for Orientation detect and rotate the file according to the text.
pixOrientDetect(new HandleRef(pix, pixconv), out pupconf, out pleftconf, 0, 0);
For a particular BMP file shared below, it is returning wrong outputs so that Rotation is not expected one.
Input_File.zip
The text was updated successfully, but these errors were encountered: