示例#1
0
        private void SaveEntropyImage()
        {
            PointCloud pc = MetaDataBase.ToPointCloud(this.ColorMetaData, this.DepthMetaData, this.BodyMetaData, this.coordinateMapper);

            System.Drawing.Image bitmapCustom = bitmapEntropy.UpdateFromPointCloud_Color(pc, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);
            bitmapCustom.SaveImage(PathModels, "PointCloud_", true);
        }
示例#2
0
        public System.Drawing.Image ToTexture()
        {
            PointCloud pc = MetaDataBase.ToPointCloud(this.ColorMetaData, this.DepthMetaData, this.BodyMetaData, this.coordinateMapper);

            Bitmap bmp = new Bitmap(MetaDataBase.XDepthMaxKinect, MetaDataBase.YDepthMaxKinect, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            System.Drawing.Image bitmapCustom = bmp.UpdateFromPointCloud_Color(pc, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);
            return(bitmapCustom);
        }
示例#3
0
        public override bool SavePointCloud(string path, string fileName)
        {
            try
            {
                if (ColorMetaData == null || DepthMetaData == null)
                {
                    return(false);
                }

                //List<int> listToBeRemoved = new List<int>();
                PointCloud     pc    = MetaDataBase.ToPointCloud(this.ColorMetaData, this.DepthMetaData, this.BodyMetaData, this.coordinateMapper);
                List <Vector3> vList = new List <Vector3>();
                List <Vector3> cList = new List <Vector3>();;
                if (PointCloudScannerSettings.ShowFaceScanEllipse)
                {
                    for (int i = pc.Count - 1; i >= 0; i--)
                    {
                        bool add = true;
                        if (pc.Vectors[i].X > 0 && pc.Vectors[i].X > faceX)
                        {
                            add = false;
                        }
                        else if (pc.Vectors[i].X < 0 && pc.Vectors[i].X < -faceX)
                        {
                            add = false;
                        }
                        else if (pc.Vectors[i].Y > 0 && pc.Vectors[i].Y > faceY)
                        {
                            add = false;
                        }
                        else if (pc.Vectors[i].Y < 0 && pc.Vectors[i].Y < -faceY)
                        {
                            add = false;
                        }

                        if (add)
                        {
                            vList.Add(pc.Vectors[i]);
                            cList.Add(pc.Colors[i]);
                        }
                    }
                }
                PointCloud pcNew = new OpenTKExtension.PointCloud(vList, cList, null, null, null, null);

                //pc.RemovePoints(listToBeRemoved);
                return(UtilsPointCloudIO.ToObjFile_ColorInVertex(pcNew, path + "\\" + fileName));
            }
            catch (Exception err)
            {
                System.Windows.Forms.MessageBox.Show("SW Error - error saving Point cloud: " + err.Message);
                return(false);
            }
        }
示例#4
0
        public override PointCloudRenderable ToPointCloudRenderable(bool resizeTo1)
        {
            //string directory = GLSettings.Path + GLSettings.PathModels + "\\Nick";
            //string[] files = IOUtils.FileNamesSorted(directory, "*.obj");


            //PointCloud pc1 = PointCloud.FromObjFile(files[0]);
            //PointCloudRenderable pcr1 = new PointCloudRenderable();
            //pcr1.PointCloud = pc1;
            //return pcr1;


            if (this.ColorMetaData != null && this.DepthMetaData != null)
            {
                PointCloud pc = MetaDataBase.ToPointCloud(this.ColorMetaData, this.DepthMetaData, this.BodyMetaData, this.coordinateMapper);

                PointCloudRenderable pcr = new PointCloudRenderable();
                pcr.PointCloud = pc;

                return(pcr);
            }
            return(null);
        }
示例#5
0
        public override void ShowPointCloud()
        {
            this.StopScanner();
            if (SaveAll())
            {
                OpenTKExtension.TestForm fb = new TestForm();

                PointCloud pc = MetaDataBase.ToPointCloud(this.ColorMetaData, this.DepthMetaData, this.BodyMetaData, this.coordinateMapper);
                if (pc == null || pc.Count == 0)
                {
                    System.Windows.Forms.MessageBox.Show("Not available point Cloud - please scan first");
                }
                else
                {
                    fb.Show();
                    fb.UpdatePointCloud(pc);
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Not available point Cloud - please scan first");
            }
        }