Log in or register to post comments

HoloLens Model Targets

January 10, 2018 - 12:08am #1

Hello,

I have been developing/playing a bit with Vuforia Model Targets and HoloLens. So I am using Unity 2017.3.03f personal and Vuforia 7

But now I ran into a problem and I can't figure out what is going wrong.

So the problem is that when my model target get recognized, the content I placed in the unity scene get placed on the camera position instead of the target position in the 'real world'. 

Does anyone have been using Model Targets on HoloLens and got it working?

 

Jari

HoloLens Model Targets

February 13, 2018 - 11:27am #20

Jari333 wrote:

Yes of course,

I can't really make accurate pictures at the moment. This is as best as I could get them.

Sometimes it recognizes like random in air, especially when it is the first time you start up the model target dataset, kinda weird. But like I said, I noticed I get very different results if you look at it further away or from different angle. I suggest you should try to do the same and look what happens.

Like it is very annoying that the placement get all weird, just because the software recognizes the object from a different position than the detection position.

Hello Jari333,

The geometry of your target (a computer monitor) is very simple and the Model Target detection will not be reliable. Due to this you will likely encounter such false positives. It is recommended to use more complex models than this for optimal results.

Thanks,

Vuforia Support

HoloLens Model Targets

January 31, 2018 - 11:31pm #19

Looks fine to me though.

Could you perhaps also share how the guideview looks like on the HoloLens and the target?

Maybe check your player settings again to see if everything is fine. Have you ran the application in debug mode? Did you get any errors?

HoloLens Model Targets

January 31, 2018 - 10:07pm #18

Hi Jari333,

I am using MixRealityToolkit Beta of unity 2017.3 and Vuforia, both are working together for me.But my Guide View is not showing constantly its disappears somewhere.

Can anybody help on the same?

Please find attached screenshot of my unity scene.

 

 

Thanks,

Sneha

AttachmentSize
Image icon Capture.PNG28.6 KB
Image icon Capture01.PNG61.58 KB

HoloLens Model Targets

January 31, 2018 - 4:58am #17

I made a completely new project and installed the BETA Toolkit. I used another version first, can't remember exactly which one, but I think it was the one for 2017.2 beta.

At first I noticed that the physical Lenght/Width/Height were like way too big. The ModelTargetBehaviour script said it was like 584200 meters long, but it should have been 0.584200 meters. So first I changed the size of the target till it matched the physical boundaries. (see screenshots)

However, now I haven't done that, I get better results. Still not perfect, but actually usable.So that might have helped as well.

Anyways thanks for your help. Except, I still have this one thing: the rotation keeps getting weird if you look at a different angle than the detection position I found out. Could you please test this and share your results? It might be possible that Vuforia has a hard time with my target.

HoloLens Model Targets

January 30, 2018 - 2:36am #16

As I said in my previous message I'm using MixedRealityToolkit (new name for HoloToolkit).

1) Download the MixedRealityToolkit BETA update for Unity 2017.3 (source code can be found here) and add it to your project.

2) Delete the Vuforia ARCamera gameobject (if you have one)

3) Set up your project using MRTK.

4) Add the Vuforia Behaviour (Script) to the MixedRealityCamera (gameobject with a Camera component added when you've set up the project with MRTK)

5) Maybe I'm forgetting something but I think that's it and you can deploy (use the Build Window of the MRTK to build !! )

 

Pierre

HoloLens Model Targets

January 30, 2018 - 1:12am #15

Okay, that is kinda weird. My offsets are indeed bigger than yours, but sometimes I do get good results.

However, I guess it is positive to hear that it works better for you!

But yes I have some weird false positive going on. Everything in the editor looks fine and works like how it is intended to work. Are you using the HoloToolkit as well? Is it possible that it and vuforia don't work together well? 

Can you perhaps share your unity scene settings?

HoloLens Model Targets

January 30, 2018 - 12:57am #14

Hi,

I am also working with hololens.

The detection is working fine but the position of the object is not perfect.

@Jari333 i tried your suggestion to make the position accurate but in my case its not working and my object is not getting lost even if my tracking is lost, it is still showing 3D Object.

Can anyone help me on the same.

 

Regards,

Sneha

HoloLens Model Targets

January 29, 2018 - 5:02am #13

Indeed my detection is far better than yours. For me, it's a matter of max 20 centimeters error for translation and max 20° degree error for rotation (but most of the time it's <10 cm and 10° for a target that is 1.2 meters tall)

It seems that you're having weird false positive (see this post).

Is it doing the same in Unity Editor and in the Hololens?

 

Pierre

HoloLens Model Targets

January 29, 2018 - 4:38am #12

Yes of course,

I can't really make accurate pictures at the moment. This is as best as I could get them.

Sometimes it recognizes like random in air, especially when it is the first time you start up the model target dataset, kinda weird. But like I said, I noticed I get very different results if you look at it further away or from different angle. I suggest you should try to do the same and look what happens.

Like it is very annoying that the placement get all weird, just because the software recognizes the object from a different position than the detection position.

AttachmentSize
Image icon FailRecog.PNG564.81 KB
Image icon FailRecog2.png2.65 MB
Image icon FailRecog3.PNG632.37 KB

HoloLens Model Targets

January 29, 2018 - 1:43am #11

The positioning isn't perfect but most of the time it's quite good.

Maybe try to take some pictures of the offset you're talking about, that way we can compare more accurately our results...

 

Pierre

HoloLens Model Targets

January 26, 2018 - 4:53am #10

Hi,

Thank you for your respond.

 

However, I am not sure what you mean... I am be able to recognize some model targets, that part is working quite well I guess.

But the results are not consistent enough. Like I want to place virtual objects around the target. For example a bit of an overlay explaining different parts. But the overlay don't match the real target. It has an offset. This offset isn't consistent, so "placing content around the target" is completely useless. This offset is depends on multiple factors, like different position and/or angle. Most of the time the rotation of the virtual objects doesn't even come close to matching the real target rotation.

Have you tried placing virtual objects around your target? And did it get placed at the same/right position all the time?

HoloLens Model Targets

January 26, 2018 - 1:40am #9

Hi,

I'm also working with the Hololens.

It's working fine with me (except for this false positive bug).

What I did was to test the tracking was working within the editor first. When all was set up correctly and I was sure my detection worked fine in the editor I downloaded the MixedRealityToolkit BETA update for Unity 2017.3 (source code can be found here).

Then you set up your project with MRTK, make sure you configured Vuforia for Hololens, test you app a last time in the editor and build the solution with MRTK, then you open the solution with Visual Studio and deploy to Hololens.

 

Let us know if this was of any help,

Pierre

HoloLens Model Targets

January 26, 2018 - 12:56am #8

I kinda gave up on it to be honest. I couldn't get constant results.

Like sometimes it worked okay/not bad and sometimes it would be completely random. Especially if you look at a different angle than the detectionposition.

Maybe my test environment isn't good enough, but I have no idea really.

 

However, could you perhaps share your target, model and detection position?

HoloLens Model Targets

January 25, 2018 - 2:12pm #7

I've got it working on the HoloLens with 2017.3 and Vuforia 7.0.36

Performance is much worse than on mobile but I can get consistent tracking with good lighting and strong contrast.

HoloLens Model Targets

January 16, 2018 - 4:32am #6

So after a bit more testing I found some interesting results...

My hypothesis is that Model Targets get placed in the scene based on the rotation and position/distance you had to fill in for the 'detection position' in the Model Target Generator tool (MTG). However it is possible and most likely that Vuforia recognizes the target with a different rotation and distance you had to use for the detection position. 

If that happens, the position of the Model Target GameObject and the content, children, will get placed totally wrong in the scene. Like it looks like they use the rotation and distance in the MTG to calculate the world coordinates of the Model Target somehow...

But at the same time I can be completely wrong. Anyway I'll make a setup where I can test my hypothesis and I'll let you know if I have any results.

HoloLens Model Targets

January 11, 2018 - 7:21am #5

Yea it looks like we have to wait for an official update I think.

I haven't really tested it enough, but I noticed it can produce some very inaccurate results. This is because the RayCast doesn't always recognize the table my target is on, so I wouldn't recommend doing that. However I noticed you can use the (2D) guideview instead. You can get the guideview object by using FindObjectOfType<GuideView2DBehaviour>(). When the event of the target is found is fired, I read the position of this object and use the position to place the content on it. This is more accurate than the other solution. It is really hard to say how inaccurate it is, but I would say like 10% in my case.

One more thing: I tried to change the ModelTarget position through code, but I noticed the position will change back to the camera position or something. I don't really understand how or why, but it is very strange. I fixed this by making an empty GameObject and placed it on the GuideView position I explained above. Then I move the children, content, of the ModelTarget to this new GameObject...

 

HoloLens Model Targets

January 11, 2018 - 6:42am #4

(Fixed the tracker issue)

Did some more digging and found this post of an official: https://developer.vuforia.com/forum/hololens/hololens-and-unity-version

Seems like we might just need to wait.

Yeah I was thinking about doing the placement myself, but I do want an accurate placement as well. How inaccurate is your method if I may ask?

 

HoloLens Model Targets

January 11, 2018 - 5:08am #3

As far as I can tell that last link is about optimal devices. It doesn't say it won't work on the HoloLens or other devices that meet the requirements. Although my problem could be caused, because it isn't an optimal device. I don't really know.

I do get the "Failed to get spatial stage statics" error as well, but not always. My tracker does get initialized though, maybe check your settings once again...

I kinda hotfixed it, by placing the content based on a RayCast instead of the model target, but that isn't accurate enough.

HoloLens Model Targets

January 11, 2018 - 4:30am #2

Hey Jari,

 

I have tried it, too, but couldn't get it to work on my Hololens, while it was working fine in the editor.

(From Output: "Could not initialize the tracker." & "Failed to get spatial stage statics - can't retrieve or interact with boundaries! Error code: '0x80040154'." Do you have similar errors?)

I'm actually not sure if it's supposed to be working, the doc here says that the Hololens is supported:

https://library.vuforia.com/articles/Solution/model-targets-user-guide.html#supported-platforms

But when I follow the link it doesn't list the Hololens as a supported UWP device:

https://library.vuforia.com/articles/Solution/model-target-supported-devices.html

 

Would be nice to get an answer from a mod. :)

 

Log in or register to post comments