2using System.Collections.Generic;
6using System.Threading.Tasks;
14 [TypeConverter(typeof(ExpandableObjectConverter))]
23 bool m_bSaveImagesToFile;
24 List<LabelDescriptor> m_rgLabels =
new List<LabelDescriptor>();
26 string m_strLabelCounts;
27 int m_nCopyOfSourceID;
46 public SourceDescriptor(
int nID,
string strName,
int nWd,
int nHt,
int nCh,
bool bIsRealData,
bool bSaveImagesToFile,
int nCopyOfSourceId = 0,
string strOwner =
null,
int nCount = 0, List<LabelDescriptor> rgLabels =
null,
string strLabelCounts =
null,
byte[] rgbTemporal =
null)
47 : base(nID, strName, strOwner)
52 m_bIsRealData = bIsRealData;
53 m_nImageCount = nCount;
54 m_strLabelCounts = strLabelCounts;
55 m_rgLabels = rgLabels;
56 m_bSaveImagesToFile = bSaveImagesToFile;
57 m_nCopyOfSourceID = nCopyOfSourceId;
67 : this(0, strName, 0, 0, 0, false, bSaveImagesToFile)
76 : this(s.
ID, s.
Name, s.
Width, s.
Height, s.
Channels, s.
IsRealData, s.
SaveImagesToFile, s.
CopyOfSourceID, s.
Owner, s.
ImageCount, s.
Labels, s.
LabelCountsAsText)
79 m_nInactiveCount = s.m_nInactiveCount;
86 if (s.m_temporalDesc !=
null)
101 m_bIsRealData = sd.m_bIsRealData;
102 m_nImageCount = sd.m_nImageCount;
103 m_nInactiveCount = sd.m_nInactiveCount;
104 m_bSaveImagesToFile = sd.m_bSaveImagesToFile;
105 m_nCopyOfSourceID = sd.m_nCopyOfSourceID;
107 m_rgLabels =
new List<descriptors.LabelDescriptor>();
110 m_rgLabels.Add(
new descriptors.LabelDescriptor(ld));
119 m_strLabelCounts = sd.m_strLabelCounts;
121 if (sd.m_temporalDesc !=
null)
131 public void Resize(
int nChannels,
int nHeight,
int nWidth)
141 [Description(
"Specifies whether the images are saved to the file system or directly to the database.")]
144 get {
return m_bSaveImagesToFile; }
150 [Description(
"If this source was copied from another source, this property returns the ID of the original Source, otherwise 0 is returned.")]
154 get {
return m_nCopyOfSourceID; }
155 set { m_nCopyOfSourceID = value; }
164 get {
return m_rgLabels; }
165 set { m_rgLabels = value; }
171 [Description(
"Specifies the item height in pixels.")]
174 get {
return m_nHt; }
180 [Description(
"Specifies the item width in pixels.")]
183 get {
return m_nWd; }
189 [Description(
"Specifies the item colors - 1 channel = black/white, 3 channels = RGB color.")]
192 get {
return m_nCh; }
198 [Description(
"Specifies whether or not the each data point represents a real or integer number. Integer numbers are used for black/white and color images where each data point falls within the range [0 - 255].")]
201 get {
return m_bIsRealData; }
207 [Description(
"Specifies the number of images within this data source.")]
210 get {
return m_nImageCount; }
216 [Description(
"Specifies the number of inactive images within this data source.")]
219 get {
return m_nInactiveCount; }
228 m_nInactiveCount = nCount;
234 [Description(
"Lists the number of images for each label associated with this data source.")]
238 get {
return m_strLabelCounts; }
239 set { m_strLabelCounts = value; }
248 return "Source Description " +
Name;
254 [Description(
"Specifies the parameters of the data source (if any).")]
257 get {
return m_colParameters; }
258 set { m_colParameters = value; }
267 get {
return m_temporalDesc; }
268 set { m_temporalDesc = value; }
The BaseDescriptor is the base class for all other descriptors, where descriptors are used to describ...
string Owner
Get/set the owner of the item.
int ID
Get/set the database ID of the item.
string Name
Get/set the name of the item.
The LabelDescriptor class describes a single label.
The ParameterDescriptorCollection class contains a list of ParameterDescriptor's.
void Add(ParameterDescriptor p)
Adds a ParameterDescriptor to the collection.
ParameterDescriptorCollection()
The ParameterDescriptorCollection constructor.
The ParameterDescriptor class describes a parameter in the database.
The SourceDescriptor class contains all information describing a data source.
int InactiveImageCount
Returns the number of inactive images within this data source.
void SetInactiveImageCount(int nCount)
Set the number of inactive images within this data source.
void Resize(int nChannels, int nHeight, int nWidth)
Resize the testing and training data sources.
int CopyOfSourceID
Get/set the Source ID from which this source was copied. If this Source is an original,...
override string ToString()
Return a string representation of thet SourceDescriptor.
bool IsRealData
Returns whether or not the each data point represents a real or integer number. Integer numbers are u...
List< LabelDescriptor > Labels
Get/set the list of LabelDescriptors that describe the labels used by the data items.
void Copy(SourceDescriptor sd)
Copy another SourceDesciptor into this one.
int Height
Returns the height of each data item in the data source.
SourceDescriptor(string strName, bool bSaveImagesToFile)
The SourceDescriptor constructor.
SourceDescriptor(int nID, string strName, int nWd, int nHt, int nCh, bool bIsRealData, bool bSaveImagesToFile, int nCopyOfSourceId=0, string strOwner=null, int nCount=0, List< LabelDescriptor > rgLabels=null, string strLabelCounts=null, byte[] rgbTemporal=null)
The SourceDescriptor constructor.
bool SaveImagesToFile
Gets whether or not the images are saved to the file system (true), or directly to the database (fals...
SourceDescriptor(SourceDescriptor s)
The SourceDescriptor constructor.
int Width
Returns the width of each data item in the data source.
TemporalDescriptor TemporalDescriptor
Get/set the temporal descriptor (if any).
ParameterDescriptorCollection Parameters
Get/set the source parameters (if any).
string LabelCountsAsText
Get/set a string that lists the number of images for each label associated with this data source.
int ImageCount
Returns the number of images within this data source.
int Channels
Returns the item colors - 1 channel = black/white, 3 channels = RGB color.
The TemporalDescriptor is used to describe a temporal aspects of the data source.
static TemporalDescriptor FromBytes(byte[] rgb)
Returns a new TemporalDescriptor from a byte array.
The descriptors namespace contains all descriptor used to describe various items stored within the da...