Package boofcv.abst.scene
Class WrapFeatureToSceneRecognition<Image extends ImageBase<Image>,TD extends TupleDesc<TD>>
java.lang.Object
boofcv.abst.scene.WrapFeatureToSceneRecognition<Image,TD>
- All Implemented Interfaces:
SceneRecognition<Image>
,VerbosePrint
public class WrapFeatureToSceneRecognition<Image extends ImageBase<Image>,TD extends TupleDesc<TD>>
extends Object
implements SceneRecognition<Image>
Converts
FeatureSceneRecognition
into SceneRecognition
.-
Nested Class Summary
Nested classes/interfaces inherited from interface boofcv.abst.scene.SceneRecognition
SceneRecognition.Match
-
Field Summary
Modifier and TypeFieldDescriptionOptional reference to a config.protected DetectDescribePoint<Image,
TD> Detects image featuresprotected BoofLambdas.Transform<Image>
protected FeatureSceneRecognition<TD>
-
Constructor Summary
ConstructorDescriptionWrapFeatureToSceneRecognition
(DetectDescribePoint<Image, TD> detector, BoofLambdas.Transform<Image> downSample, FeatureSceneRecognition<TD> recognizer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new image to the databasevoid
Removes all images from the database.getImageIds
(@Nullable List<String> storage) Returns a list of image IDs in the databaseThe image data type which can be processed<T extends FeatureSceneRecognition<TD>>
Tvoid
learnModel
(Iterator<Image> images) Wrap the image iterator by adding detection to itboolean
query
(Image queryImage, BoofLambdas.Filter<String> filter, int limit, DogArray<SceneRecognition.Match> matches) Finds the best matches in the database to the query image.void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> options)
-
Field Details
-
detector
Detects image features -
downSample
-
recognizer
-
config
Optional reference to a config. Useful when saving to disk
-
-
Constructor Details
-
WrapFeatureToSceneRecognition
public WrapFeatureToSceneRecognition(DetectDescribePoint<Image, TD> detector, BoofLambdas.Transform<Image> downSample, FeatureSceneRecognition<TD> recognizer)
-
-
Method Details
-
learnModel
Wrap the image iterator by adding detection to it- Specified by:
learnModel
in interfaceSceneRecognition<Image extends ImageBase<Image>>
-
clearDatabase
public void clearDatabase()Description copied from interface:SceneRecognition
Removes all images from the database. The model is not modified- Specified by:
clearDatabase
in interfaceSceneRecognition<Image extends ImageBase<Image>>
-
addImage
Description copied from interface:SceneRecognition
Adds a new image to the database- Specified by:
addImage
in interfaceSceneRecognition<Image extends ImageBase<Image>>
- Parameters:
id
- The unique ID for this imageimage
- The image
-
query
public boolean query(Image queryImage, @Nullable BoofLambdas.Filter<String> filter, int limit, DogArray<SceneRecognition.Match> matches) Description copied from interface:SceneRecognition
Finds the best matches in the database to the query image.- Specified by:
query
in interfaceSceneRecognition<Image extends ImageBase<Image>>
- Parameters:
queryImage
- (Input) image being processedfilter
- (Input) Used to filter results so that known matches don't pollute the results.limit
- (Input) The maximum number of results it will return. If ≤ 0 then all matches are returned.matches
- (Output) Set of matches found in best first order. List is always cleared- Returns:
- true if at least one valid match was found or false if no valid matches could be found. If false that means matches is empty. This is strictly a convenience.
-
getImageIds
Description copied from interface:SceneRecognition
Returns a list of image IDs in the database- Specified by:
getImageIds
in interfaceSceneRecognition<Image extends ImageBase<Image>>
- Parameters:
storage
- (Optional) Storage for the list of images. If null a new instance is created- Returns:
- List of all the image IDs.
-
getImageType
Description copied from interface:SceneRecognition
The image data type which can be processed- Specified by:
getImageType
in interfaceSceneRecognition<Image extends ImageBase<Image>>
-
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> options) - Specified by:
setVerbose
in interfaceVerbosePrint
-
getRecognizer
-