Code Monkey home page Code Monkey logo

Comments (7)

borderlineinteractive avatar borderlineinteractive commented on June 13, 2024 1

from unityvision-ios.

adamhegedues avatar adamhegedues commented on June 13, 2024

Hi there,

It seems to me that the CVPixelBuffer ARKit exposes gets deallocated before it arrives to the native vision plugin. Remember, The Unity ARKit plugin has no idea that UnityVision is reading its image buffer, so if Unity made changes how and when the buffer for the front facing camera gets released, that may cause problems for UnityVision.

There are ways in UnityVision to allocate a buffer that it owns. In the ARKitExample, UnityVision steals the buffer reference from ARKit, because this way we save a copy. But in the webcam example, an independent metal texture is used for classification. Also, I have written a managed wrapper for CVPixelBuffer. You can check it out in the core video example.

I may implement a way to duplicate native CVPixelBuffers, so you don't have to rely on the WebCamTexture API when you also use ARKit. You would then just make a copy of ARKit's buffer and its guaranteed that it won't get released before time. I just need to allocate some time for this. Meanwhile, you can use a webcam texture.

Please keep me updated!

from unityvision-ios.

borderlineinteractive avatar borderlineinteractive commented on June 13, 2024

from unityvision-ios.

borderlineinteractive avatar borderlineinteractive commented on June 13, 2024

from unityvision-ios.

adamhegedues avatar adamhegedues commented on June 13, 2024

Hi Leif,

I added a new example for ARKit. I hope this approach solves your problem.
It uses the texture that Unity's ARKit plugin generates from the capturedImage (CVPixelBuffer) of the current ARFrame. I want you to try this first before having to create a deep copy of the pixel buffer every frame in your client application.

You can find it in ARKitExample2.cs. Try it out and let me know if it works for you.

Best regards,
Adam

from unityvision-ios.

Ilesh avatar Ilesh commented on June 13, 2024

Hi Adam,

I am working on the measurement application like the apple's Measure App. I have tried with ARKit but not getting any satisfying result. After looking at your demo I think it's useful for my application. Please find below link for my requirements.

Edge-detection-corner-detection-in-AR

I am waiting for your acknowledgement.

Thanks and regards,
Ilesh

from unityvision-ios.

adamhegedues avatar adamhegedues commented on June 13, 2024

Hi Ilesh,

This plugin features rectangle detection which only gives you results reliably if a rectangular object is visible in full. You can try implementing your app with the current state of the plugin, but I don't guarantee anything. Also, since you don't need image classification, you'll probably need to strip out that feature from the plugin because the mlmodel is over a 100 MBs.

If I were you I'd probably look for a native edge detection solution for iOS and use this plugin as an example how to integrate it with Unity.

Best regards,
Adam

from unityvision-ios.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.