首页 新闻 赞助 找找看

关于影响配准的问题(图片好用,但TIFF文件有问题)

0
悬赏园豆:100 [已关闭问题] 关闭于 2011-02-24 11:00

下面就是我用的代码 针对图片没有问题,但在用TIFF格式的时候配准完就变成全黑的了。哪位大侠,斑竹帮帮忙。 刚接触ArcGIS不长时间,有些原理的东西不是很了解,头疼阿 -_-!!!

string originalFilePath = Application.StartupPath + @"\DMTTemplate\a.jpg";
            string strOutFile = Application.StartupPath + @"\DMTTemplate\cc.jpg";
            //string originalFilePath = Application.StartupPath + @"\DMTTemplate\b.tif";
            //string strOutFile = Application.StartupPath + @"\DMTTemplate\cc.tif";
            // pixel coords
            IPointCollection pSourcePoints = new MultipointClass();
            object missing = Type.Missing;
            pSourcePoints.AddPoint(MakePoint(0.135, 0), ref missing, ref missing);
            pSourcePoints.AddPoint(MakePoint(1023.496, 0), ref missing, ref missing);
            pSourcePoints.AddPoint(MakePoint(1023.496, -767.493), ref missing, ref missing);
            pSourcePoints.AddPoint(MakePoint(-0.48, -767.493), ref missing, ref missing);

            //pSourcePoints.AddPoint(MakePoint(0.135, 0), ref missing, ref missing);
            //pSourcePoints.AddPoint(MakePoint(1423.496, 0), ref missing, ref missing);
            //pSourcePoints.AddPoint(MakePoint(1423.496, -664.493), ref missing, ref missing);
            //pSourcePoints.AddPoint(MakePoint(-0.48, -664.493), ref missing, ref missing);


            //decimal degrees
            IPointCollection pTargetPoints = new MultipointClass();
            pTargetPoints.AddPoint(MakePoint(126959.107, 145736.885), ref missing, ref missing);
            pTargetPoints.AddPoint(MakePoint(127106.006, 146251.031), ref missing, ref missing);
            pTargetPoints.AddPoint(MakePoint(127674.015, 146662.348), ref missing, ref missing);
            pTargetPoints.AddPoint(MakePoint(127987.4, 145506.744), ref missing, ref missing);           

            IRasterDataset pInRasterDataset = GetRasterDataset(originalFilePath);
            IRaster pRaster = GetRaster(pInRasterDataset);

            IRasterGeometryProc pRasterGProc = new RasterGeometryProcClass();
            //pRasterGProc.TwoPointsAdjust(pSourcePoints, pTargetPoints, pRaster);
            pRasterGProc.Warp(pSourcePoints, pTargetPoints, esriGeoTransTypeEnum.esriGeoTransPolyOrder1, pRaster);
            //pRasterGProc.Rectify(strOutFile, "TIFF", pRaster);
            pRasterGProc.Rectify(strOutFile, "JPG", pRaster);
            AddImageLayer(strOutFile);

网络云鱼的主页 网络云鱼 | 初学一级 | 园豆:149
提问于:2010-12-27 11:40
< >
分享
所有回答(1)
0

好像gis是c++搞的(我们公司是这样的),不懂,帮顶!

Tear Y | 园豆:784 (小虾三级) | 2010-12-27 18:09
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册