Здравствуйте! Как настроить распознавание в лендскейп ориентации? В докуметации и примере этого не предусмотрено. Выдает Search region is invalid при переворачивании. Прошу помощи.
RTR Device Orientation
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています
Здравствуйте! Как настроить распознавание в лендскейп ориентации? В докуметации и примере этого не предусмотрено. Выдает Search region is invalid при переворачивании. Прошу помощи.
0人中0人がこの記事が役に立ったと言っています
コメント
4件のコメント
Обратите внимание на посты: is Orientation other than Portrain supported in AbbyyRtrSDK? и Android sample app crashes when changing from portrait to landscape. Данный вопрос уже ранее обсуждался там.
Спасибо за ответ! Эти посты видел. "you’ll need to restart the service with changed orientation" - что под этим подразумевается? Что конкретно нужно сделать после смены ориентации?
Необходимо в настройках проекта включить Device Orientation > Landscape Left и Landscape Right, а также добавить в код метод для трансляции координат:
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; BOOL wasRunning = self.isRunning; self.running = NO; [_textCaptureService stopTasks]; [self clearScreenFromRegions]; [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) { _imageBufferSize = CGSizeMake(MIN(_imageBufferSize.width, _imageBufferSize.height), MAX(_imageBufferSize.width, _imageBufferSize.height)); if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) { _imageBufferSize = CGSizeMake(_imageBufferSize.height, _imageBufferSize.width); } [self updateAreaOfInterest]; self.running = wasRunning; }]; }В ближайшую неделю появится новая версия Real-Time Recognition SDK, включающая в себя уже дополненный пример, поддерживающий данную функциональность.
In English:
If you want your application works with landscape orientation, you need to enable Device Orientation > Landscape Left and Landscape Right in your project, and implement the method for translating coordinates:
Beginning from the RTR SDK 1 Release 5 with extended Data Capture (the build number 1.0.7.56) our code samples support of landscape mode.
サインインしてコメントを残してください。