eac9c62b5ad03134a7d134229eae6ff0ab7bfa10 |
|
16-Jan-2016 |
Mikael Persson <mikael.persson@intel.com> |
camera2: Modify logic for comparing rects The helper function expectRectsAreSimilar, used by e.g. testDigitalZoom, is checking that the top-left coordinates are similar with an error margin in percent. However, this doesn't work well if the top-left coordinate is only a few pixels since a pixel difference is then significant amount in percentage. For example, if the actual top-left is (6,3) and the expected is (8,4), then the difference in percentage is 25%. Instead of comparing the top-left and bottom-right coordinates, check that the center of both rectangles are similar. If this is the case, as well as the width and height, then they are similar. Change-Id: Ice491178bf26e2d35579efc42036e0ac86c77b66 Signed-off-by: Mikael Persson <mikael.persson@intel.com>
|