Class ImageTarget
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
ImageTarget represents the target of a planar image, which can be tracked by `ImageTracker`_. The values inside ImageTarget need to be filled in through methods like create... before they can be read. Then, after successfully loading into `ImageTracker`_ via `ImageTracker.loadTarget`_, it can be detected and tracked by `ImageTracker`_.
public class ImageTarget : Target, IDisposable
- Inheritance
-
ImageTarget
- Implements
- Inherited Members
Constructors
ImageTarget()
public ImageTarget()
Methods
Clone()
public ImageTarget Clone()
CloneObject()
protected override object CloneObject()
aspectRatio()
The aspect ratio of the image.
public virtual float aspectRatio()
createFromImageFile(string, StorageType, string, string, string, float)
Create from image. If not needed, name, uid, meta can be passed as empty strings, scale can be passed as the default value 1. Supports jpeg or png files.
public static Optional<ImageTarget> createFromImageFile(string path, StorageType storageType, string name, string uid, string meta, float scale)
Parameters
pathstorageTypenameuidmetascale
createFromParameters(ImageTargetParameters)
Create from parameters.
public static Optional<ImageTarget> createFromParameters(ImageTargetParameters parameters)
Parameters
parameters
createFromTargetData(Buffer)
Create from etd data cache.
public static Optional<ImageTarget> createFromTargetData(Buffer buffer)
Parameters
buffer
createFromTargetFile(string, StorageType)
Create from etd file.
public static Optional<ImageTarget> createFromTargetFile(string path, StorageType storageType)
Parameters
pathstorageType
images()
Get the list of images stored in the target. Usually, this method is used to obtain the recognition image data of the target returned from the cloud.
public virtual List<Image> images()
meta()
Get the meta data set by setMetaData. Or, in the target returned by cloud recognition, obtain the meta data set by the server.
public override string meta()
name()
Get the target name. The name is used to distinguish targets in the json file.
public override string name()
runtimeID()
Get the target id. The target id is an integer created at runtime, and it is only valid (non-zero) after successful configuration. This id is non-zero and globally incremental.
public override int runtimeID()
save(string)
Save as etd file.
public virtual bool save(string path)
Parameters
path
scale()
The scaling factor of the image. Its value is the ratio of the physical size of the image width to 1 meter, with a default value of 1.
public virtual float scale()
setMeta(string)
Set meta data. This operation will override the previous setting or data returned by the server.
public override void setMeta(string data)
Parameters
data
setName(string)
Set the target name. This operation will override the previous setting or data returned by the server.
public override void setName(string name)
Parameters
name
setScale(float)
Set the scaling factor of the image, which will override the default value and the value set in the json file after setting. Its value is the ratio of the physical size of the image width to 1 meter, with a default value of 1. Additionally, this model scaling needs to be set separately in the rendering engine.
public virtual bool setScale(float scale)
Parameters
scale
uid()
Get the target uid. The uid of ImageTarget is used in cloud recognition algorithms. When cloud recognition is not connected, you can set this uid in the json configuration and use it as another way to distinguish targets in your own code.
public override string uid()