Ocean
|
This class implements several J-linkage functions for pose/homography determination. More...
Static Public Member Functions | |
static bool | homographyMatrices (const ImagePoint *leftImagePoints, const ImagePoint *rightImagePoints, const size_t correspondences, const unsigned int width, const unsigned int height, SquareMatrices3 &homographies, const unsigned int testCandidates, const ImagePoints &leftPointForInitialModels, const Scalar squarePixelErrorAssignmentThreshold, std::vector< IndexSet32 > *usedIndicesPerHomography=nullptr, bool refineHomographies=true, bool approximatedNeighborSearch=true, Ocean::RandomGenerator *randomGenerator=nullptr) |
Calculates multiple homographies between two images transforming the projected planar object points between the two images using J-linkage The resulting homographies transform its image points defined in the left image to image points defined in the right image (rightPoint_i = H_i * leftPoint_i). More... | |
static bool | homographyMatrices (const ImagePoint *leftImagePoints, const ImagePoint *rightImagePoints, const size_t correspondences, const unsigned int width, const unsigned int height, SquareMatrices3 &homographies, const unsigned int testCandidates, const Indices32 &leftPointIndicesForInitialModels, const Scalar squarePixelErrorAssignmentThreshold, std::vector< IndexSet32 > *usedIndicesPerHomography=nullptr, bool refineHomographies=true, bool approximatedNeighborSearch=true, Ocean::RandomGenerator *randomGenerator=nullptr) |
Calculates multiple homographies between two images transforming the projected planar object points between the two images using J-linkage The resulting homographies transform its image points defined in the left image to image points defined in the right image (rightPoint_i = H_i * leftPoint_i). More... | |
static bool | fitLines (const ImagePoint *imagePoints, const size_t pointCount, const unsigned int width, const unsigned int height, Lines2 &lines, const unsigned int testCandidates, const ImagePoints &pointForInitialModels, const Scalar pixelErrorAssignmentThreshold, std::vector< IndexSet32 > *usedIndicesPerHomography=nullptr, bool approximatedNeighborSearch=true) |
Multiple line detector using J-linkage. More... | |
Protected Types | |
typedef std::pair< Scalar, Index32 > | DistancePair |
Definition of a pair combining a point index with the distance to a reference. More... | |
Static Protected Member Functions | |
static std::vector< Indices32 > | buildingMinimalSampleSet (const ImagePoint *imagePoints, const size_t pointCount, const ImagePoints &pointForInitialModels, const unsigned int testCandidates, const SpatialDistribution::DistributionArray *distributionImagePoints=nullptr) |
Generates minimal sample set for J-/T-Linkage. More... | |
static SquareMatrices3 | buildingMinimalSampleSetHomography (const ImagePoint *leftImagePoints, const ImagePoint *rightImagePoints, const size_t correspondences, const ImagePoints &leftPointForInitialModels, const unsigned int testCandidates, const SpatialDistribution::DistributionArray *distributionImagePoints=nullptr, RandomGenerator *randomRansac=nullptr) |
Generates a homography per minimal sample set (for J-/T-Linkage) More... | |
static Lines2 | buildingMinimalSampleSetLine (const ImagePoint *imagePoints, const size_t pointCount, const ImagePoints &pointForInitialModels, const unsigned int testCandidates, const SpatialDistribution::DistributionArray *distributionImagePoints=nullptr) |
Generates a line model per minimal sample set (for J-/T-Linkage) More... | |
static Scalar | jaccardDistance (const IndexSet32 &setA, const IndexSet32 &setB) |
Calculates the jaccard distance d(A, B) = ( |union(A, B)| - |intersection(A, B)| ) / |union(A, B)|. More... | |
static bool | distancePairSortAscending (const DistancePair &firstPair, const DistancePair &seccondPair) |
Sorts pairs of indices and their corresponding distances in ascending order regarding the distance values. More... | |
This class implements several J-linkage functions for pose/homography determination.
J-linkage aims to fit multiple models from data given The J-linkage algorithm is an agglomerative clustering that proceeds by linking elements with Jaccard distance smaller than 1 and stop as soon as there are no such elements left.
|
protected |
Definition of a pair combining a point index with the distance to a reference.
|
staticprotected |
Generates minimal sample set for J-/T-Linkage.
imagePoints | Image points |
pointCount | Number of points |
pointForInitialModels | Initial points of minimal sample sets. Note: some maybe be discarded |
testCandidates | Number of candidates used for each minimal sampling set, with range [1, correspondences] |
distributionImagePoints | Spatial distribution for approximate search (if nullptr, brute force methode is used) |
|
staticprotected |
Generates a homography per minimal sample set (for J-/T-Linkage)
leftImagePoints | Image points in the left camera, each point corresponds to one point in the right image |
rightImagePoints | Image points in the right camera |
correspondences | Number of points correspondences |
leftPointForInitialModels | Initial points of minimal sample sets. Note: some maybe be discarded |
testCandidates | Number of candidates used for each minimal sampling set, with range [4, correspondences] |
distributionImagePoints | Spatial distribution for approximate search (if nullptr, brute force methode is used) |
randomRansac | Random generator object to be used for creating random numbers, RANSAC is used if this is not null |
|
staticprotected |
Generates a line model per minimal sample set (for J-/T-Linkage)
imagePoints | Image points |
pointCount | Number of points |
pointForInitialModels | Initial points of minimal sample sets. Note: some maybe be discarded |
testCandidates | Number of candidates used for each minimal sampling set, with range [2, correspondences] |
distributionImagePoints | Spatial distribution for approximate search (if nullptr, brute force methode is used) |
|
inlinestaticprotected |
Sorts pairs of indices and their corresponding distances in ascending order regarding the distance values.
firstPair | First pair of distance and index |
seccondPair | Second pair of distance and index |
|
static |
Multiple line detector using J-linkage.
imagePoints | image points |
pointCount | Number of points |
width | The width of the image in pixel |
height | The height of the image in pixel |
lines | Resulting valid line model |
testCandidates | Number of candidates used in for minimum sample set, with range [2, correspondences] |
pointForInitialModels | Initial image points, one per each sample set |
pixelErrorAssignmentThreshold | Maximal pixel error of a point-line corresspodance (0, infinity) |
usedIndicesPerHomography | Optional set of indices which will receive the indices of the used image correspondences per model, if defined |
approximatedNeighborSearch | Defines if speeded up spatial neighbor search is used |
|
static |
Calculates multiple homographies between two images transforming the projected planar object points between the two images using J-linkage The resulting homographies transform its image points defined in the left image to image points defined in the right image (rightPoint_i = H_i * leftPoint_i).
leftImagePoints | Image points in the left camera, each point corresponds to one point in the right image |
rightImagePoints | Image points in the right camera |
correspondences | Number of points correspondences |
width | The width of the left image in pixel |
height | The height of the left image in pixel |
homographies | Resulting valid homographies for each image plane |
testCandidates | Number of candidates used in for minimum sample set, with range [4, correspondences] |
leftPointForInitialModels | Initial image points, one per each sample set |
squarePixelErrorAssignmentThreshold | Maximal square pixel error of a valid projection of a 3D point onto the 2D image plane, with range (0, infinity) |
usedIndicesPerHomography | Optional set of indices which will receive the indices of the used image correspondences per model, if defined |
refineHomographies | Determines whether a not linear least square algorithm is used to increase the pose accuracies after J-linkage |
approximatedNeighborSearch | Defines if speeded up spatial neighbor search is used |
randomGenerator | Random number generator. If is not nullptr, RANSAC is used for homography determination within initial minimum sample set |
|
inlinestatic |
Calculates multiple homographies between two images transforming the projected planar object points between the two images using J-linkage The resulting homographies transform its image points defined in the left image to image points defined in the right image (rightPoint_i = H_i * leftPoint_i).
leftImagePoints | Image points in the left camera, each point corresponds to one point in the right image |
rightImagePoints | Image points in the right camera |
correspondences | Number of points correspondences |
width | The width of the left image in pixel |
height | The height of the left image in pixel |
homographies | Resulting valid homographies for each image plane |
testCandidates | Number of candidates used in for minimum sample set, with range [4, correspondences] |
leftPointIndicesForInitialModels | Initial indices of image points, one per each sample set |
squarePixelErrorAssignmentThreshold | Maximal square pixel error of a valid projection of a 3D point onto the 2D image plane, with range (0, infinity) |
usedIndicesPerHomography | Optional set of indices which will receive the indices of the used image correspondences per model, if defined |
refineHomographies | Determines whether a not linear least square algorithm is used to increase the pose accuracies after J-linkage |
approximatedNeighborSearch | Defines if speeded up spatial neighbor search is used |
randomGenerator | Random number generator. If is not nullptr, RANSAC is used for homography determination within initial minimum sample set |
|
inlinestaticprotected |
Calculates the jaccard distance d(A, B) = ( |union(A, B)| - |intersection(A, B)| ) / |union(A, B)|.
setA | first set of indices to compare |
setB | second set of indices to compare |