Closed robcabardo closed 1 year ago
How is it different from the detected document in the scanner page? Could you show me some screenshots?
I see. The image taken by the vision camera is rotated. It is strange that it does not happen on my device.
Is the image rotated at this stage where there are two buttons below?
Yes that's correct.
It is rotated? Could you share a screenshot?
If it is rotated, I will try to fix this by checking the image's orientation and rotating it if needed.
Thanks for the video. By the way, what is your device model?
OnePlus 8, model: IN2017
Could you paste the photo info in the metro's log here?
You can find a log like this:
{"height": 2610, "isRawPhoto": false, "metadata": {"Orientation": 0, "{Exif}": {"ApertureValue": 2, "BrightnessValue": 0, "ColorSpace": 1, "DateTimeDigitized": "2022:12:02 10:40:34", "DateTimeOriginal": "2022:12:02 10:40:34", "ExifVersion": "0220", "ExposureBiasValue": 0, "ExposureMode": 0, "ExposureProgram": 0, "ExposureTime": 0.04, "FNumber": 2, "Flash": 16, "FocalLenIn35mmFilm": 0, "FocalLength": 4.26, "ISOSpeedRatings": [Array], "LensMake": null, "LensModel": null, "LensSpecification": [Array], "MeteringMode": 0, "OffsetTime": null, "OffsetTimeDigitized": null, "OffsetTimeOriginal": null, "PixelXDimension": 4640, "PixelYDimension": 2610, "SceneType": 1, "SensingMethod": 0, "ShutterSpeedValue": 4.643, "SubjectArea": [Array], "SubsecTimeDigitized": "305421", "SubsecTimeOriginal": "305421", "WhiteBalance": 0}, "{TIFF}": {"DateTime": "2022:12:02 10:40:34", "Make": "OnePlus", "Model": "ONEPLUS A3010", "ResolutionUnit": 2, "Software": "OnePlus3-user 9 PKQ1.181203.001 1906222331 release-keys", "XResolution": 72, "YResolution": 72}}, "path": "/data/user/0/com.documentscanner/cache/mrousavy4993141523157599810.jpg", "width": 4640}
{"height": 2250, "isRawPhoto": false, "metadata": {"Orientation": 6, "{Exif}": {"ApertureValue": 1.61, "BrightnessValue": -1.97, "ColorSpace": 1, "DateTimeDigitized": "2022:12:01 22:05:34", "DateTimeOriginal": "2022:12:01 22:05:34", "ExifVersion": "0220", "ExposureBiasValue": 0, "ExposureMode": 0, "ExposureProgram": 2, "ExposureTime": 0.04, "FNumber": 1.75, "Flash": 16, "FocalLenIn35mmFilm": 0, "FocalLength": 4.745, "ISOSpeedRatings": [Array], "LensMake": null, "LensModel": null, "LensSpecification": [Array], "MeteringMode": 2, "OffsetTime": null, "OffsetTimeDigitized": null, "OffsetTimeOriginal": null, "PixelXDimension": 4000, "PixelYDimension": 2250, "SceneType": 1, "SensingMethod": 0, "ShutterSpeedValue": 4.643, "SubjectArea": [Array], "SubsecTimeDigitized": "000890", "SubsecTimeOriginal": "000890", "WhiteBalance": 0}, "{TIFF}": {"DateTime": "2022:12:01 22:05:34", "Make": "OnePlus", "Model": "IN2017", "ResolutionUnit": 2, "Software": null, "XResolution": 72, "YResolution": 72}}, "path": "/data/user/0/com.documentscanner/cache/mrousavy7583408544107601380.jpg", "width": 4000}
I will try to update the plugin and the project to solve this problem.
I've added checking of the orientation. If the image is rotated by 90 degrees (the orientation is 6), then rotate it. Please try again if it works.
This causes the normalizeFile
function to return an Error: The quadrilateral is invalid
I see. I will update the demo to get the quadrilateral from the photo taken instead of the camera preview frames. It is a bit hard for me to test it as I don't have a device to reproduce the problem.
I've updated the demo. You could try again.
It's working now as expected. Thanks!
The normalized image displayed in the result view page does not match the detected document captured from the scanner. Any advice how to resolve? I'm running on an android 12 device.