- Sort Posts
- 42 replies
- Last post
Image Target
Hi
I read your posts . but could u still help me ? :(
I was making an Ar . with unity and vuforia . for android .
the app is complete. but when I put the phone over the target image , the 3d abj wont show up .
I think I have a problem with the width of the target image . is it in mm ? or ...?
there is no place for choosing between cm ,mm or ... should I write them my self ? (width : 20 mm [?] )
my real target image ( printed in paper ) is 2(cm) x 2(cm) my 3d obj is a watch .
and I want to put the target over my hand .
what is a right width in here ? 20 ? 2 ? 200 ? or ...( should I write mm or cm next to them ? )
and since my 3d model is a watch , it will cover the whole target image .
it wont coz any problems right ? or it will ? coz technically my ar camera wont be able to see the target image .
(coz its cover by the 3d obj )
it was my first time making an AR ... sorry for my Question :(
... thanks.
Image Target
No.. what I mean is that the size that you assign to your target in the Target Manager will be considered by Vuforia as the 3D size of your target, so if you set it big, when you put the marker in front of your camera, Vuforia will estimate the distance of it from the camera, and to do such estimatiuon it will use the given target width.
Imagine for instance that your target is 50 cm wide; suppose you assign a value of 50 in the TMS, then imagine you put your printed target in front of the camera, so that it is at about 50 cm distance from the device camera... Vuforia will detect the target and will assign a distance to the target (as part of the calculated Pose)... such distance (if all goes well) should be a value of about 50.
Now, suppose you defined your target size in millimeter.... (just a different unit of measure); your target is still 50 cm, but in the Target Manager you would enter 500 (instead of 50), because 50 cm is = 500 millimeters.
Now, when you use such target (width = 500) in your App, putting the target in front of the camera, again at 50 cm away from the camera, Vuforia will see a target in the camera field of view, whose size is 500, so it will also estimate the distance = 500 (i.e. consistently with the target size.... in other words, now it is "as if" Vuforia was also using millimeters..... ).
So,
- target size = 50 => Vuforia distance = 50
- target size = 500 => Vuforia distance = 500
I hope this makes sense.
Image Target
Hi Alessandro,
Regarding:
"as Vuforia will also increase the distance at which your target is located in 3D space."
Does it mean you are refering to the minimum distance when the image target starting to be able to be recognised?
So in other words the maximum trackable distance depends on the physical/printed image target size, not depends on the 3D scene unit value that we enter in Target Manager, doesn't it?
Image Target
What is the better way to define the image target width size ?
I would say this is up to you; what I would typically do is to choose a unit of measure (e.g. cm, millim, meters, inches...) and have everthing in that same unit of measure (i.e. target size, 3D models, Unity scene) if possible. But the other options (e.g. rescaling the 3D model) are also fine.
My second question is regarding the maximum trackable distance:
If you increase the size of your target, the maximum distance will also increase, however you are not going to gain anything, as Vuforia will also increase the distance at which your target is located in 3D space.
Image Target
Hi there,
What is the better way to define the image target width size ?
- Is it better to start with putting a relative 3D scenes unit in Target Manager and then scaling up/down my augmented object/image size so it will cover the image target width nicely? (e.g. my printed image target is a label with the width of 60 mm, I put 60 as the width in Target Manager and then I scale up/down my augmented image)?......Or
- Is it just better to adjust the image target width size in Target Manager relative to the scenes unit of my augmented object/image? (e.g. I am using Cloud Recognition sample app for iOS and my augmented image is the view in targetOverlayView.xib which has the width of 252 defined in its Xcode Size inspector, so in this case I just put the image target width size in the Target Manager as 252)
My second question is regarding the maximum trackable distance:
Will the maximum trackable distance increase if I define the image target scenes unit in Target Manager as highest as possible? (Assume other factors are taken care, such as: ‘5 star rating’ image target, printed image target is placed in a good lighting condition, camera autofocus is on, relative size to the augmented object/image, etc.)
Image Target
Hi @AlessandroB,
Do you have any sample code or tutorials to show some text like "Please point the Camera device toward the Image target" in the camera scene when no image target pointed in the scene?
How to add that feature in ImageTargets sample app?
*I use Eclipse.
Image Target
Ok, then this means that the focus is (probably) not the limiting factor here. Maybe then try positioning the target at different locations in your room and if possible change the lighting conditions; note that you an also enable the Flash torch to see if it makes any difference.
Image Target
Ok.
To be sure, can you try with this small modification:
create your C# script, call it "Autofocus.cs and attach it to the ARCamera object
use this code:
public class Autofocus : MonoBehaviour {
private bool mEnableAutofocus = false;
// Use this for initialization
void Start () {
}
void OnGUI() {
if (GUI.Button(new Rect(50,50,200,50), "Enable continuous autofocus")) {
mEnableAutofocus = true;
}
}
// Update is called once per frame
void Update () {
if (mEnableAutofocus) {
bool success = CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
if (success) {
Debug.Log("Successfully set the continuous autofocus");
}
else {
Debug.Log("Unable to set the continuous autofocus");
}
mEnableAutofocus = false;
}
}
}
Image Target
Hi,
seems it's not working
code is like::
public class CameraDeviceMenu : MonoBehaviour {
// Use this for initialization
void Start () {
CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
}
// Update is called once per frame
void Update () {
}
}
Device: samsung Tab GT-N8000
Android Version: 4.1.2
Image Target
Hi, if the autofocus is enabled, you will see that the camera refocus automatically on the physical target when you move the device;
in practice you should notice that the camera image tends to be sharp in all circumstances (as you move the device); otherwise you would see a blurry image as you move the device closer or farther from the target
Image Target
Hi,
the Unity method to set the focus mode is:
CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
Have a look at the CameraDeviceMenu.cs script (which is attached to the ARCamera) in the ImageTargets sample, fo an example of how to use it.
Image Target
Image Target
Hi, the reason why there is no flickering when looking from the right side could be due to the lighting conditions (e.g. when looking from the left side perhaps the camera is seeing a sharper image, especially if there is some glossiness in the paper);
another reason could be in the fact that the printed target (i.e. the paper sheet) is not perfectly planar (as I seem to see in the video)..
I cannot figure out other reasons, but perhaps it might be worth trying with different setups (for instance in different rooms or putting the target on different walls of the same room)
Image Target
@AlessandroB.. thanx for info..
-But it's requirement of my app that model should be 3-4 time larger than target and to cover the whole model i have to go away approx (0.5 - 0.7 meter). that should be fine with image target of 15cm width.
- did you notice that there is no flickering from right side with same distance why??
Image Target
Hi sunilkm, thanks for the video, it clarifies a lot.
First:
the fact that the model is about 3 times larger than the target simply depends on the scale that you applied to your model (you can reduce the scale so to make it fit nicely on the target... every model needs to be scaled appropriately, there is no magic scale working for all models)
Second:
about the flickering: in the video the model seems to flicker when you move your device away, i.e. beyond a certain distance from the target; this could be an expected behaviour (i.e. tracking stability can be less robust at higher distances); however, make sure to enable the continuous autofocus mode (like in the ImageTargets sample), as this may help the camera to keep the optimal focus on the target (with potentially better tracking stabilty)
Image Target
Image Target
Hi,
you should check our developer guide, as these topics are covered;
you can also look at this article that I wrote:
https://developer.vuforia.com/forum/faq/android-how-do-i-replace-dataset-image-targets-sample
Image Target
Hi, @AlessandroB..
can you tell me where is the link of complete step by step tutorial for adding our image target database (.dat and .xml file) to ImageTargets sample app project please...
I created my image for target in Target Manager.. I have .dat and .xml file now.
Image Target
Image Target
Hi, when you look from a side direction (left or right), do you see the target from a very steep angle ? (i.e. is the target looking quite skewed from your point of view) ?
If yes, that could be the reason of the instability, which results in a wrong pose estimation (the target appears larger probably because the distance of the target to the camera is incorrectly estimated)
Image Target
so i have created 5 star rating target of width 15cm. But i got weird problem of movement of 3d model if you see from front side . There is stability of model, if you see from left or right side (distance is same and approx 0.5 meter). model is 3 times larger than target
what could be the reason ?
Image Target
Image Target
Thanks for quick reply. i tried with stone picture and i got 5 rating also but it tracks upto ~0.4-0.5 meter after that there is flickering problem.
last i have quick questions what is best width size (target dimension) for visiting card and here width means pixel ??
Image Target
It depends on the size of the visiting card; just as an approximative rule of thumb, the ratio between the max distance and the size of the visiting card can be around 10.
For instance, a 10 centimeters card might be detectable and trackable up to 1 meter or so.
Note that the rule above is just a broad rule of thumb, then for more accurate assessment, you need to test on the field (as the quality of the visiting card image, i.e. the "star rating", can also have a big impact)
See also:
https://developer.vuforia.com/resources/dev-guide/image-targets
https://developer.vuforia.com/resources/dev-guide/natural-features-and-rating
https://developer.vuforia.com/resources/dev-guide/image-target-enhancement-tricks
@summerfall,
The width of target image, which you need to specify in Target Manager is a 3D Scene unit, so you don't need to specify mm/cm. And in your case it is alright to specify 20 or 200, it doesn't matter. The above scene unit which you specify will become a reference for the Vuforia engine to scale your augmented virtual content size related to the size of your target image from the camera view.
The answer from the moderator on post #40 in this thread illustrates this very well.