• 大小: 522KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-12
  • 语言: C/C++
  • 标签: surf  c#  源码  

资源简介

基于C#平台开发的surf算法,可直接运行查看结果。较为方便的可以转为C++版本

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using OpenSURFcs;
using System.IO;

namespace OpenSURFDemo
{
    public partial class DemoSURF : Form
    {
        Bitmap img1 = null img2 = null;

        public DemoSURF()
        {
            InitializeComponent();
        }

        private void btnOpenPic1_Click(object sender EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.ShowDialog();
            if (File.Exists(openFileDialog.FileName))
                img1 = new Bitmap(openFileDialog.FileName);
        }

        //------------------------------------------------------------------------------------------------------------

        private void btnOpenPic2_Click(object sender EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.ShowDialog();
            if (File.Exists(openFileDialog.FileName))
                img2 = new Bitmap(openFileDialog.FileName);

            if (img1 == null || img2 == null)
                return;

            List ipts1 = new List();//图片1的特征点
            List ipts2 = new List();//图片2的特征点

            //----------------------------------------------------------------------------------------------//
            // Create Integral Image
            IntegralImage iimg = IntegralImage.FromImage(img1);

            // Extract the interest points
            ipts1 = FastHessian.getIpoints(0.0001f //此值越小,特征点越多
                                                                    5 2 iimg);

            // Describe the interest points
            SurfDescriptor.DecribeInterestPoints(ipts1 false //是否表示方向
                                                                                            false //false为64,true为128
                                                                                            iimg);
            //----------------------------------------------------------------------------------------------//
            // Create Integral Image
            iimg = IntegralImage.FromImage(img2);

            // Extract the interest points
            ipts2 = FastHessian.getIpoints(0.0001f 5 2 iimg);

            // Describe the interest points
            SurfDescriptor.DecribeInterestPoints(ipts2 false false iimg);

            List[] matches = Utils.getMatches(ipts1 ipts2);
            PaintSURF(img1img2 matches);
        }
        // DemoApp


        private void PaintSURF(Bitmap img1 Bitmap img2 List[] matches)
        {
            Bitmap bmp = new Bitmap(img1.Width + img2.Width Math.Max(img1.Height img2.Height));

            Graphics g = Graphics.FromImage(bmp);
            g.DrawImage(i

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-04-20 10:16  基于C#的Surf\
     目录           0  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\
     目录           0  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\.vs\
     目录           0  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\.vs\WindowsApplication2\
     目录           0  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\.vs\WindowsApplication2\v14\
     文件        6656  2019-03-20 09:47  基于C#的Surf\WindowsApplication2\.vs\WindowsApplication2\v14\.suo
     文件         163  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\app.config
     目录           0  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\Backup\
     文件        4792  2010-07-04 19:33  基于C#的Surf\WindowsApplication2\Backup\DemoSURF.cs
     文件        3619  2010-07-04 16:57  基于C#的Surf\WindowsApplication2\Backup\DemoSURF.designer.cs
     文件        5814  2010-07-04 16:57  基于C#的Surf\WindowsApplication2\Backup\DemoSURF.resx
     目录           0  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\Backup\OpenSURF\
     文件       14382  2010-07-01 10:49  基于C#的Surf\WindowsApplication2\Backup\OpenSURF\FastHessian.cs
     文件        4411  2010-07-02 16:27  基于C#的Surf\WindowsApplication2\Backup\OpenSURF\IntegralImage.cs
     文件        1112  2010-07-01 10:02  基于C#的Surf\WindowsApplication2\Backup\OpenSURF\IPoint.cs
     文件       13434  2010-07-01 10:50  基于C#的Surf\WindowsApplication2\Backup\OpenSURF\SurfDescriptor.cs
     文件         435  2010-07-01 10:03  基于C#的Surf\WindowsApplication2\Backup\Program.cs
     目录           0  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\Backup\Properties\
     文件        1200  2010-07-01 09:57  基于C#的Surf\WindowsApplication2\Backup\Properties\AssemblyInfo.cs
     文件        2860  2010-07-04 16:25  基于C#的Surf\WindowsApplication2\Backup\Properties\Resources.Designer.cs
     文件        5612  2010-07-01 09:57  基于C#的Surf\WindowsApplication2\Backup\Properties\Resources.resx
     文件        1115  2010-07-04 16:25  基于C#的Surf\WindowsApplication2\Backup\Properties\Settings.Designer.cs
     文件         249  2010-07-01 09:57  基于C#的Surf\WindowsApplication2\Backup\Properties\Settings.settings
     文件        1678  2010-07-04 19:07  基于C#的Surf\WindowsApplication2\Backup\Utils.cs
     文件        3853  2010-07-04 16:27  基于C#的Surf\WindowsApplication2\Backup\WindowsApplication2.csproj
     目录           0  2019-03-20 09:46  基于C#的Surf\WindowsApplication2\bin\
     目录           0  2019-03-20 09:47  基于C#的Surf\WindowsApplication2\bin\Debug\
     文件       38460  2010-07-04 18:18  基于C#的Surf\WindowsApplication2\bin\Debug\1.jpg
     文件       43191  2010-07-04 18:18  基于C#的Surf\WindowsApplication2\bin\Debug\2.jpg
     文件       38912  2010-07-04 19:11  基于C#的Surf\WindowsApplication2\bin\Debug\Thumbs.db
     文件       32768  2009-10-10 23:45  基于C#的Surf\WindowsApplication2\bin\Debug\track1.png
............此处省略40个文件信息

评论

共有 条评论