Skip to content
This repository has been archived by the owner on Sep 21, 2019. It is now read-only.

Portrait Orientation #4

Closed
arjunvasan opened this issue Apr 9, 2012 · 7 comments
Closed

Portrait Orientation #4

arjunvasan opened this issue Apr 9, 2012 · 7 comments

Comments

@arjunvasan
Copy link

Hey rmtheis,

Thanks for your awesome prototype ocr app! I've been using it to figure out how to get tesseract working on android. I have a ee signal processing background, and I'm kind of new to android.

What are the changes needed using your source to switch to portrait mode? I'm sure you have lots of your own stuff to deal with, but if you have a minute I'd appreciate the help! How is it that the camera preview appears orthogonal to reality?

Thanks
Arjun

@rmtheis
Copy link
Owner

rmtheis commented Apr 9, 2012

You're welcome! To change to portrait mode, I think all you need to do is
to take out the android:screenOrientation="landscape" directive in
AndroidManifest.xml. You might possibly also need to adjust the viewfinder
box in getFramingRect() in CameraManager.java.

Right now I have it locked to landscape mode because that seems to better
cover horizontal text.
Robert

On Sun, Apr 8, 2012 at 10:11 PM, arjunvasan <
reply@reply.github.com

wrote:

Hey rmtheis,

Thanks for your awesome prototype ocr app! I've been using it to figure
out how to get tesseract working on android. I have a ee signal processing
background, and I'm kind of new to android.

What are the changes needed using your source to switch to portrait mode?
I'm sure you have lots of your own stuff to deal with, but if you have a
minute I'd appreciate the help! How is it that the camera preview appears
orthogonal to reality?

Thanks
Arjun


Reply to this email directly or view it on GitHub:
#4

@arjunvasan
Copy link
Author

Hey Robert,

Thanks for your help. So right now it's previewing in portrait mode, and i
set the viewfinder rectangle to the appropriate dimensions. However the
OCR seems to be treating the bitmap it's fed as if it were still in
landscape. If the viewfinder is over one line of text, the bounding boxes
seem to identify each letter as it's own line of text. Suggestions?

Thanks so much,
Arjun

On Sun, Apr 8, 2012 at 11:03 PM, Robert Theis <
reply@reply.github.com

wrote:

You're welcome! To change to portrait mode, I think all you need to do is
to take out the android:screenOrientation="landscape" directive in
AndroidManifest.xml. You might possibly also need to adjust the viewfinder
box in getFramingRect() in CameraManager.java.

Right now I have it locked to landscape mode because that seems to better
cover horizontal text.
Robert

On Sun, Apr 8, 2012 at 10:11 PM, arjunvasan <
reply@reply.github.com

wrote:

Hey rmtheis,

Thanks for your awesome prototype ocr app! I've been using it to figure
out how to get tesseract working on android. I have a ee signal
processing
background, and I'm kind of new to android.

What are the changes needed using your source to switch to portrait mode?
I'm sure you have lots of your own stuff to deal with, but if you have a
minute I'd appreciate the help! How is it that the camera preview
appears
orthogonal to reality?

Thanks
Arjun


Reply to this email directly or view it on GitHub:
#4


Reply to this email directly or view it on GitHub:
#4 (comment)

@slashuer
Copy link

@rmtheis I have been studying your code , because I am making an app that uses OCR.
I noticed you had a light in the preferences does it not work something.
because I wrote some good light code, so can I implement a light in here for you?

also: do you have any Idea how I could fix one side of the view Rect so that it does not cross under the shutter button?
PS: sorry for writing in the wrong area, You don't have a way to message you.

@rmtheis
Copy link
Owner

rmtheis commented Apr 11, 2012

Hmm...sorry...my CRS disease is affecting me. Try setting the "portrait"
boolean when you call findBestPreviewSizeValue() in
CameraConfigurationManager. Also remove the hard-coded landscape values in
initFromCameraParameters(). Let me know if that works.
Robert

On Mon, Apr 9, 2012 at 2:45 PM, arjunvasan <
reply@reply.github.com

wrote:

Hey Robert,

Thanks for your help. So right now it's previewing in portrait mode, and i
set the viewfinder rectangle to the appropriate dimensions. However the
OCR seems to be treating the bitmap it's fed as if it were still in
landscape. If the viewfinder is over one line of text, the bounding boxes
seem to identify each letter as it's own line of text. Suggestions?

Thanks so much,
Arjun

On Sun, Apr 8, 2012 at 11:03 PM, Robert Theis <
reply@reply.github.com

wrote:

You're welcome! To change to portrait mode, I think all you need to do is
to take out the android:screenOrientation="landscape" directive in
AndroidManifest.xml. You might possibly also need to adjust the
viewfinder
box in getFramingRect() in CameraManager.java.

Right now I have it locked to landscape mode because that seems to better
cover horizontal text.
Robert

On Sun, Apr 8, 2012 at 10:11 PM, arjunvasan <
reply@reply.github.com

wrote:

Hey rmtheis,

Thanks for your awesome prototype ocr app! I've been using it to
figure
out how to get tesseract working on android. I have a ee signal
processing
background, and I'm kind of new to android.

What are the changes needed using your source to switch to portrait
mode?
I'm sure you have lots of your own stuff to deal with, but if you
have a
minute I'd appreciate the help! How is it that the camera preview
appears
orthogonal to reality?

Thanks
Arjun


Reply to this email directly or view it on GitHub:
#4


Reply to this email directly or view it on GitHub:
#4 (comment)


Reply to this email directly or view it on GitHub:
#4 (comment)

@rmtheis
Copy link
Owner

rmtheis commented Apr 11, 2012

@slashuer Thanks for the offer--I appreciate it. Yeah, I had a light toggle button in there for a while, but it seemed to reduce OCR quality much more than it actually helped, so I prefer to leave it out. (It also generated a bunch of error reports that obscured errors that I'm more interested in seeing.)

I'm not sure offhand how to best limit the rect size. You could limit the size of the rect in onTouch() in CaptureActivity based on the size of the shutter button on the user's device. A better solution would be to animate the movement of the shutter button off-screen temporarily while the rect is in the way.

@rmtheis rmtheis closed this as completed May 4, 2012
@arjunvasan
Copy link
Author

Hey Robert,

Thanks again for your work on porting tesseract to android. I'm currently
working on a startup that is going to use tesseract on both android and
iphone. We were just funded by YCombinator and Highland capital, so now
it's getting serious. I was wondering if you had some time to help us
understand and utilize tesseract optimally. A couple hours would be more
than enough.

Thanks!
Arjun

On Tue, Apr 10, 2012 at 11:05 PM, Robert Theis <
reply@reply.github.com

wrote:

@slashuer Thanks for the offer--I appreciate it. Yeah, I had a light
toggle button in there for a while, but it seemed to reduce OCR quality
much more than it actually helped, so I prefer to leave it out. (It also
generated a bunch of error reports that obscured errors that I'm more
interested in seeing.)

I'm not sure offhand how to best limit the rect size. You could limit the
size of the rect in onTouch() in CaptureActivity based on the size of the
shutter button on the user's device. A better solution would be to animate
the movement of the shutter button off-screen temporarily while the rect is
in the way.


Reply to this email directly or view it on GitHub:
#4 (comment)

@akorentlab
Copy link

@slashuer can i please have your code for light? please reply soon

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants