Collection of class information inside a classification sample list.
More...
Inherits LabelInfoCollection< ImageClassificationLabelInfo, Image >.
|
void | Add (string label, Image srcImage, Point2D extractionLocation, SampleExtractionMode mode=SampleExtractionMode.TopLeftCorner) |
| Add a sample to a new class. If the class indicated by the label already exists the sample will be added to the existing class. More...
|
|
bool | HasLabel (string label) |
| Check if a given label is already present in the classes collection. More...
|
|
void | Remove (string label) |
| Remove a class and all the data objects associated with it based on its name. More...
|
|
void | MergeClasses (string fromLabel, string toLabel) |
| Merge two classes into one class. The class label will be taken from the 2nd class index. Note that this operation will invalidate all indices higher than fromLabel . More...
|
|
Collection of class information inside a classification sample list.
◆ Add()
Add a sample to a new class. If the class indicated by the label already exists the sample will be added to the existing class.
- Parameters
-
label | Name of the new class. |
srcImage | Image from which to extract the first sample for the new class. |
extractionLocation | Location at which to extract the first sample for the new class. Note that what the extraction location actually refers dependent on the value of the mode parameter. |
- Exceptions
-
ObjectDisposedException | If the image list has already been disposed. |
- Parameters
-
mode | Interpretation hint for the extractionLocation parameter. |
◆ GetInfo()
Parent class calls this method to extract one info object by index.
- Parameters
-
index | index at which to extract |
- Returns
- extracted object
- Exceptions
-
ObjectDisposedException | If the SampleImageList has already been disposed |
ArgumentOutOfRangeException | If the index is invalid |
◆ HasLabel()
bool HasLabel |
( |
string |
label | ) |
|
Check if a given label is already present in the classes collection.
- Parameters
-
- Returns
- True if a class with the specified label already exists; false otherwise.
◆ MergeClasses()
void MergeClasses |
( |
string |
fromLabel, |
|
|
string |
toLabel |
|
) |
| |
Merge two classes into one class. The class label will be taken from the 2nd class index. Note that this operation will invalidate all indices higher than fromLabel .
- Parameters
-
fromLabel | Class to merge to the other classes. |
toLabel | Class to merge the samples to. |
◆ Remove()
void Remove |
( |
string |
label | ) |
|
Remove a class and all the data objects associated with it based on its name.
- Parameters
-
label | Name of the class to be removed. |
- Exceptions
-
ObjectDisposedException | If the sample list has already been disposed. |