a7medev / react-native-ml-kit

React Native On-Device Machine Learning w/ Google ML Kit
MIT License
396 stars 58 forks source link

Add cornerPoints to text-recognition #15

Closed frw closed 1 year ago

frw commented 1 year ago

What's New

This PR adds the cornerPoints attribute which is present in TextBlock, TextLine, and TextElement. cornerPoints is useful if you want to draw accurate highlights over the block/line/element that follows the perspective in which the photo is taken.

Reference Documentation

iOS: https://developers.google.com/ml-kit/reference/ios/mlkittextrecognitioncommon/api/reference/Classes/MLKTextBlock#/c:objc(cs)MLKTextBlock(py)cornerPoints Android: https://developers.google.com/android/reference/com/google/mlkit/vision/text/Text.TextBlock#getCornerPoints()

Testing

Built the example app, successfully compiled and ran the app on both iOS and Android, and logged the resulting result and saw that the cornerPoints attribute was indeed present in each block/line/element.

a7medev commented 1 year ago

Thanks for submitting this PR! I'll look into it and review it in the upcoming days.