Skip to content

Detection stops when the screen orientation is changed. #596

@yamamotokotaro

Description

@yamamotokotaro

Title: Detection stops when the screen orientation is changed.

Describe the bug
When running the example app on iOS, object detection stops when the screen orientation is changed.
On Android, the detection continues without any problem.

To Reproduce
Steps to reproduce the behavior:

  1. Tap 'Vision APIs' and go to 'Object Detection' in example app.
  2. Change screen orientation

Expected behavior
Object detection stops and the last detection result continues to be displayed

Screenshots
スクリーンショット 2024-03-30 21 44 17

Platform (please complete the following information):

  • OS: iOS
  • Device: iPhone 15 pro max
  • OS: iOS 17.3.1
  • Flutte Versionr: 3.16.6
  • Plugin version: 0.11.0

Additional context
I added the orientation to VisionImage in the plugin's Object-C file, but the symptoms did not improve!
It seems that even if I change the screen orientation, the image byte data is still sent to the plugin's Object-C function, and the same detection results continue to be returned.

NSLog(@"metadataRotation: %@", metadata[@"rotation"]);
    if (rotation.intValue == 180) {
        visionImage.orientation = UIImageOrientationRight;
    } else {
        visionImage.orientation = UIImageOrientationUp;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions