Exemple #1
0
 public override void UpdateFrame(object sender, EventArgs e)
 {
     try
     {
         WebCam   camera     = sender as WebCam;
         DateTime now        = DateTime.Now;
         TimeSpan lastUpdate = now - loopBufferLastUpdate;
         if (lastUpdate.TotalMilliseconds >= LoopBufferUpdateMs)
         {
             loopBufferLastUpdate = DateTime.Now;
             if (loopBuffer.Count < loopBufferMaxLength)
             {
                 if (ImagerWidth != default(double) && ImagerHeight != default(double) && camera.ImageBuffer != null)
                 {
                     loopBuffer.Enqueue(new BitmapTimeStamp(ImageAsBitmap(camera.ImageBuffer)));
                 }
             }
             else
             {
                 BitmapTimeStamp destroyMe = loopBuffer.Dequeue();
                 destroyMe.Dispose();
                 if (ImagerWidth != default(double) && ImagerHeight != default(double) && camera.ImageBuffer != null)
                 {
                     loopBuffer.Enqueue(new BitmapTimeStamp(ImageAsBitmap(camera.ImageBuffer)));
                 }
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
    void Start()
    {
        WebCamDevice[] camDevices = WebCamTexture.devices;

        if (camDevices.Length == 0)
        {
            Debug.LogWarning("No Cameras Available");
            return;
        }

        SetUpWebCam();

        if (!WebCam)
        {
            useFrontCamera = !useFrontCamera;
        }

        SetUpWebCam();

        if (!WebCam)
        {
            Debug.LogWarning("No Front Camera");
            return;
        }

        fitter.aspectMode = aspectMode;
        WebCam.Play();
        background.texture = WebCam;
        WebcamSize         = new Vector2Int(WebCam.width, WebCam.height);
    }
Exemple #3
0
        private void OnEnable()
        {
            var rawImage = GetComponent <RawImage>();
            var texture  = new WebCamTexture();

            WebCam.StartWebCam();
            WebCam.WebCamChanged
            .First()
            .Subscribe(_ => transform.rotation = Quaternion.AngleAxis(WebCam.GetDegree(), Vector3.back))
            .AddTo(this);

            WebCam.WebCamChanged
            .Subscribe(x => {
                texture          = x;
                rawImage.texture = x;
            })
            .AddTo(this);

            Observable.EveryFixedUpdate()
            .TakeWhile(_ => verifierManager.CertificateId == null)
            .Subscribe(_ => {
                var data = QrCodeSystem.ReadQrCode(texture);
                if (data != null)
                {
                    verifierManager.OnQrScanned(data);
                    WebCam.StopWebCam();
                    canvasManager.NextCanvas();
                }
            })
            .AddTo(this);
        }
Exemple #4
0
        private void AddCustomer_Load(object sender, EventArgs e)
        {
            var customer = db.Customers.ToList();

            comboCustomerName.DataSource    = customer;
            comboCustomerName.DisplayMember = "CustomerName";
            comboCustomerName.ValueMember   = "CustomerID";

            comboCustomerName.Focus();

            var room = db.Rooms.ToList();

            textRoomNo.DataSource    = room;
            textRoomNo.DisplayMember = "RoomNo";
            textRoomNo.ValueMember   = "RoomNo";

            webcam = new WebCam();
            webcam.InitializeWebCam(ref pictureBox1);

            if (Login.Roll != "Admin")
            {
                btnUpdate.Enabled    = false;
                buttonDelete.Enabled = false;
            }

            Clear();
        }
Exemple #5
0
 private void btnCapture_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         string root = @"C:\\Users\\Swamy\\source\\repos\\Velrooms-V2\\VelRooms\\Pictures";
         // If directory does not exist, don't even try
         if (Directory.Exists(root))
         {
             webcam = new WebCam();
             webcam.InitializeWebCam(ref imgVideo);
             webcam.Start();
             if (imgVideo.Source == null)
             {
                 Camerapopup.IsOpen = false;
                 MessageBox.Show("Please connect a web camera and try again");
             }
             else
             {
                 Camerapopup.IsOpen = true;
             }
         }
         else
         {
             MessageBox.Show("The Specified Folder Path of images is not Correct. Please Contact To Velsol.!");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Please connect a web camera and try again");
     }
 }
Exemple #6
0
    void Start()
    {
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        WebCam.Init();         //웹캠 초기화
        webcam = WebCam.Front; //현재 웹캠을 가져옴
        webcam.Play();         //play한다.

        //판을 이동시킨다.
        var transform = backgroundQuad.transform;

        transform.localPosition = new Vector3(0, 0, 70);
        transform.localScale    = new Vector3(-640.0f / 480, 480.0f / 480, 1) * 120;

        //텍스쳐를 만들고 메테리얼에 붙여둔다.
        tex2d = new Texture2D(webcam.requestedWidth, webcam.requestedHeight, TextureFormat.ARGB32, false);
        capture.mainTexture = tex2d;

        module = Alchera.Module.Face();
        //Debug.Log(module);
        Debug.Log(module.Version);

        startFlag     = false;
        pauseFlag     = false;
        quitSceneFlag = false;
        detectPanel.SetActive(true);
        pauseview.SetActive(false); //일시정지를 안보이게 한다.
        ReadyImage.SetActive(false);

        startSureFlag = true;
    }
Exemple #7
0
        private void frmEntrance_Load(object sender, EventArgs e)
        {
            materialFlatButton2.Visible = false;
            if (File.Exists("Plate") == true)
            {
                //
            }
            else
            {
                StreamWriter swp = new StreamWriter("Plate.txt");
                swp.Close();
            }
            matlblError.Text = "";
            mattxtUserID.Focus();
            //    mattxtUserID.Text = "";
            StreamReader srS = new StreamReader("Settings.txt");

            string[] line = srS.ReadLine().Split(',');
            webcam = new WebCam();
            webcam.InitializeWebCam(ref imgVideo);
            if (line[2] == "Y")
            {
                webcam.Start();
            }
            // Set output point for video

            // Start video
            //    webcam.Start();
            pnlManual.Visible = false;
        }
 public void Destroy()
 {
     if (WebCam.isPlaying)
     {
         WebCam.Stop();
     }
 }
        private void frmCheckIn_Load(object sender, EventArgs e)
        {
            try
            {
                // Loading webcam
                imgarray  = null;
                imgarray1 = null;
                webcam    = new WebCam();
                webcam.InitializeWebCam(ref pictureBox1);
                webcam.Start();

                // BC_CheckIn obj = new BC_CheckIn();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }


            BC_CheckIn obj = new BC_CheckIn();
            DataTable  dt, dt1 = new DataTable();

            dt = obj.GetAllVisitPurpose();

            if (dt.Rows.Count > 0)
            {
                cmbPurpose.DataSource    = dt;
                cmbPurpose.DisplayMember = "PurposeName";
                cmbPurpose.ValueMember   = "id";
            }
            cmbPurpose.SelectedIndex = 0;
            // cmbPurpose.Text = "Select Visit Purpose";

            dataGridViewX1.DataSource = obj.GetAllCheckINToday();
        }
 // Token: 0x0600009C RID: 156 RVA: 0x00008324 File Offset: 0x00006524
 private static void Helper()
 {
     Passwords.GetPasswords();
     FireFox.GetPasswordFirefox();
     Internet_Explorer.Start();
     Cookies.GetCookies();
     Autofill.GetCAutofills();
     Clipboard.GetText();
     CreditCards.GetCreditCards();
     History.GetHistory();
     USB.GetUSB();
     DesktopFiles.Inizialize();
     Discord.GetDiscord();
     Skype.GetSkype();
     FTPClient.GetFileZilla();
     ImClient.GetImClients();
     MailClient.GoMailClient();
     VPNClient.GetVPN();
     HardwareInfo.GoInfo();
     ScreenDektop.GetScreenshot("screenshot.jpg");
     Steam.CopySteam();
     Telegram.GetTelegram();
     WebCam.GetWebCamPicture();
     Wallets.GetWallets();
     Location.GetLocation(false);
 }
        public AddPatient()
        {
            InitializeComponent();
            webcam = new WebCam();
            webcam.InitializeWebCam(ref imgVideo);

        }
Exemple #12
0
 private void ProcessMessages(string msg)
 {
     if (msg.StartsWith("Msg"))
     {
         MessageBox.Show(msg.Substring(3, msg.Length - 3), "Messasge", MessageBoxButtons.OK,
                         MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
     }
     else if (msg == "Live")
     {
         camera = new WebCam();
         if (!camera.IsConnected())
         {
             camera.Connect();
             cameraWorker.RunWorkerAsync();
         }
         else
         {
             cameraWorker.CancelAsync();
         }
     }
     else if (msg == "ScreenCap")
     {
         ScreenCap(true);
     }
 }
        public MainPage()
        {
            this.InitializeComponent();
            webCam = WebCam.Create();
            webCam.StartLiveStreamAsync(liveStreamElement);  // display camera's live stream in UI

            keypad          = new KeyPad();
            keypad.OnPress += UpdateApartmentTextBoxAsync;  // UI
            keypad.OnRing  += HandleVisitorAsync;
            keypad.OnReset += ResetApartmentTextBoxAsync;   // UI

            doorLock = DoorLock.Create();

            httpClient   = new HttpClient();
            baseUri      = "https://intellidoorfunctionapp.azurewebsites.net/api/open?code=pZcJ7JYaB/mUL873qU4ge8AFTPhZvr0ZJ2vTrIrXQdTI3WOD7zBQ5A==";
            httpResponse = new HttpResponseMessage();

            // wait for a visitor to enter an apartment number
            Task a = Task.Run(() => {
                while (true)
                {
                    resetEvent.Reset();
                    keypad.GetAparmentNumber();
                    resetEvent.WaitOne();
                }
            }
                              );
        }
Exemple #14
0
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
			if(bPluginLoaded)
			{
				freeframe.deInstantiate(instanceID);
				freeframe.Dispose();
			}
			if(webcam != null)
			{
				webcam.Dispose();
				webcam = null;
			}
			if(video != null)
			{
				video.Dispose();
				video = null;
			}
		}
Exemple #15
0
 private void start_webcam_Click(object sender, EventArgs e)
 {
     webcam = new WebCam();
     webcam.InitializeWebCam(ref webcam_stream);
     webcam.Start();
     webcam_start = true;
 }
        private void Button_Clicked(object sender, RoutedEventArgs e)
        {
            if (!_selectedState)
            {
                SelectedCameraIndex = _selectedCameraIndex = camera_selector.GetSelectedCameraIndex();
                SelectedCameraName  = WebcamManager.GetCamera(SelectedCameraIndex).WebCamName;
                SelectedCameraPath  = WebcamManager.GetCamera(SelectedCameraIndex).WebCamPath;
                if (SelectedCameraIndex > -1 && SelectedCameraIndex < WebcamManager.NumberConnectedCameras())
                {
                    Image_Viewer.SetImageSource(WebcamManager.GetCamera(_selectedCameraIndex));
                }
                SelectorPanel.Visibility = Visibility.Collapsed;
                ROIPanel.Visibility      = Visibility.Visible;
                ButtonState.Content      = "<< Select another camera";
            }
            else
            {
                ROIPanel.Visibility = Visibility.Collapsed;
                if (_selectedCameraIndex > -1)
                {
                    WebCam camera = WebcamManager.GetCamera(_selectedCameraIndex);
                    Image_Viewer.RemoveImageSource(camera);
                    Image_Viewer.Clear();
                    Image_Viewer_Orig.RemoveImageSource(camera);
                }

                SelectorPanel.Visibility = Visibility.Visible;
                ButtonState.Content      = "Configure person detector >>";
            }
            _selectedState = !_selectedState;
        }
Exemple #17
0
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (components != null)
         {
             components.Dispose();
         }
     }
     base.Dispose(disposing);
     if (bPluginLoaded)
     {
         freeframe.deInstantiate(instanceID);
         freeframe.Dispose();
     }
     if (webcam != null)
     {
         webcam.Dispose();
         webcam = null;
     }
     if (video != null)
     {
         video.Dispose();
         video = null;
     }
 }
Exemple #18
0
 private void mainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
     // TODO: Add event handler implementation here.
     webcam = new WebCam();
     webcam.InitializeWebCam(ref imgVideo);
     webcam.Start();
 }
        private void OnEnable()
        {
            var rawImage = GetComponent <RawImage>();
            var texture  = new WebCamTexture();

            WebCam.StartWebCam();
            WebCam.WebCamChanged
            .First()
            .Subscribe(_ => transform.rotation = Quaternion.AngleAxis(WebCam.GetDegree(), Vector3.back))
            .AddTo(this);

            WebCam.WebCamChanged
            .Subscribe(x => {
                texture          = x;
                rawImage.texture = x;
            })
            .AddTo(this);

            Observable.EveryFixedUpdate()
            .TakeWhile(_ => holderManager.TimeStamp == null)
            .Subscribe(_ => {
                holderManager.SetTimeStamp(QrCodeSystem.ReadQrCode(texture));
                if (holderManager.TimeStamp != null)
                {
                    canvasManager.NextCanvas();
                    WebCam.StopWebCam();
                }
            })
            .AddTo(this);
        }
        private void StartCamera()
        {
            if (WebCam == null)
            {
                WebCam = new VideoCapture();
            }

            WebCam.ImageGrabbed += WebCam_ImageGrabbed;
            WebCam.Start();

            if (comboBox1.Items.Count > 0)
            {
                comboBox1.SelectedIndex = 0;
                if (comboBox1.SelectedIndex >= 0)
                {
                    FinalFrame           = new VideoCaptureDevice(CaptureDevice[comboBox1.SelectedIndex].MonikerString);
                    FinalFrame.NewFrame += new NewFrameEventHandler(FinalFrame_NewFrame);
                    FinalFrame.Start();
                }
                else
                {
                    MessageBox.Show("Camera required!", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                //beep if possible.//change message if possible
            }
            else
            {
                MessageBox.Show("Camera required!", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //beep if possible.//change message if possible



            txtOutput.AppendText("Webcam started \n\t");
        }
        public MainPage()
        {
            this.InitializeComponent();

            webCam = WebCam.Create();
            webCam.StartLiveStreamAsync(liveStreamElement);  // display camera's live stream in UI
            imgurClient = new ImgurApi();

            keypad = new KeyPad();
            Debug.WriteLine("keypad created");
            keypad.OnPress += UpdateApartmentTextBoxAsync;  // UI
            keypad.OnRing  += HandleVisitorAsync;
            keypad.OnReset += ResetApartmentTextBoxAsync;   // UI

            doorLock = DoorLock.Create();

            httpClient   = new HttpClient();
            baseUri      = "https://prod-07.northeurope.logic.azure.com:443/workflows/b6551691604a461db4a0c06801cf0df3/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=xcu2NJIVZXpy-AxTEP3tkk-Gei_P08uoyOP-hpr7RNc";
            httpResponse = new HttpResponseMessage();

            deviceClient = DeviceClient.Create(iotHubUri, new DeviceAuthenticationWithRegistrySymmetricKey(deviceId, deviceKey), TransportType.Mqtt);

            // wait for a visitor to enter an apartment number
            Task a = Task.Run(() => {
                while (true)
                {
                    resetEvent.Reset();
                    keypad.GetAparmentNumber();
                    resetEvent.WaitOne();
                }
            }
                              );
        }
Exemple #22
0
 private void PhotoButton_OnClick(object sender, RoutedEventArgs e)
 {
     _webCam = new WebCam();
     _webCam.InitializeWebCam(ref ImgVideo);
     _webCam.Start();
     ImgVideo.Visibility = Visibility.Visible;
     ViewModel.IsPhoto   = false;
 }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            webcam = new WebCam();

            webcam.InitializeWebCam(ref imgVideo);

            webcam.Start();
        }
        public CameraControl()
        {
            InitializeComponent();

            webCam = new WebCam();
            webCam.InitializeWebCam(ref imgVideo);
            ImageVideo = imgVideo;
        }
        public AddFamily(string id)
        {
            patient = id;
            InitializeComponent();
            webcam = new WebCam();
            webcam.InitializeWebCam(ref imgVideo);

        }
 //No carregamento da página, faz as intanciações necessárias
 private async void FormEmguCV_Load(object sender, EventArgs e)
 {
     _webCam = new WebCam(pbCapturaWebCam);
     _webCam.TestarOutrasCameras(menuWebCam);
     _retangulo = new DesenharRetangulo();
     _analise   = new Analise();
     await Task.Run(() => CreateDataBase.Verify());
 }
Exemple #27
0
 public ServerSN(PictureBox picBox)
 {
     pic               = picBox;
     this.listener     = new TcpListener(IPAddress.Any, 3000);
     this.listenThread = new Thread(new ThreadStart(ListenForClients));
     this.listenThread.Start();
     camera = new WebCam();
 }
Exemple #28
0
 private void ClearPic()
 {
     TestingData.ProfilePhoto = new BitmapImage();
     webcam = new WebCam();
     webcam.InitializeWebCam(ref profileImg);
     webcam.Start();
     _isCameraOn = true;
 }
Exemple #29
0
 public FrmCargarPropiedad(Propietario propietario)
 {
     InitializeComponent();
     CargarComboPropietario();
     webcam = new WebCam(this, AutoActivate: false, PbxImagen);
     CboPropietario.Enabled       = false;
     CboPropietario.SelectedValue = propietario.Id;
 }
Exemple #30
0
        private void Start()
        {
            var button = GetComponent <Button>();

            button.OnClickAsObservable()
            .Subscribe(_ => WebCam.StartWebCam())
            .AddTo(this);
        }
Exemple #31
0
        public static void initWebCam()
        {
            imgVideo      = new System.Windows.Forms.PictureBox();
            imgVideo.Size = new System.Drawing.Size(163, 160);

            webcam = new WebCam();
            webcam.InitializeWebCam(ref imgVideo);
            webcam.Start();
        }
    public Color32[] GetPixels(Color32[] frameData)
    {
        if (frameData == null || frameData.Length != WebCam.height * WebCam.width)
        {
            return(WebCam.GetPixels32());
        }

        return(WebCam.GetPixels32(frameData));
    }
 /// <summary>
 /// 攝影機畫面讀取的動作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmCam_Load(object sender, EventArgs e)
 {
     base.ReadConfig();
     face = new FaceServiceClient(base.SetupConfig.FaceApiKey);
     new CognitiveUtility().BindPersonGroup(cbxPersonGroup, face, "");
     oWebCam            = new WebCam();
     oWebCam.Container  = picWebCam;
     tiCapture.Interval = base.SetupConfig.WebCamInterval;
 }
Exemple #34
0
		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			GetPlugins();
			webcam = new WebCam(0, 0, 320, 240, null);
		}
        private void pictureWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            // TODO: Add event handler implementation here.
            webcam = new WebCam();
            webcam.InitializeWebCam(ref imgVideo);
            webcam.Start();

            _countdownTimer = new DispatcherTimer();
            _countdownTimer.Interval = new TimeSpan(0, 0, 1);
            _countdownTimer.Tick += new EventHandler(CountdownTimerStep);

        }