예제 #1
0
        public RegistrationProcessorTests()
        {
            _displayName = "7r78";
            _email       = "*****@*****.**";
            _password    = "******";

            _authenticationService = new Mock <IAuthenticationService>();
            _processor             = new RegistrationProcessor(_authenticationService.Object);
            _player = new Player("Wktb8xUwmyZCtqUF7qvAGXeWPCt2", _displayName, _email);
        }
예제 #2
0
        private static void startImageProcessing(Bitmap A, Bitmap B, string outputfolder)
        {
            ImageProcessor        imageProcessor        = new ImageProcessor();
            Exporter              exporter              = new Exporter();
            RegistrationProcessor registrationProcessor = new RegistrationProcessor();



            //Create binary image of A with otsu threshold and save
            Bitmap image1bin = imageProcessor.createBinaryOtsu(A);

            image1bin.Save(outputfolder + "\\Abin.png", ImageFormat.Png);

            //Create binary image of B with otsu threshold and save
            Bitmap image2bin = imageProcessor.createBinaryOtsu(B);

            image2bin.Save(outputfolder + "\\Bbin.png", ImageFormat.Png);

            //Find contour of A - Only longest!
            List <Contour <Point> > contours_image1 = imageProcessor.findContoursWithOpenCV(image1bin);

            exporter.exportToCSV(contours_image1, outputfolder, "contourA.csv");
            Bitmap contour_image1 = exporter.exportToImage(contours_image1, outputfolder, "contourA.png", A.Height, A.Width);

            //Find contour of B - Only longest!
            List <Contour <Point> > contours_image2 = imageProcessor.findContoursWithOpenCV(image2bin);

            exporter.exportToCSV(contours_image2, outputfolder, "contourB.csv");
            Bitmap contour_image2 = exporter.exportToImage(contours_image2, outputfolder, "contourB.png", B.Height, B.Width);

            //Calculate transformation with help of the two contours
            try
            {
                Transformation t1 = registrationProcessor.calculateTransformation(contours_image1, contours_image2);
                //Start registration of contours
                Bitmap registrated_Contours = registrationProcessor.registrationContour(t1, contour_image1, contour_image2);
                registrated_Contours.Save(outputfolder + "\\contoursR.png", ImageFormat.Png);

                //Start registration of orginial images
                Bitmap registrated_originals = registrationProcessor.registrationBitmap(t1, A, B);
                registrated_originals.Save(outputfolder + "\\registration.png", ImageFormat.Png);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
        public ActionResult SignUp(ClientRegistrationModel model)
        {
            if (ModelState.IsValid)
            {
                /*If client already has an account and tries to sign up again*/
                HttpCookie cookie           = new HttpCookie("UserInfo");
                int        UserCredentialId = RegistrationProcessor.IsClientExists(model.Username, model.Password);
                if (UserCredentialId != 0) //If Client has an acount
                {
                    return(RedirectToAction("Login", "Login"));
                }

                else
                {
                    int recordsCreated = RegistrationProcessor.CreateClient(model.Username, model.Password);
                    UserCredentialId = RegistrationProcessor.IsClientExists(model.Username, model.Password);
                    cookie["UserID"] = UserCredentialId.ToString();
                    Response.Cookies.Add(cookie);
                    return(RedirectToAction("Create", "ClientProfile"));
                }
            }
            return(View());
        }
예제 #4
0
        public void CreateRegistration(Person person)
        {
            Course course = RegistrationProcessor.Create(person);

            // more processing of Registration here
        }