HMS-Core / hms-AREngine-demo

Huawei AREngine kit sample code demonstrates how to use Huawei AR functions, including motion tracking, plane detection, face recognition and gesture recognition, etc.
Apache License 2.0
102 stars 46 forks source link

Cannot change the preview size ARConfigBase.setPreviewSize(w,h) #7

Closed remmel closed 4 years ago

remmel commented 4 years ago

According to 2.13 release note, the ARConfigBase.setPreviewSize(w,h) should now work, but I cannot make it work. Size & image provided by ArCameraIntrinsics.getImageDimensions(); and ArFrame.acquirePreviewImage().getWidth() is always 1080x1440 (tested on Honor View 20 + Huawei P20 Pro)

Code : Github hms-AREngine-demo fork

Something else related, is the order width,height it not coherant with ArCameraIntrinsics.getImageDimensions(); //[1080,1440] as it returns [height,width] but ARConfigBase.setPreviewSize(width,height)

Mike-mei commented 4 years ago

@remmel

  1. The ARConfigBase.setPreviewSize(w,h) function isn't supported on the EMUI 9.x phone, this function will be available on EMUI 10.x phone in later versions
  2. The first value returned means the long side, the second value returns means the short side.
remmel commented 4 years ago

Hi,

  1. but both of thoses phones have EMUI 10
    • Honor 20 View : 10.1.0.231
    • Huawei P20 Pro : 10.0.0.171
Mike-mei commented 4 years ago

The ARConfigBase.setPreviewSize(w,h) function will be supported on EMUI 10 phones in the 5.0.5 version, we will let you know when the new version released.

remmel commented 3 years ago

@Mike-mei , I confirm that this is now working :) Checked with Honor 20 View (10.1.0.237) /Resolution checked (3264,2448) / com.huawei.hms:arenginesdk:2.15.0.1 Thanks !

remmel commented 3 years ago

I tried multiple resolutions on my Honor 20 View: the documentation is missing some resolutions and others which are in the doc, but not working.

Can you update the doc with the new resolutions?

Mike-mei commented 3 years ago

Thank you for your suggestion, we will optimize the description in the documentation in next week

remmel commented 3 years ago

Thanks! Thanks to your snippet, I found a larger resolution (tested) : 3968x2976