1

I am trying to detect an image with my app. I added this one to my ARResources Assests:

enter image description here

It is a JPG with a white background.

But XCode is complaining when I try to scan it with this error:

Error Domain=com.apple.arkit.error Code=300 "Invalid reference image." UserInfo={NSLocalizedFailureReason=One or more reference images have insufficient texture: Group (3), NSLocalizedRecoverySuggestion=One or more images lack sufficient texture and contrast for accurate detection. Image detection works best when an image contains multiple high-contrast regions distributed across its extent., ARErrorItems=( "Group (3)" ), NSLocalizedDescription=Invalid reference image.}

I don't quite get it. Why can it not detect my image? What do I have to change? I already set the width and height in the inspector and made sure the image has high resolution (4096x2731)

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Chris
  • 1,828
  • 6
  • 40
  • 108

1 Answers1

0

ARKit's AI sees images in black-and-white spectrum, so the main idea behind image detection is rather a rich number of visual details (massive white BG area isn't a good idea, as well as repetitive texture pattern), high contrast, well-lit surrounding environment, calibrated screen (no bluish or yellowish tint). Also, there's no need to use Hi-Rez pictures for image detection – even 400-pixels-wide picture is enough.

Apple's recommendations can give you some additional info on this topic.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • 1
    Thanks for your help. I thought the icon is quite easy to detect but it is quite hard:/ is there a way to train the image detection ? – Chris Apr 02 '22 at 12:03
  • 1
    Also best case would be if it is just detecting the „W“ , also without a background – Chris Apr 02 '22 at 12:07
  • It's hard to say - you have to try. Try to make several versions of this logo in different color combinations, high contrast and low contrast images, on different BG. At least 10. So that AI has plenty to choose from... – Andy Jazz Apr 02 '22 at 12:07
  • But how would I add AI to that project ? Never done anything with it.. – Chris Apr 02 '22 at 12:09
  • import Vision. And then train `.mlmodel` using Xcode's `Create ML.app` or Xcode's Playground. – https://developer.apple.com/documentation/vision/training_a_create_ml_model_to_classify_flowers – Andy Jazz Apr 02 '22 at 12:15
  • But how do I combine that with my project now ? – Chris Apr 02 '22 at 17:09
  • This is a completely different question. Post it. There are many developers who can answer it... – Andy Jazz Apr 02 '22 at 17:12