Realtime_MiDaS_Depth_Estimation_Android icon indicating copy to clipboard operation
Realtime_MiDaS_Depth_Estimation_Android copied to clipboard

Aspect Ratio Issue to be fixed

Open kimjeonghyon opened this issue 4 years ago • 2 comments

Thank you for sharing this amazing source codes for mordern android app development. I have found a bug. My smart phone is LG V50 thinkq. Screen size in Logcat shows 1440x3030. but iamage from FrameAnalyser shows 720 x 1440 and image in drawOverlay got crushed.

below code is fix of the issue.

preview = Preview.Builder() .setTargetAspectRatio(AspectRatio.RATIO_4_3) .build()

In mainactivity oncreate method: frameAnalysis = ImageAnalysis.Builder() // .setTargetResolution( screenSize ) .setTargetAspectRatio(AspectRatio.RATIO_4_3) .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) .build()

kimjeonghyon avatar Apr 07 '22 06:04 kimjeonghyon

@kimjeonghyon Yeah, that's a problem. But then there's a aspect-ratio mismatch when we are drawing the depth map ( 4:3 ) on the screen ( the aspect ratio being 16:9 ).

shubham0204 avatar Apr 07 '22 11:04 shubham0204

@shubham0204 Can we generate .ply file from depth image ? Can you please help on this how can we do that

JayeshParkariya avatar Mar 14 '23 14:03 JayeshParkariya