This type is an EasyAR Sense API in C#: ImageTarget . Some descriptions may not apply to Unity environment on this page.
This type is partially wrapped into Unity components: ImageTargetController . Members and instances of this type are not required to be used directly in most situations. Use this type by ImageTargetController.Target instead of creating new instances when a few unwrapped API is desired for use.
ImageTarget represents planar image targets that can be tracked by ImageTracker .
The fields of ImageTarget need to be filled with the create… method before it can be read. And ImageTarget can be tracked by ImageTracker after a successful load into the ImageTracker using ImageTracker.loadTarget .
public static Optional<ImageTarget> createFromParameters( ImageTargetParameters parameters)
Creates a target from parameters.
public static Optional<ImageTarget> createFromTargetFile(string path, StorageType storageType)
Creates a target from an etd file.
public static Optional<ImageTarget> createFromTargetData( Buffer buffer)
Creates a target from an etd data buffer.
public virtual bool save(string path)
Saves as an etd file.
public static Optional<ImageTarget> createFromImageFile(string path, StorageType storageType, string name, string uid, string meta, float scale)
Creates a target from an image file. If not needed, name, uid, meta can be passed with empty string, and scale can be passed with default value 1. Jpeg and png files are supported.
public virtual float scale()
The scale of image. The value is the physical image width divided by 1 meter. The default value is 1.
public virtual float aspectRatio()
The aspect ratio of image, width divided by height.
public virtual bool setScale(float scale)
Sets image target scale, this will overwrite the value set in the json file or the default value. The value is the physical image width divided by 1 meter. The default value is 1.
It is needed to set the model scale in rendering engine separately.
public virtual List< Image > images()
Returns a list of images that stored in the target. It is generally used to get image data from cloud returned target.
public override int runtimeID()
Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
public override string uid()
Returns the target uid. A target uid is useful in cloud based algorithms. If no cloud is used, you can set this uid in the json config as a alternative method to distinguish from targets.
public override string name()
Returns the target name. Name is used to distinguish targets in a json file.
public override void setName(string name)
Set name. It will erase previously set data or data from cloud.
public override string meta()
Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.
public override void setMeta(string data)
Set meta data. It will erase previously set data or data from cloud.