@Reference(type=Article, author={"Zhengyou Zhang","Rachid Deriche","Olivier Faugeras","Quang-Tuan Luong"}, title="A robust technique for matching two uncalibrated images through the recovery of the unknown epipolar geometry ", year="1995", journal="Artificial Intelligence ", pages={"87 "," 119"}, url="http://www.sciencedirect.com/science/article/pii/0004370295000224", note="Special Volume on Computer Vision ", number="1--2", volume="78", customData={"issn","0004-3702","doi","http://dx.doi.org/10.1016/0004-3702(95)00022-4","keywords","Correlation "}) public class BucketingSampler2d extends Object implements CollectionSampler<IndependentPair<Point2d,Point2d>>
Works by splitting the space of first image points into a number of buckets. When selecting the sample, a bucket is chosen at random, with the probability of the bucket being picked weighted towards buckets with more points. Then a point pair is picked using a uniform random from within the bucket. Additionally, the algorithm attempts to pick unique buckets for each point by attempting to discount previously selected buckets if possible.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_N_BUCKETS_PER_DIM
Default number of buckets per dimension
|
static int |
NUM_TRIALS
Maximum allowed number of trials in picking a bucket that has not been
previously picked.
|
Constructor and Description |
---|
BucketingSampler2d()
Construct the sampler with the default number of buckets in the x and y
dimensions (8).
|
BucketingSampler2d(int nBucketsX,
int nBucketsY)
Construct the sampler with the given number of buckets in each dimension.
|
Modifier and Type | Method and Description |
---|---|
List<IndependentPair<Point2d,Point2d>> |
sample(int nItems)
Samples
nItems items from the collection set by
CollectionSampler.setCollection(Collection) , returning a new collection with the
given samples. |
void |
setCollection(Collection<? extends IndependentPair<Point2d,Point2d>> collection)
Set the items to sample from.
|
public static final int DEFAULT_N_BUCKETS_PER_DIM
public static int NUM_TRIALS
public BucketingSampler2d()
public BucketingSampler2d(int nBucketsX, int nBucketsY)
nBucketsX
- number of buckets in the x dimensionnBucketsY
- number of buckets in the y dimensionpublic void setCollection(Collection<? extends IndependentPair<Point2d,Point2d>> collection)
CollectionSampler
setCollection
in interface CollectionSampler<IndependentPair<Point2d,Point2d>>
collection
- the items to sample frompublic List<IndependentPair<Point2d,Point2d>> sample(int nItems)
CollectionSampler
nItems
items from the collection set by
CollectionSampler.setCollection(Collection)
, returning a new collection with the
given samples. Implementations can decide what to do if
nItems
is bigger than the number of items in the collection.sample
in interface CollectionSampler<IndependentPair<Point2d,Point2d>>
nItems
- the number of items to samplenull
if a sample cannot be made
for any reason.