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;
44 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)
45 : base(nID, strName, strOwner)
50 m_bIsRealData = bIsRealData;
51 m_nImageCount = nCount;
52 m_strLabelCounts = strLabelCounts;
53 m_rgLabels = rgLabels;
54 m_bSaveImagesToFile = bSaveImagesToFile;
55 m_nCopyOfSourceID = nCopyOfSourceId;
64 : this(0, strName, 0, 0, 0, false, bSaveImagesToFile)
73 : this(s.
ID, s.
Name, s.
ImageWidth, s.
ImageHeight, s.
ImageChannels, s.
IsRealData, s.
SaveImagesToFile, s.
CopyOfSourceID, s.
Owner, s.
ImageCount, s.
Labels, s.
LabelCountsAsText)
76 m_nInactiveCount = s.m_nInactiveCount;
91 m_nImageCh = sd.m_nImageCh;
92 m_nImageHt = sd.m_nImageHt;
93 m_nImageWd = sd.m_nImageWd;
94 m_bIsRealData = sd.m_bIsRealData;
95 m_nImageCount = sd.m_nImageCount;
96 m_nInactiveCount = sd.m_nInactiveCount;
97 m_bSaveImagesToFile = sd.m_bSaveImagesToFile;
98 m_nCopyOfSourceID = sd.m_nCopyOfSourceID;
100 m_rgLabels =
new List<descriptors.LabelDescriptor>();
103 m_rgLabels.Add(
new descriptors.LabelDescriptor(ld));
112 m_strLabelCounts = sd.m_strLabelCounts;
121 public void Resize(
int nChannels,
int nHeight,
int nWidth)
123 m_nImageCh = nChannels;
124 m_nImageHt = nHeight;
131 [Description(
"Specifies whether the images are saved to the file system or directly to the database.")]
134 get {
return m_bSaveImagesToFile; }
140 [Description(
"If this source was copied from another source, this property returns the ID of the original Source, otherwise 0 is returned.")]
144 get {
return m_nCopyOfSourceID; }
145 set { m_nCopyOfSourceID = value; }
154 get {
return m_rgLabels; }
155 set { m_rgLabels = value; }
161 [Description(
"Specifies the image height in pixels.")]
164 get {
return m_nImageHt; }
170 [Description(
"Specifies the image width in pixels.")]
173 get {
return m_nImageWd; }
179 [Description(
"Specifies the image colors - 1 channel = black/white, 3 channels = RGB color.")]
182 get {
return m_nImageCh; }
188 [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].")]
191 get {
return m_bIsRealData; }
197 [Description(
"Specifies the number of images within this data source.")]
200 get {
return m_nImageCount; }
206 [Description(
"Specifies the number of inactive images within this data source.")]
209 get {
return m_nInactiveCount; }
218 m_nInactiveCount = nCount;
224 [Description(
"Lists the number of images for each label associated with this data source.")]
228 get {
return m_strLabelCounts; }
229 set { m_strLabelCounts = value; }
238 return "Source Description " +
Name;
244 [Description(
"Specifies the parameters of the data source (if any).")]
247 get {
return m_colParameters; }
248 set { m_colParameters = 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.
SourceDescriptor(string strName, bool bSaveImagesToFile)
The SourceDescriptor constructor.
int ImageWidth
Returns the width of each data item in the data source.
int ImageChannels
Returns the image colors - 1 channel = black/white, 3 channels = RGB color.
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 ImageHeight
Returns the height of each data item in the data source.
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.
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)
The SourceDescriptor constructor.
int ImageCount
Returns the number of images within this data source.
The descriptors namespace contains all descriptor used to describe various items stored within the da...