Beispiel #1
0
        private List <InputFileModel> GetInputFromStereoCamera(int countInputFile)
        {
            cameraManager.LeftCamera.camera.Grab();
            cameraManager.RightCamera.camera.Grab();
            Mat LeftImage  = new Mat();
            Mat RightImage = new Mat();

            cameraManager.LeftCamera.camera.Retrieve(LeftImage);
            cameraManager.LeftCamera.camera.Retrieve(RightImage);
            LeftImage.Save(Path.Combine($@"{tempDirectory}", $"Left_{countInputFile}.JPG"));
            RightImage.Save(Path.Combine($@"{tempDirectory}", $"Right_{countInputFile}.JPG"));


            var inputFileLeft = new InputFileModel(Path.Combine($@"{tempDirectory}", $"Left_{countInputFile}.JPG"));
            var imageList     = _winForm.ImageList[(int)EListViewGroup.LeftCameraStack];
            var listViewer    = _winForm.ListViews[(int)EListViewGroup.LeftCameraStack];

            fileManager.AddInputFileToList(inputFileLeft, fileManager.listViewerModel.ListOfListInputFolder[(int)EListViewGroup.LeftCameraStack], imageList, listViewer);

            var inputFileRight = new InputFileModel(Path.Combine($@"{tempDirectory}", $"Right_{countInputFile}.JPG"));

            imageList  = _winForm.ImageList[(int)EListViewGroup.RightCameraStack];
            listViewer = _winForm.ListViews[(int)EListViewGroup.RightCameraStack];
            fileManager.AddInputFileToList(inputFileLeft, fileManager.listViewerModel.ListOfListInputFolder[(int)EListViewGroup.RightCameraStack], imageList, listViewer);

            var returnList = new List <InputFileModel>();

            returnList.Add(inputFileLeft);
            returnList.Add(inputFileRight);

            return(returnList);
        }
        private void AddDepthMapToListView(Image <Bgr, byte> disparityMap)
        {
            disparityMap.Save(Path.Combine($@"{tempDepthMapDirectory}", $"DepthMap_{_fileManager.listViewerModel.LeftCameraStack.Count}.JPG"));


            var inputFileLeft = new InputFileModel(Path.Combine($@"{tempDepthMapDirectory}", $"DepthMap_{_fileManager.listViewerModel.LeftCameraStack.Count}.JPG"));
            var imageList     = _winForm.ImageList[(int)EListViewGroup.DepthMap];
            var listViewer    = _winForm.ListViews[(int)EListViewGroup.DepthMap];

            _fileManager.AddInputFileToList(inputFileLeft, _fileManager.listViewerModel.ListOfListInputFolder[(int)EListViewGroup.DepthMap], imageList, listViewer);
        }