private void RenderView(int view)
    {
        Vector3 newView = _vm.SetView(view);

        _drm.SetCameraView(newView);
        _currentRendering = _drm.GetDepthRendering();
        HashSet <Vector3> pointCloud = _pcm.CreatePointSet(_currentRendering);

        _ogm.AddPoints(pointCloud);
    }
    public void RenderView(int viewIndex)
    {
        //Redners the current view of the index
        SetView(viewIndex);
        _currentRendering = _drm.GetDepthRendering();
        HashSet <Vector3> pointCloud = _pcm.CreatePointSet(_currentRendering);

        _ogm.AddPoints(pointCloud);
        _rm.ComputeRewards();
    }
Beispiel #3
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.I)) //Changes the camera view
        {
            NextView();
        }

        if (Input.GetKeyDown(KeyCode.O)) //Changes the study object
        {
            NextObject();
        }
        if (Input.GetKeyDown(KeyCode.L)) //Sets the view to the index of the serialized field
        {
            SetView();
        }
        if (Input.GetKeyDown(KeyCode.K))//Skips 10 candidate view indices forward
        {
            Vector3 v = _vm.SetNeighbouringView(10);
            _drm.SetCameraView(v);
        }
        if (Input.GetKeyDown(KeyCode.Z)) // Renders and adds current view to pointcloud
        {
            Texture2D         _currentRendering = _drm.GetDepthRendering();
            HashSet <Vector3> pointCloud        = _pcm.CreatePointSet(_currentRendering);
            _ogm.AddPoints(pointCloud);
        }
        if (Input.GetKeyDown(KeyCode.X)) // Generates a occupancy grid object on the scene
        {
            _ogm.BuildGrid();
        }
        if (Input.GetKeyDown(KeyCode.C)) //Renders the view from image to point cloud to occupancy grid
        {
            RenderView();
        }
        if (Input.GetKeyDown(KeyCode.B))  //Builds the occupancy grid of the current view
        {
            Texture2D         _currentRendering = _drm.GetDepthRendering();
            HashSet <Vector3> pointCloud        = _pcm.CreatePointSet(_currentRendering);
            _pcm.BuildPointCloudObjectFromCloud(new Vector3(4, 0, 0), pointCloud, Vector3.one);
            _ogm.AddPoints(pointCloud);
            _ogm.BuildGrid();
        }

        if (Input.GetKeyDown(KeyCode.G)) //Shows the ground truth of the current object
        {
            VisualizeGrountTruth();
        }
        if (Input.GetKeyDown(KeyCode.Y)) //Logs the distance between the views
        {
            UnityEngine.Debug.Log(_vm.GetDistance(_vm.GetCurrentViewIndex(), _compareViewWith).ToString());
        }
        if (Input.GetKeyDown(KeyCode.M)) //Shows the view sphere representation
        {
            _vm.BuildSphere(Vector3.zero);
        }
        if (Input.GetKeyDown(KeyCode.N)) //Shows the view sphere representation
        {
            _vm.VisualizePath();
        }
        if (Input.GetKeyDown(KeyCode.P)) //Shows the view sphere representation
        {
            _som.PrepareStudyObject(_setObject);
        }
    }