• 大小: 555KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: C#
  • 标签: C#  

资源简介

C# 遥感影像分类,可以实现各种遥感影像的分类,基于IDL8.2实现的.

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesRaster;

namespace RSImageClassification
{
    public partial class BinaryEncoding : Form
    {
        List BinaEncodName = new List();
        public bool ShowResultOrNot = false;
        public string ResultFilePath = string.Empty;

        public BinaryEncoding(List fname)
        {
            InitializeComponent();

            this.StartPosition = FormStartPosition.CenterScreen;
            BinaEncodName = fname;
        }

        private void BinaryEncoding_Load(object sender EventArgs e)
        {
            if (BinaEncodName != null)
            {
                for (int i = 0; i < BinaEncodName.Count(); i++)
                {
                    cmbInputFile.Items.Add(System.IO.Path.GetFileName(BinaEncodName[i]));
                }
            }
        }

        private void cmbInputFile_SelectedIndexChanged(object sender EventArgs e)
        {
            listBox1.Items.Clear();
            for (int i = 0; i < BinaEncodName.Count(); i++)
            {
                string selectedFileName = cmbInputFile.SelectedItem.ToString().Trim();
                if (selectedFileName == System.IO.Path.GetFileName(BinaEncodName[i]))
                {
                    IRasterDataset rd = ReadRasterDataset.OpenFileRasterDataset(BinaEncodName[i]);
                    IRasterBandCollection rbc = (IRasterBandCollection)rd;
                    for (int j = 0; j < rbc.Count; j++)
                    {
                        IRasterBand band = rbc.Item(j);
                        listBox1.Items.Add(band.Bandname);
                    }
                    lbSelectedBand.Text = “0//“ + listBox1.Items.Count;
                }
            }
        }

        private void btnSelectImage_Click(object sender EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.title = “选择栅格图像“;
            openFileDialog.Filter = “Img and Tif Files(*.img*.tif)|*.img;*.tif|Img Files(*.img)|*.img|Tif Files(*.tif)|*.tif|All Files(*.*)|*.*“;
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                cmbInputFile.Text = openFileDialog.FileName;
            }

            try
            {
                IRasterDataset rd = ReadRasterDataset.OpenFileRasterDataset(openFileDialog.FileName);
                IRasterBandCollection rbc = (IRasterBandCollection)rd;
                for (int j = 0; j < rbc.Count; j++)
                {
                    IRasterBand band = rbc.Item(j);
                    listBox1.Items.Add(band.Bandname);
                }
                lbSelectedBand.Text = “0//“ + listBox1.Items.Count;
            }
 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-11-06 21:41  遥感影像分类\
     目录           0  2013-10-02 22:55  遥感影像分类\RSImageClassification\
     目录           0  2013-10-02 22:55  遥感影像分类\RSImageClassification\RSImageClassification\
     文件         905  2013-08-15 22:47  遥感影像分类\RSImageClassification\RSImageClassification.sln
     文件       58368  2014-02-23 10:45  遥感影像分类\RSImageClassification\RSImageClassification.suo
     目录           0  2013-10-02 22:55  遥感影像分类\RSImageClassification\RSImageClassification\bin\
     文件        8884  2013-10-01 16:08  遥感影像分类\RSImageClassification\RSImageClassification\BinaryEncoding.cs
     文件       18283  2013-10-01 16:03  遥感影像分类\RSImageClassification\RSImageClassification\BinaryEncoding.Designer.cs
     文件        5817  2013-10-01 16:03  遥感影像分类\RSImageClassification\RSImageClassification\BinaryEncoding.resx
     目录           0  2013-10-02 22:55  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\
     文件        1406  2012-10-09 21:34  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\047.ico
     文件        1283  2010-04-26 00:00  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\10977.png
     文件       43520  2013-12-04 11:24  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\CreateROI.dll
     文件       38400  2013-12-04 11:24  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\CreateROI.pdb
     文件        2142  2013-12-04 11:24  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\CreateROI.xml
     文件        2007  2013-08-11 23:29  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\createroi_polygon.pro
     文件         824  2012-10-09 21:34  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\FullExtent.bmp
     文件         865  2013-08-15 22:02  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\new files.png
     文件      125952  2014-02-23 10:35  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImageClassification.exe
     文件      241152  2014-02-23 10:35  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImageClassification.pdb
     文件       11600  2014-02-23 10:46  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImageClassification.vshost.exe
     文件         490  2010-03-17 22:39  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImageClassification.vshost.exe.manifest
     文件        2137  2013-10-01 16:01  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_BinaryEncoding.pro
     文件         893  2013-09-28 13:23  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_Isodata.pro
     文件         604  2013-09-29 23:16  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_KMeans.pro
     文件        2124  2013-09-30 23:20  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_MahalanobisDistance.pro
     文件        2058  2013-09-30 23:26  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_MaximunLikelihood.pro
     文件        2020  2013-09-30 22:31  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_MinimumDistance.pro
     文件        1908  2013-10-01 21:01  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_NeuralNet.pro
     文件        2292  2013-09-30 22:03  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_parallelepiped.pro
     文件        2115  2013-10-01 15:40  遥感影像分类\RSImageClassification\RSImageClassification\bin\Debug\RSImage_SAM.pro
............此处省略136个文件信息

评论

共有 条评论