JoeyEamigh / react-native-text-recognition

MIT License
23 stars 14 forks source link

Phone rotation #2

Closed OmkoBass closed 2 years ago

OmkoBass commented 2 years ago

I checked the source code out and if you have the time you should implemented the camera rotation value. Since some react native camera libraries don't give you the rotation.

There's an example here: https://developers.google.com/ml-kit/vision/text-recognition/android

I'd do a pull request but i'm not that good java. Thanks.

JoeyEamigh commented 2 years ago

I'll keep that in mind. For now, if you use react-native-camera and are having issues on Android, don't forget to use the fixOrientation function.

Feel free to PR it if you would like some experience as I am very busy right now :)

OmkoBass commented 2 years ago

By the way in your source code you have this

int rotationDegree = 0;
InputImage image = InputImage.fromBitmap(bitmap, rotationDegree);
....

so me changing angles wouldn't actually work i think. So that's why i opened this issue.

JoeyEamigh commented 2 years ago

That is just assuming that the photo's orientation has already been fixed. Horizontal images and such work for me as long as fixOrientation is set. If you have different experiences let me know.

OmkoBass commented 2 years ago

It works, thank you. (If someone is having trouble with the camera not picking up text, use react-native-camera package with fixOrientation: true)