Bug 23477 - GetMetadataOutputRectOfInterestForRect returns incorrect co-ordinates
Summary: GetMetadataOutputRectOfInterestForRect returns incorrect co-ordinates
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.0.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-09-29 22:58 UTC by Jason Awbrey
Modified: 2014-09-30 05:45 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

sample project demonstrating barcoderegion issue (6.37 KB, application/zip)
2014-09-29 22:58 UTC, Jason Awbrey

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jason Awbrey 2014-09-29 22:58:25 UTC
Created attachment 8248 [details]
sample project demonstrating barcoderegion issue

AVCaptureMetadataOutput GetMetadataOutputRectOfInterestForRect should take an input RectF in normal device coordinates and return a RectF in metadata device coordinates, which are in a range (0,0),(1,1).  This is necessary if you want to specify a target region for barcode scanning instead of using the entire camera field of view.

However, it seems like GetMetadataOutputRectOfInterestForRect is always returning the same RectF that is passed in.

The attached sample sets up a simple barcode capture, and draws a target region overlay for the user.  It uses GetMetadataOutputRectOfInterestForRect to convert the target region into metadata coordinates so that the capture RectOfInterest **should** match the target area visible to the user. But in practice it seems to return the same value that was input, so that RectOfInterest is set to a bad value which does not correspond to the region visible to the user.
Comment 1 Sadik Ali 2014-09-30 05:41:04 UTC
I have tried this issue but I think we may have to see if a developer can figure out what's going on with this.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2014-09-30 05:45:01 UTC
This doesn't look like an issue in Xamarin.iOS, a simple test in Objective-C/Xcode reveals the same output: https://gist.github.com/rolfbjarne/c4b20adea4aae44d53c3

You might be better off asking in the forums / stackoverflow, where other people can help you figure out if this is the expected behavior or not.