Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Only detects each image one time #19

Open
hohler opened this issue Apr 26, 2024 · 1 comment
Open

[iOS] Only detects each image one time #19

hohler opened this issue Apr 26, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@hohler
Copy link

hohler commented Apr 26, 2024

Hello Miquido Team

I noticed that with multiple images, every image is only detected once.

Example: I have 2 images

  1. recognize first image
  2. recognize second image
  3. try to recognize first image - it will not recognize it
  4. recognize second image - works

I found a easy fix, maybe this is already the right way.

Replace

class ARQuidoViewController: UIViewController {
...
     if let nodeToRemove = detectedImageNode {
          nodeToRemove.removeFromParentNode()
     }
...
}

with

private var lastImageAnchor: ARImageAnchor?
...
class ARQuidoViewController: UIViewController {
...
       if let nodeToRemove = detectedImageNode {
            nodeToRemove.removeFromParentNode()
            if (lastImageAnchor != nil) {
                sceneView.session.remove(anchor: lastImageAnchor!)
            }
        }
...
}
@PiotrMitkowski
Copy link
Collaborator

Hello @hohler!

Looks good - would you mind creating a PR for it?

@PiotrMitkowski PiotrMitkowski self-assigned this Apr 29, 2024
@PiotrMitkowski PiotrMitkowski added the bug Something isn't working label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants