@Namespace(value="chilitags") @NoOffset @Properties(inherit=chilitags.class) public class Chilitags extends Pointer
Its main function is to find tags in an image, i.e. return the id and the position in the image of the corners of each detected chilitag.
It also provides some utilities, like encoding and decoding id's to/from bit matrices, or drawing a given tag.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
static int |
ASYNC_DETECT_ALWAYS
enum chilitags::Chilitags::DetectionTrigger
|
static int |
ASYNC_DETECT_PERIODICALLY
enum chilitags::Chilitags::DetectionTrigger
|
static int |
DETECT_ONLY
enum chilitags::Chilitags::DetectionTrigger
|
static int |
DETECT_PERIODICALLY
enum chilitags::Chilitags::DetectionTrigger
|
static int |
FAST
enum chilitags::Chilitags::PerformancePreset
|
static int |
FASTER
enum chilitags::Chilitags::PerformancePreset
|
static int |
ROBUST
enum chilitags::Chilitags::PerformancePreset
|
static int |
TRACK_AND_DETECT
enum chilitags::Chilitags::DetectionTrigger
|
static int |
TRACK_ONLY
enum chilitags::Chilitags::DetectionTrigger
|
Constructor and Description |
---|
Chilitags()
Constructs a object ready to detect tags.
|
Chilitags(long size)
Native array allocator.
|
Chilitags(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
org.bytedeco.opencv.opencv_core.Mat |
draw(int id) |
org.bytedeco.opencv.opencv_core.Mat |
draw(int id,
int cellSize,
boolean withMargin,
org.bytedeco.opencv.opencv_core.Scalar color) |
TagCornerMap |
find(org.bytedeco.opencv.opencv_core.Mat inputImage) |
TagCornerMap |
find(org.bytedeco.opencv.opencv_core.Mat inputImage,
int detectionTrigger)
This is the main method of Chilitags.
|
Chilitags |
getPointer(long i) |
Chilitags |
position(long position) |
void |
setCornerRefinement(boolean refineCorners)
Enable or disable the corner refinement.
|
void |
setDetectionPeriod(int period)
When the detection trigger is Chilitags::DETECT_PERIODICALLY,
period
specifies the number of frames between each full detection. |
void |
setFilter(int persistence,
float gain)
Parameters to paliate with the imperfections of the detection.
|
void |
setMaxInputWidth(int maxWidth)
Ensures that the image used as input for the detection is at most
maxWidth wide. |
void |
setMinInputWidth(int minWidth)
Chilitags searches for tags on the input image and on subsamples reduced to
50%, 25%, 12.5%, etc.
|
void |
setPerformance(int preset)
Applies one of the performance tuning preset (See PerformancePreset).
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public static final int TRACK_AND_DETECT
public static final int DETECT_ONLY
public static final int TRACK_ONLY
public static final int DETECT_PERIODICALLY
public static final int ASYNC_DETECT_PERIODICALLY
public static final int ASYNC_DETECT_ALWAYS
public static final int FASTER
public static final int FAST
public static final int ROBUST
public Chilitags(Pointer p)
Pointer(Pointer)
.public Chilitags(long size)
Pointer.position(long)
.public Chilitags()
public Chilitags getPointer(long i)
getPointer
in class Pointer
public void setFilter(int persistence, float gain)
persistence
- the number of frames in which a tag should be absent
before being removed from the output of find(). 0 means that tags disappear
directly if they are not detected.
gain
- a value between 0 and 1 corresponding to the weight of the
previous (filtered) position in the new filtered position. 0 means that the
latest position of the tag is returned.@ByVal public TagCornerMap find(@Const @ByRef org.bytedeco.opencv.opencv_core.Mat inputImage, @Cast(value="chilitags::Chilitags::DetectionTrigger") int detectionTrigger)
inputImage
- an OpenCV image (gray or BGR)
detectionTrigger
- specifies how to combine tracking and full
detection. Tracking is drastically faster, but it can at best return tags
previously found; it won't find new ones, but can lose some. See
Chilitags::DetectionTrigger for a description of the possible values.@ByVal public TagCornerMap find(@Const @ByRef org.bytedeco.opencv.opencv_core.Mat inputImage)
public void setDetectionPeriod(int period)
period
specifies the number of frames between each full detection. The
default is 15, which means that out of 15 consecutive calls to find(),
one will use a full detection, and the 14 others will only track
previous results.public void setPerformance(@Cast(value="chilitags::Chilitags::PerformancePreset") int preset)
public void setCornerRefinement(@Cast(value="bool") boolean refineCorners)
public void setMaxInputWidth(int maxWidth)
maxWidth
wide. The smaller, the faster, but tags smaller than 20 pixels
won't be detected.
maxWidth
- the width to which input images should be reduced to, or 0
if no resizing should occur (default).public void setMinInputWidth(int minWidth)
minWidth
wide. This value can be changed to
adjust the lower limit of subsampling. For example, the Chilitags::ROBUST
performance preset calls setMinInputWidth(160)
.
If minWidth
is set to 0, subsampling is completely disabled, i.e. tags
are searched only on the original input image. This is the behaviour set by
Chilitags::FAST, i.e. the default behaviour.
Disabling the subsampling reduces the processing time by ~40%, but large tags (having sides larger than hundreds of pixels) are likely to be missed.
@ByVal public org.bytedeco.opencv.opencv_core.Mat draw(int id, int cellSize, @Cast(value="bool") boolean withMargin, @ByVal(nullValue="cv::Scalar(0,0,0)") org.bytedeco.opencv.opencv_core.Scalar color)
id
- the id of the tag to draw, between [0,1024)
cellSize
- the (integer) scale factor with which to draw the tag. In
other words, every bit of the data matrix of the tag will be cellSize
large.
withMargin
- a boolean coding whether the returned image of the tag
should be surrounded by a white frame, ensuring that the edges of the tag
will contrast with the background.
color
- the RGB color with which to draw the tag. Values are integers
within [0,255]. The darker, the better. Black is default and optimal.@ByVal public org.bytedeco.opencv.opencv_core.Mat draw(int id)
Copyright © 2022. All rights reserved.