![]() |
KSquare Utilities
|
Detects duplicate images in a given FeaureVectorList objects. More...
#include <DuplicateImages.h>
Public Member Functions | |
| DuplicateImages (FeatureVectorListPtr _examples, RunLog &_log) | |
| You would use this instance to search for duplicates in the list of 'examples'. More... | |
| DuplicateImages (FileDescPtr _fileDesc, RunLog &_log) | |
| ~DuplicateImages () | |
| bool | AddExamples (FeatureVectorListPtr examples) |
| Will add all the examples; be careful of ownership. More... | |
| DuplicateImagePtr | AddSingleExample (FeatureVectorPtr example) |
| Add one more FeatureVector to the list. More... | |
| DuplicateImageListPtr | DupExamples () const |
| kkint32 | DuplicateCount () const |
| kkint32 | DuplicateDataCount () const |
| kkint32 | DuplicateNameCount () const |
| bool | DuplicatesFound () const |
| bool | ExampleInDetector (FeatureVectorPtr fv) |
| FeatureVectorListPtr | ListOfExamplesToDelete () |
| void | PurgeDuplicates (FeatureVectorListPtr examples, bool allowDupsInSameClass, std::ostream *report) |
| Delete duplicate examples from FeatureVectorList structure provided in constructor. More... | |
| void | ReportDuplicates (std::ostream &o) |
Detects duplicate images in a given FeaureVectorList objects.
Will derive a list of duplicate FeatureVector objects in a given list. It will use both the Image File Name and feature data to detect duplicates. A duplicate can be detected in two ways. If two or more entries have the same ExampleFileName or FeatureData.
The simplest way to use this object is to create an instance with a FeatureVectorList object that you are concerned with. Then call the method DupExamples (), which will return the list of duplicates found via a structure called DuplicateImageList.
Definition at line 53 of file DuplicateImages.h.
| DuplicateImages::DuplicateImages | ( | FeatureVectorListPtr | _examples, |
| RunLog & | _log | ||
| ) |
You would use this instance to search for duplicates in the list of 'examples'.
You can still call 'AddExamples' and 'AddSingleExample';
Definition at line 25 of file DuplicateImages.cpp.
References KKMLL::DuplicateImageList::DuplicateImageList(), KKMLL::FeatureVectorList::FileDesc(), KKMLL::ImageFeaturesDataIndexed::ImageFeaturesDataIndexed(), and KKMLL::ImageFeaturesNameIndexed::ImageFeaturesNameIndexed().
Referenced by KKMLL::FeatureVectorList::RemoveDuplicateEntries().
| DuplicateImages::DuplicateImages | ( | FileDescPtr | _fileDesc, |
| RunLog & | _log | ||
| ) |
Definition at line 50 of file DuplicateImages.cpp.
References KKMLL::DuplicateImageList::DuplicateImageList(), KKMLL::ImageFeaturesDataIndexed::ImageFeaturesDataIndexed(), and KKMLL::ImageFeaturesNameIndexed::ImageFeaturesNameIndexed().
Referenced by KKMLL::TrainingProcess2::CreateTrainingProcessForLevel().
| DuplicateImages::~DuplicateImages | ( | void | ) |
Definition at line 68 of file DuplicateImages.cpp.
| bool DuplicateImages::AddExamples | ( | FeatureVectorListPtr | examples | ) |
Will add all the examples; be careful of ownership.
Definition at line 90 of file DuplicateImages.cpp.
| DuplicateImagePtr DuplicateImages::AddSingleExample | ( | FeatureVectorPtr | example | ) |
Add one more FeatureVector to the list.
Will add one more example to list and if it turns out to be a duplicate will return pointer to a "DuplicateImage" structure that will contain a list of all images that it is duplicate to. If no duplicate found will then return a NULL pointer.
Will add one more example to list and if it turns out to be a duplicate will return pointer to a "DuplicateImage" structure that will contain a list of all images that it is duplicate to. If no duplicate found will then return a NULL pointer.
| [in] | example | FeatureVecvtor that you want to add to the list. |
Definition at line 111 of file DuplicateImages.cpp.
References KKMLL::DuplicateImage::AddADuplicate(), KKB::KKStr::Concat(), KKMLL::DuplicateImage::DuplicateImage(), KKB::KKStr::Empty(), KKMLL::FeatureVector::ExampleFileName(), KKMLL::ImageFeaturesDataIndexed::GetEqual(), KKMLL::DuplicateImageList::LocateByImage(), and KKMLL::ImageFeaturesDataIndexed::RBInsert().
|
inline |
Definition at line 85 of file DuplicateImages.h.
Referenced by ListOfExamplesToDelete(), and PurgeDuplicates().
|
inline |
Definition at line 87 of file DuplicateImages.h.
|
inline |
Definition at line 88 of file DuplicateImages.h.
|
inline |
Definition at line 89 of file DuplicateImages.h.
| bool DuplicateImages::DuplicatesFound | ( | ) | const |
Definition at line 362 of file DuplicateImages.cpp.
| bool DuplicateImages::ExampleInDetector | ( | FeatureVectorPtr | fv | ) |
Definition at line 77 of file DuplicateImages.cpp.
References KKMLL::ImageFeaturesDataIndexed::GetEqual().
| FeatureVectorListPtr DuplicateImages::ListOfExamplesToDelete | ( | ) |
Definition at line 276 of file DuplicateImages.cpp.
References KKMLL::DuplicateImage::AllTheSameClass(), DupExamples(), KKMLL::DuplicateImage::DuplicatedImages(), KKMLL::DuplicateImage::ExampleWithSmallestScanLine(), KKMLL::FeatureVectorList::FeatureVectorList(), and KKMLL::FeatureVectorList::PushOnBack().
| void DuplicateImages::PurgeDuplicates | ( | FeatureVectorListPtr | examples, |
| bool | allowDupsInSameClass, | ||
| std::ostream * | report | ||
| ) |
Delete duplicate examples from FeatureVectorList structure provided in constructor.
if not equal NULL will list examples being purged.
If duplicates are in more than one class then all will be deleted. if duplicates are in a single class then one with smallest scan line will be kept while all others will be deleted.
Definition at line 194 of file DuplicateImages.cpp.
References KKMLL::DuplicateImage::AllTheSameClass(), DupExamples(), KKMLL::DuplicateImage::DuplicatedImages(), and KKMLL::DuplicateImage::ExampleWithSmallestScanLine().
Referenced by KKMLL::TrainingProcess2::CreateTrainingProcessForLevel(), and KKMLL::FeatureVectorList::RemoveDuplicateEntries().
| void DuplicateImages::ReportDuplicates | ( | std::ostream & | o | ) |
Definition at line 326 of file DuplicateImages.cpp.