Beispiel #1
0
        //キャリブレーション
        public void CaliblationUpdate(ShadowPackage proccesedMatPckage)
        {
            Mat srcImg = new Mat();
            
            //入力画像
            srcImg = proccesedMatPckage.srcMat.Clone();
            
            this.imgChannles = srcImg.Channels();
            #region
            if (this.fragCutImg == 1)
            {
                this.cutRect = new CutRect(srcImg);
                this.fragCutImg = 0;
                this.imageWidth = srcImg.Width;
                this.imageHeight = srcImg.Height;
            }
            #endregion


            //座標の取得
            this.backIn_Pt = this.changePt(this._getPtForCalib(0));
            this.backOut_Pt = this.changePt(this._getPtForCalib(1));
            this.floorIn_Pt = this.changePt(this._getPtForCalib(2));
            this.floorOut_Pt = this.changePt(this._getPtForCalib(3));
            this.backOut_Pt = this.changePtRange(this.backOut_Pt);
            this.floorOut_Pt = this.changePtRange(this.floorOut_Pt);
           

            //back
            #region
            
            this.backIn_Pt = this.changePtRange(this.backIn_Pt);
            this.backDstImg = this.PerspectiveProject(srcImg, this.backIn_Pt, this.backOut_Pt).Clone();
            this.backDstImg = cutRect.CutImage(this.backDstImg,this.backOut_Pt).Clone();
            #endregion

            //floor
            #region
            
            this.floorIn_Pt = this.changePtRange(this.floorIn_Pt);
            this.floorDstImg = this.PerspectiveProject(srcImg, this.floorIn_Pt, this.floorOut_Pt).Clone();
            this.floorDstImg = cutRect.CutImage(this.floorDstImg, this.floorOut_Pt).Clone();
            #endregion

            srcImg.Dispose();

        }
Beispiel #2
0
        //キャリブレーション
        public void CaliblationUpdate(ShadowPackage proccesedMatPckage)
        {
            Mat srcImg = new Mat();

            //入力画像
            srcImg = proccesedMatPckage.srcMat.Clone();

            this.imgChannles = srcImg.Channels();
            #region
            if (this.fragCutImg == 1)
            {
                this.cutRect     = new CutRect(srcImg);
                this.fragCutImg  = 0;
                this.imageWidth  = srcImg.Width;
                this.imageHeight = srcImg.Height;
            }
            #endregion


            //座標の取得
            this.backIn_Pt   = this.changePt(this._getPtForCalib(0));
            this.backOut_Pt  = this.changePt(this._getPtForCalib(1));
            this.floorIn_Pt  = this.changePt(this._getPtForCalib(2));
            this.floorOut_Pt = this.changePt(this._getPtForCalib(3));
            this.backOut_Pt  = this.changePtRange(this.backOut_Pt);
            this.floorOut_Pt = this.changePtRange(this.floorOut_Pt);


            //back
            #region

            this.backIn_Pt  = this.changePtRange(this.backIn_Pt);
            this.backDstImg = this.PerspectiveProject(srcImg, this.backIn_Pt, this.backOut_Pt).Clone();
            this.backDstImg = cutRect.CutImage(this.backDstImg, this.backOut_Pt).Clone();
            #endregion

            //floor
            #region

            this.floorIn_Pt  = this.changePtRange(this.floorIn_Pt);
            this.floorDstImg = this.PerspectiveProject(srcImg, this.floorIn_Pt, this.floorOut_Pt).Clone();
            this.floorDstImg = cutRect.CutImage(this.floorDstImg, this.floorOut_Pt).Clone();
            #endregion

            srcImg.Dispose();
        }