Features.BitExact.run C# (CSharp) Méthode

run() public méthode

public run ( ) : void
Résultat void
        public void run()
        {
            float realRunStatus = 0;
            try
            {
                setPropotion(); // set propotion to images
                for (int i = 0; i < numImages - 1; i++)
                {
                    int equalToImage = 0;
                    if (checkedImages[i] || (propotions[i] == Propotion.pOther)) //if we founded match then don't check the image
                    {
                        continue;
                    }
                    for (int j = i + 1; j < numImages; j++)
                        if (propotions[i] == propotions[j] && (!checkedImages[j])) //check only images with similar propotions
                        {
                            if(equalImagesFast(i, j)) //equal is true if there is a match
                                equalToImage++;
                        }

                    realRunStatus += (float)(1 + equalToImage) / numImages;
                    runStatus = (int)(Math.Min(Math.Round(realRunStatus*100), 99));
                }
                runStatus = 100;
                // set results
                results = new BitExactRes(matches);
            }
            catch (ThreadAbortException)
            { // ResetAbout() handles and the exception and letting the thread
              // finish normally (reaching the end of the function)
                Thread.ResetAbort();
            }
        }

Usage Example

Exemple #1
0
        public void TestBitExactLoadPictures()
        {
            int numImages = pathes.Length;
            ImageInfo[] images = new ImageInfo[numImages];

            for (int i = 0; i < numImages; i++)
                images[i] = new ImageInfo(pathes[i]);

               // int w=24, j=22;
            BitExact be = new BitExact(images);
            //be.equalImages(w, j);
            //Debug.WriteLine("{0} \n {1}", images[w].getPath(), images[j].getPath());
            be.run();
            Debug.WriteLine("{0}", "OK!!!");
        }