Log in or register to post comments

How to make a 3D cube to map precisely on a real box?

August 15, 2016 - 2:44am #1

Hi everyone,

I try to make a 3D cube to map it on a real world box. It worked on PC in Unity Editor, but failed on an Android device, Xperia Z5 Premium.

https://www.youtube.com/watch?v=n7meX6L4l1o shows a transparency box that can match the black box, but the box in https://www.youtube.com/watch?v=7s7IlNgEE7g (from Android) can't do that.

I didn't know why, I didn't change any setting before I deploy to Android device.

Can somebody tell me the possible wrong setting or anything that can fix this problem?

Thanks.

How to make a 3D cube to map precisely on a real box?

September 18, 2016 - 7:49pm #21

medabit wrote:



I don't recall us discussing a connection between your augmentation offset and the use depth mask effect.



No, we didn't discuss depth mask effect before.

But what I want to do is to make a cube applying a depth mask shader to mimic a real box covering a 3D model behind it.

So I need it to be shaped accurately with the black box shown in the video. >_<

medabit wrote:



...unless you are transforming that pose in some way.



I didn't transform the pose and I even didn't know how to do that. :P

medabit wrote:



I'm glad to hear that the issue was resolved with my patch, but it still does not explain the root cause.



Yes, it's also what I care. I hope our app is not device-dependency.

medabit wrote:



...Can you try on others to see if they work correctly?



I borrowed a Nexus 7 from one of my colleagues and it worked properly.

We couldn't believe that we have two bad devices, Xperia Z5 Premium and Galaxy S6 edge,

but we don't know how to explain that also.

I think maybe we should stop this issue first until we have more devices to test.

I will report our finding if we have further information.

Sorry it took so much of your time.

Thanks

How to make a 3D cube to map precisely on a real box?

September 13, 2016 - 12:49pm #20

Hello,

I don't recall us discussing a connection between your augmentation offset and the use depth mask effect. There really should be no relationship between them as the augmentation's position is driven by the pose returned by the SDK - unless you are transforming that pose in some way.

I'm glad to hear that the issue was resolved with my patch, but it still does not explain the root cause. The patch was a device specific calibration file.

As your device was originally using default calibration values, I tried again to recreate the problem on a device that also uses default values (i.e. it is not patched). Unfortunately, I was still not able to recreate the issue even using this device.

Perhaps you were just unlucky enough to choose two bad devices? Can you try on others to see if they work correctly? I keep coming back to this not being an SDK issue. Consider your experience using Play Mode in the Unity Editor. If it was a Vuforia tracking issue, then the offset would also manifest itself there as they use the exact same engine.

Thanks

 

 

 

How to make a 3D cube to map precisely on a real box?

September 10, 2016 - 1:48am #19

Hi medabit,

Good News! It's working today and its result very close to what I see on PC.

And I'm very very sorry, it's my fault to take wrong device, Xperia Z5 Premium, to run your procedure yesterday.

Although the problem on Galaxy S6 edge has been resolved, but it's still not worked on Xperia Z5 Premium.

So if I want to apply the depth mask effect in my scene, it will not work properly on all devices if they have no correct calibration values, right?

Do you have any suggestion?

Thanks

How to make a 3D cube to map precisely on a real box?

September 9, 2016 - 11:29am #18

Hello,

You should be able to verify that the patch is applied by reviewing the Camera Device Mode resolutions for MODE_DEFAULT, MODE_OPTIMIZE_SPEED and MODE_OPTIMIZE_QUALITY. If they all return 720x480 @ 30fps, then the patch was applied. If MODE_OPTIMIZE_QUALITY returns 1280x720 @ 30fps, then the patch was not applied.

https://library.vuforia.com/sites/default/api/unity/classVuforia_1_1CameraDevice.html#a0c8d2f16997e32d116a5873436ecb326

Thanks

How to make a 3D cube to map precisely on a real box?

September 8, 2016 - 7:00pm #17

medabit wrote:

I have uploaded patch for SM-G9250. It will be applied after performing the following:

Hi medabit,

Where is the patch you mentioned?

I follow your procedure to test but I can't see any change.

If the patch will be automatically updated by connecting to internet while app is running,

how could I know the patch has been successfully installed?

Thanks :D

How to make a 3D cube to map precisely on a real box?

September 8, 2016 - 2:46pm #16

Hello,

I have uploaded patch for SM-G9250. It will be applied after performing the following:

  1.  Make sure that the device's Wifi is enabled and can connect to the Internet
  2.  Uninstall your test app with Vuforia integrated
  3.  Reinstall the same test app
  4.  Start the same test app and let it run in idle state for 30 seconds
  5.  Stop the same test app
  6.  Restart the same test app

This patch is only valid for Vuforia 5.0 and later. Note that this update will only persist for as long as that version of the test app is installed. Reinstallation *may* over-write the patch. If so, you'll then need to redo the steps above.

Beyond this, I'm truly out of ideas since I cannot reproduce.

Thanks


How to make a 3D cube to map precisely on a real box?

September 7, 2016 - 6:32pm #15

Hi medabit,

Do you have any further ideas about this issue?

Thanks.

How to make a 3D cube to map precisely on a real box?

August 23, 2016 - 7:03pm #14

Hi medabit,

The Model Number of my device is SM-G9250.

And you are right, FOV is the abbreviation of Field Of View.

I displayed two kind of fov.

One is from 3D Camera attached under ARCamera and the other is from Device Camera.

I get 3D Camera fov by reading Camera.fieldOfView property.

And Device Camera fov is read by calling CameraDevice.Instance.GetCameraFieldOfViewRads().

You can find how I do that in Temp_DisplayCameraFOV.cs (Temp_DisplayCameraFOV.Update()).

Hope the information is helpful.

Thanks.

How to make a 3D cube to map precisely on a real box?

August 23, 2016 - 10:40am #13

coldstar wrote:

I found we have different arguments shown on screen.

The only same thing is Screen resolution (2560x1440).

Correct. This is the native display resolution of the device. Since both our devices are GS6 Edge, this should be the same.

Can you also please provide me with the Model number of the device? Go to Settings->About device and scroll a bit down. It should be similar to "SM-G925[A-Z]".

coldstar wrote:

All the other parameters are different, like 3D camera fov(36.81256 vs 35.79205), device camera fov((61.21745, 36.81256) vs (59.82591, 41.86714)), and video mode ((30fps, 1280x720) vs (30fps, 720x480)).

Do you think if these different parameters make our results not the same?

I'm not familiar with the fov parameters (assuming this stands for 'field of view'). What APIs are you using to query these values?

The video mode is one that is set by Vuforia. This represents the camera resolution and frame rate settings, which can be configured for each device model number. Your values look to be the default ones (where there is no device specific configuration), which means the device you are using is missing this configuration file. This is not unusual as Samsung has 20+ model numbers per device name. It is also why I asked for the exact model number of the device you're using.

coldstar wrote:

I found Vuforia provided a file, profiles.xml, for adding a new webcam profile in Unity Editor.

Should I do the same thing to calibrate the camera on Mobile device?

If so, is there a way to do that?

Unfortunately, Vuforia 6 does not currently provide APIs for setting the device camera calibration values as it does for webcam profiles.

Thanks

 

How to make a 3D cube to map precisely on a real box?

August 22, 2016 - 6:49pm #12

Hi medabit,

I found we have different arguments shown on screen.

The only same thing is Screen resolution (2560x1440).

All the other parameters are different, like 3D camera fov(36.81256 vs 35.79205), device camera fov((61.21745, 36.81256) vs (59.82591, 41.86714)), and video mode ((30fps, 1280x720) vs (30fps, 720x480)).

Do you think if these different parameters make our results not the same?

I found Vuforia provided a file, profiles.xml, for adding a new webcam profile in Unity Editor.

Should I do the same thing to calibrate the camera on Mobile device?

If so, is there a way to do that?

Thanks.

How to make a 3D cube to map precisely on a real box?

August 22, 2016 - 4:57pm #11

Hello,

I tried again and still was not able to reproduce the issue using the Unity project you provided. The video shows that although the size and placement of the augmentation are not 100% accurate, you can see from the gridded cuboid there is no skewing of the position.

https://www.dropbox.com/s/fmy13jx4y8mqpwh/cuboid_overlay_Samsung_GS6_Edge_gridded-target.mp4?dl=0

Thanks


How to make a 3D cube to map precisely on a real box?

August 19, 2016 - 8:31pm #10

> Can you confirm that?

Yes.

You can see the video in https://youtu.be/hhOmjbhBioY and check it in the attached project (Assets\0_Mine\Test_Stone_24.8.unity).

But the unit in Unity is measured by a meter, so my width setting for Image Target is 0.247 in the inspector.

I printed three different sizes of Target (74mm, 124mm, 247mm), and created three scenes according to these targets.

They all run perfectly on a PC with a webcam, but not good on the Galaxy S6 edge.

Do you notice the information displayed in the lower left corner of the video?

Is it ok if the screen size (2560x1440) and the video resolution(1280x720) are different?

Thanks.

 

How to make a 3D cube to map precisely on a real box?

August 19, 2016 - 3:29pm #9

Hello,

One very important point I overlooked was that the target must be printed to match the size specified in the inspector to the mm. For stones, the target must be 247mm wide and 172.9 (almost 173)mm high.

It is a common mistake when printing targets for Vuforia targets to not print at the exact aspect ratio and size. Can you confirm that?

Thanks.

How to make a 3D cube to map precisely on a real box?

August 19, 2016 - 2:58am #8

Hi medabit,

Unfortunately, my findings are not good for me.

I updated my Galaxy S6 edge and printed three Stones target with different size.

Below are my recorded videos:

Target Width 07.4: https://youtu.be/UZcM9aHgq3g

Target Width 12.4: https://youtu.be/8m7j1BuN1WQ

Target Width 24.7: https://youtu.be/hhOmjbhBioY

The argumentation is always bigger than the real box.

I also display screen resolution, camera fov, camera device fov, and video mode data on screen.

I found screen resolution is not the same with the video resolution.

Do you think if it will cause the problem?

I also upload my project, hope that is helpful.

Thanks.

AttachmentSize
Package icon UAR_FOV.zip79.72 MB

How to make a 3D cube to map precisely on a real box?

August 18, 2016 - 8:12pm #7

Hi medabit,

I noticed that you also use Galaxy S6 edge to test the scenario, but I found your mock no problem.

I fear that maybe there is something I did wrong, so first I quickly create a whole new Unity project, import the latest Vuforia 6 SDK, and create a simple scene.

It's still ok on PC with a webcam, but failed on Galaxy S6 edge. >_<

What I will try next:

1. Update Galaxy S6 edge.

2. Print Stones target.

I will report my findings.

Thanks.

How to make a 3D cube to map precisely on a real box?

August 18, 2016 - 7:46am #6

Hello,

I did a mock of your scenario and was not able to recreate the issue. I ran it on 3 different devices: Galaxy S6 Edge (don't have the S7 Edge), Nexus 5 and HTC One M9:

https://www.dropbox.com/s/8j1okx5co91j1si/cuboid_overlay_HTC_One_M9.mp4?dl=0

https://www.dropbox.com/s/77k82cqr88mkmi7/cuboid_overlay_Nexus_5.mp4?dl=0

https://www.dropbox.com/s/j4movxasbrangn2/cuboid_overlay_Samsung_GS6_Edge.mp4?dl=0

I basically achieved what you demonstrated with your webcam but on my mobile devices - good, but not perfect, registration of the augmentation over the box.

I can only think of a couple of possibilities:

  1. The offset augmentation (one that is not registered to the target) is being affected by the camera's intrinsics (e.g. radial distortion). However, this seems unlikely if you are seeing the same problem on two devices from different OEMs
  2. The quality of the target.

Thus, I would suggest two simple experiments:

  1. With your existing project, swap out your target for our Stones target. This may help to eliminate the possibility of it being #2 above.
  2. Try moving the cuboid augmentation to be closer to the center of the target and see if the skewing of the augmentation persists.

Thanks

How to make a 3D cube to map precisely on a real box?

August 16, 2016 - 6:34pm #5

It's Image Target.

The photo placed on the table is the target, not the black box.

Maybe the video below can see more clear.

https://www.youtube.com/watch?v=n7meX6L4l1o

Thanks.

How to make a 3D cube to map precisely on a real box?

August 16, 2016 - 7:32am #4

Hello,

What target type is this? Object Target? Cuboid?

Thanks.

How to make a 3D cube to map precisely on a real box?

August 15, 2016 - 6:42pm #3

I don't have iOS device, but I'v tried it also on SAMSUNG Galaxy S6 edge.

And it has the same problem.

It looks like that the 3D transparency cube is always bigger than the real box, I think fov may be the key, but I couldn't find a way to adjust the fov of the camera that is controlled by ARCamera.

Thanks.

How to make a 3D cube to map precisely on a real box?

August 15, 2016 - 11:30am #2

Hello,

Do you see a similar offset with other devices, as well? Have you tried an iOS device?

Thanks.

Log in or register to post comments