viro icon indicating copy to clipboard operation
viro copied to clipboard

Loading multiple ViroARImageMarker without blocking the UI

Open gbalduzzi opened this issue 4 years ago • 5 comments

Environment

  1. Development OS: Mac
  2. Device OS & Version: iOS 13
  3. Version: ViroReact 2.17.4, React Native 0.62.2
  4. Device(s): iPhone 7 Plus

Description

I need to track multiple images using ViroARImageMarker. The only problem I have is that when I mount Viro with all my ViroARImageMarker components, the UI freezes for 1-2 seconds. It seems like all the loading is done on the UIThread.

The 1-2 seconds loading time is not an issue for me, but the UI freezed is. Is there a way to move the ViroARImageMarker loading away from the UIThread?

Reproducible Demo

Just create a ViroArScene with 20-30 ViroARImageMarker

gbalduzzi avatar Jul 09 '20 10:07 gbalduzzi

hi @gbalduzzi Have you solved this problem yet

tnghia944 avatar Oct 18 '20 09:10 tnghia944

I noticed also there is an issue that it consumes a lot of device power when rendering multiple markers.

rgouzal avatar Oct 18 '20 11:10 rgouzal

No, I have not solved it yet. I mitigated the problem by:

  • Lowering the targets resolution and size (it probably is a best practice anyway to use low-resolution targets). My original targets photos were 2500x1400 and I compressed them to 500x280 jpg with 70 compression quality. The targets were still identified pretty easily

  • Rendering an empty scene initially and only adding the image markers in a second step. This way the markers loading do not interfere with the screen presentation and the UI freezing is way less noticeable

gbalduzzi avatar Oct 19 '20 09:10 gbalduzzi

hi @gbalduzzi do you know how to check target center in image center in a rectangle

cenaHara avatar Oct 19 '20 09:10 cenaHara

hi @gbalduzzi, I have this issue when use multiples targets (If i find target 1 then find target 2 I can't find target 1 again), https://github.com/ViroCommunity/viro/issues/160. Do you have it too? or is something on my code. Thanks.

leandro2219 avatar Oct 13 '22 17:10 leandro2219