コード例 #1
0
 internal bool ExistsIn(CraterList trainingData)
 {
     bool found = false;
     foreach (CraterInfo crater in trainingData.craters)
     {
         if (this.Overlaps(crater))
             found = true;
     }
     return found;
 }
コード例 #2
0
 public void LoadFile(string filename)
 {
     //////
     foreach (string line in File.ReadAllLines(filename))
     {
         CraterList list = new CraterList(line);
         craterLists.Add(list.name, list);
     }
     /////\
 }
コード例 #3
0
        public List<CraterInfo> GetFalseNegatives(CraterList trainingData)
        {
            List<CraterInfo> falseNegatives = new List<CraterInfo>();

            foreach (CraterInfo trainingCrater in trainingData.craters)
            {
                if (!trainingCrater.ExistsIn(this))
                {
                    falseNegatives.Add(trainingCrater);
                }
            }

            return falseNegatives;
        }
コード例 #4
0
        public List<CraterInfo> GetFalsePositives(CraterList trainingData)
        {
            List<CraterInfo> falsePositives = new List<CraterInfo>();

            foreach (CraterInfo detectedCrater in this.craters)
            {
                if (!detectedCrater.ExistsIn(trainingData))
                {
                    falsePositives.Add(detectedCrater);
                }
            }

            return falsePositives;
        }
コード例 #5
0
        /// <summary>
        /// Creates a completely NEW image using the specified source data
        /// </summary>
        /// <param name="data"></param>
        public DataImage(byte[] data)
        {
            if (sequentialNamingNumber == null)
                sequentialNamingNumber = new Dictionary<string, int>();

            //Create unique name
            int temp;
            if (!sequentialNamingNumber.TryGetValue(CurrentImageName, out temp))
            {
                sequentialNamingNumber.Add(CurrentImageName, 0);
            }
            sequentialNamingNumber[CurrentImageName]++;
            name = CurrentImageName + "_" + sequentialNamingNumber[CurrentImageName];

            //Set data arrays
            this.data = new byte[data.Length];
            data.CopyTo(this.data, 0);

            //Set width, height
            if (data.Length < 260000)
            {
                width = 600;
                height = 400;
            }
            if (data.Length > 1000000)
            {
                width = 1432;
                height = 1432;
            }

            clusters = new List<Cluster>();
            children = new List<DataImage>();
            craters = new CraterList();

            //Create Win32 image
            //////
            if (CreateWIN32ImageEnabled)
                image = CreateImage();
            /////\
            isChanged = true;
        }