Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only run for 'Region of Interest' #6

Closed
Ectrics opened this issue Jun 5, 2020 · 1 comment
Closed

Only run for 'Region of Interest' #6

Ectrics opened this issue Jun 5, 2020 · 1 comment
Labels
enhancement New feature or request ios

Comments

@Ectrics
Copy link

Ectrics commented Jun 5, 2020

Is it possible to run the camera on a region of interest for maximum speed? As in attached image, only a part of the screen would be actually requested for inference? (I'm interested in doing this for iOS)

RoI_example

@calren calren added enhancement New feature or request ios labels Jun 6, 2020
@bcdj
Copy link
Collaborator

bcdj commented Jan 15, 2021

If you always know where your interested region is, have you tried crop the input image to just that region and try it out to see if improves the speed? Assuming you are using a live video camera and CMSampleBuffer as the input format, you can check out this sample code for cropping it:

https://github.com/FirebaseExtended/mlkit-material-ios/blob/master/ShowcaseApp/ShowcaseAppSwift/Common/ImageUtilities.swift#L85

If your input image format is UIImage, I think you can use this:

https://developer.apple.com/documentation/coregraphics/1454683-cgimagecreatewithimageinrect?language=objc

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ios
Projects
None yet
Development

No branches or pull requests

3 participants