digiKam
Digikam::RedEye Namespace Reference

Classes

struct  RegressionTree
 
class  ShapePredictor
 
struct  SplitFeature
 

Functions

void createShapeRelativeEncoding (const std::vector< float > &shape, const std::vector< std::vector< float > > &pixel_coordinates, std::vector< unsigned long > &anchor_idx, std::vector< std::vector< float > > &deltas)
 
void extractFeaturePixelValues (const cv::Mat &img_, const cv::Rect &rect, const std::vector< float > &current_shape, const std::vector< float > &reference_shape, const std::vector< unsigned long > &reference_pixel_anchor_idx, const std::vector< std::vector< float > > &reference_pixel_deltas, std::vector< float > &feature_pixel_values)
 
PointTransformAffine findTformBetweenShapes (const std::vector< float > &from_shape, const std::vector< float > &to_shape)
 
unsigned long left_child (unsigned long idx)
 
template<class T >
std::vector< Tlocation (const std::vector< T > &shape, unsigned long idx)
 
unsigned long nearestShapePoint (const std::vector< float > &shape, const std::vector< float > &pt)
 
PointTransformAffine normalizingTform (const cv::Rect &rect)
 
QDataStream & operator<< (QDataStream &dataStream, const RegressionTree &regtree)
 
QDataStream & operator<< (QDataStream &dataStream, const ShapePredictor &shape)
 
QDataStream & operator<< (QDataStream &dataStream, const SplitFeature &sp)
 
QDataStream & operator>> (QDataStream &dataStream, RegressionTree &regtree)
 
QDataStream & operator>> (QDataStream &dataStream, ShapePredictor &shape)
 
QDataStream & operator>> (QDataStream &dataStream, SplitFeature &sp)
 
bool pointContained (const cv::Rect &rect, const std::vector< float > &point)
 
unsigned long right_child (unsigned long idx)
 
PointTransformAffine unnormalizingTform (const cv::Rect &rect)
 

Function Documentation

◆ createShapeRelativeEncoding()

void Digikam::RedEye::createShapeRelativeEncoding ( const std::vector< float > &  shape,
const std::vector< std::vector< float > > &  pixel_coordinates,
std::vector< unsigned long > &  anchor_idx,
std::vector< std::vector< float > > &  deltas 
)

requires

  • shape.size()%2 == 0
  • shape.size() > 0 ensures
  • #anchor_idx.size() == pixel_coordinates.size()
  • #deltas.size() == pixel_coordinates.size()
  • for all valid i:
  • pixel_coordinates[i] == location(shape,#anchor_idx[i]) + #deltas[i]

References location(), and nearestShapePoint().

◆ extractFeaturePixelValues()

void Digikam::RedEye::extractFeaturePixelValues ( const cv::Mat &  img_,
const cv::Rect &  rect,
const std::vector< float > &  current_shape,
const std::vector< float > &  reference_shape,
const std::vector< unsigned long > &  reference_pixel_anchor_idx,
const std::vector< std::vector< float > > &  reference_pixel_deltas,
std::vector< float > &  feature_pixel_values 
)

requires

  • image_type == an image object that implements the interface defined in dlib/image_processing/generic_image.h
  • reference_pixel_anchor_idx.size() == reference_pixel_deltas.size()
  • current_shape.size() == reference_shape.size()
  • reference_shape.size()%2 == 0
  • max(mat(reference_pixel_anchor_idx)) < reference_shape.size()/2 ensures
  • #feature_pixel_values.size() == reference_pixel_deltas.size()
  • for all valid i:
    • #feature_pixel_values[i] == the value of the pixel in img_ that corresponds to the pixel identified by reference_pixel_anchor_idx[i] and reference_pixel_deltas[i] when the pixel is located relative to current_shape rather than reference_shape.

References findTformBetweenShapes(), Digikam::PointTransformAffine::get_m(), location(), pointContained(), and unnormalizingTform().

Referenced by Digikam::RedEye::ShapePredictor::operator()().

◆ findTformBetweenShapes()

PointTransformAffine Digikam::RedEye::findTformBetweenShapes ( const std::vector< float > &  from_shape,
const std::vector< float > &  to_shape 
)

◆ left_child()

unsigned long Digikam::RedEye::left_child ( unsigned long  idx)

Returns the index of the left child of the binary tree node idx

Referenced by Digikam::RedEye::RegressionTree::operator()().

◆ location()

template<class T >
std::vector<T> Digikam::RedEye::location ( const std::vector< T > &  shape,
unsigned long  idx 
)
inline

requires

  • idx < shape.size()/2
  • shape.size()%2 == 0 ensures
  • returns the idx-th point from the shape vector.

Referenced by Digikam::CollectionManager::album(), Digikam::CollectionManager::albumRootLabel(), Digikam::CollectionManager::albumRootPath(), Digikam::CollectionManager::allAvailableAlbumRootPaths(), Digikam::CollectionManager::allAvailableLocations(), Digikam::CollectionManager::allLocations(), Digikam::SetupCollectionModel::apply(), Digikam::CollectionManager::changeType(), Digikam::CollectionScanner::checkAlbum(), Digikam::CollectionManager::checkHardWiredLocations(), Digikam::CollectionManager::Private::checkIfExists(), Digikam::CollectionScanner::completeScan(), Digikam::CollectionScanner::countItemsInFolder(), Digikam::AlbumManager::createPAlbum(), createShapeRelativeEncoding(), extractFeaturePixelValues(), Digikam::AlbumManager::findPAlbum(), findTformBetweenShapes(), Digikam::CollectionManager::Private::findVolumeForLocation(), Digikam::CollectionScanner::finishCompleteScan(), Digikam::CoreDbUrl::fromAlbumAndName(), Digikam::CoreDbUrl::fromFileUrl(), Digikam::ItemInfo::fromLocalFile(), Digikam::DMetadata::getIptcCoreLocation(), Digikam::DMetadata::getMetadataField(), Digikam::ScanController::hintAtMoveOrCopyOfAlbum(), Digikam::CollectionManager::isAlbumRoot(), Digikam::AlbumManager::Private::labelForAlbumRootAlbum(), Digikam::SetupCollectionModel::loadCollections(), Digikam::loadEcmQtTranslationFiles(), Digikam::CollectionManager::locationForAlbumRootId(), Digikam::CollectionManager::locationForAlbumRootPath(), Digikam::CollectionManager::locationForPath(), Digikam::CollectionManager::migrateToVolume(), Digikam::CollectionManager::migrationCandidates(), nearestShapePoint(), Digikam::CollectionManager::Private::networkShareMountPathsFromIdentifier(), Digikam::CollectionManager::oneAlbumRootPath(), Digikam::RedEye::ShapePredictor::operator()(), Digikam::CollectionScanner::partialScan(), Digikam::CollectionManager::Private::pathFromIdentifier(), Digikam::DPluginLoader::Private::pluginEntriesList(), Digikam::CollectionManager::refreshLocation(), Digikam::CollectionManager::removeLocation(), Digikam::ItemScanner::resolvedImageHistory(), Digikam::ItemScanner::resolveHistoryImageId(), Digikam::CollectionScanner::scanAlbum(), Digikam::CollectionScanner::scanAlbumRoot(), Digikam::CollectionScanner::scanFile(), Digikam::CollectionScanner::scanForStaleAlbums(), Digikam::WSAlbum::setBaseAlbum(), Digikam::DMetadata::setIptcCoreLocation(), Digikam::CollectionManager::setLabel(), Digikam::AlbumManager::setShowOnlyAvailableAlbums(), Digikam::AlbumWatch::slotAlbumAdded(), and Digikam::AlbumManager::startScan().

◆ nearestShapePoint()

unsigned long Digikam::RedEye::nearestShapePoint ( const std::vector< float > &  shape,
const std::vector< float > &  pt 
)

◆ normalizingTform()

PointTransformAffine Digikam::RedEye::normalizingTform ( const cv::Rect &  rect)

Returns a transform that maps rect.tl_corner() to (0, 0) and rect.br_corner() to (1,1).

References Digikam::findAffineTransform().

◆ operator<<() [1/3]

QDataStream & Digikam::RedEye::operator<< ( QDataStream &  dataStream,
const RegressionTree regtree 
)

◆ operator<<() [2/3]

◆ operator<<() [3/3]

QDataStream & Digikam::RedEye::operator<< ( QDataStream &  dataStream,
const SplitFeature sp 
)

◆ operator>>() [1/3]

QDataStream & Digikam::RedEye::operator>> ( QDataStream &  dataStream,
RegressionTree regtree 
)

◆ operator>>() [2/3]

◆ operator>>() [3/3]

QDataStream & Digikam::RedEye::operator>> ( QDataStream &  dataStream,
SplitFeature sp 
)

◆ pointContained()

bool Digikam::RedEye::pointContained ( const cv::Rect &  rect,
const std::vector< float > &  point 
)

◆ right_child()

unsigned long Digikam::RedEye::right_child ( unsigned long  idx)

Returns the index of the left child of the binary tree node idx

Referenced by Digikam::RedEye::RegressionTree::operator()().

◆ unnormalizingTform()

PointTransformAffine Digikam::RedEye::unnormalizingTform ( const cv::Rect &  rect)

returns a transform that maps (0, 0) to rect.tl_corner() and (1,1) to rect.br_corner().

References Digikam::findAffineTransform().

Referenced by extractFeaturePixelValues(), and Digikam::RedEye::ShapePredictor::operator()().