• 大小: 0.06M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: C#  c  图像  

资源简介

C#图像直方图匹配度计算

 大致步骤如下:

1, 将图像转换成相同大小,以有利于计算出相像的直方图来

2, 计算转化后的灰度直方图

3, 利用XX公式,得到直方图相似度的定量度量

4, 输出这些不知道有用没用的相似度结果数据


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace baseOCR1
{
    class HashOCR
    {
        Image SourceImg;

 

        public void SimilarPhoto(string filePath)

        {

            SourceImg = Image.FromFile(filePath);

        }

 

        public void SimilarPhoto(Stream stream)

        {

            SourceImg = Image.FromStream(stream);

        }

 

        public String GetHash()

        {

            Image image = ReduceSize();

            Byte[] grayValues = ReduceColor(image);

            Byte average = CalcAverage(grayValues);

            String reslut = ComputeBits(grayValues average);

            retu

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-04-29 23:07  baseOCR1\
     目录           0  2019-05-03 16:43  baseOCR1\baseOCR1\
     文件         187  2019-04-29 23:07  baseOCR1\baseOCR1\App.config
     文件        2997  2019-04-30 12:06  baseOCR1\baseOCR1\Class1.cs
     文件        5760  2019-05-03 16:43  baseOCR1\baseOCR1\Form1.Designer.cs
     文件        4906  2019-05-03 16:43  baseOCR1\baseOCR1\Form1.cs
     文件        5817  2019-05-03 16:43  baseOCR1\baseOCR1\Form1.resx
     文件        2997  2019-04-30 12:07  baseOCR1\baseOCR1\HashOCR.cs
     文件         520  2019-04-29 23:07  baseOCR1\baseOCR1\Program.cs
     目录           0  2019-04-29 23:07  baseOCR1\baseOCR1\Properties\
     文件        1358  2019-04-29 23:07  baseOCR1\baseOCR1\Properties\AssemblyInfo.cs
     文件        2868  2019-04-29 23:07  baseOCR1\baseOCR1\Properties\Resources.Designer.cs
     文件        5612  2019-04-29 23:07  baseOCR1\baseOCR1\Properties\Resources.resx
     文件        1095  2019-04-29 23:07  baseOCR1\baseOCR1\Properties\Settings.Designer.cs
     文件         249  2019-04-29 23:07  baseOCR1\baseOCR1\Properties\Settings.settings
     文件        3883  2019-05-03 16:08  baseOCR1\baseOCR1\baseOCR1.csproj
     目录           0  2019-04-30 12:07  baseOCR1\baseOCR1\bin\
     目录           0  2019-05-03 16:09  baseOCR1\baseOCR1\bin\Debug\
     文件       13824  2019-05-03 16:43  baseOCR1\baseOCR1\bin\Debug\baseOCR1.exe
     文件         187  2019-04-29 23:07  baseOCR1\baseOCR1\bin\Debug\baseOCR1.exe.config
     文件       36352  2019-05-03 16:43  baseOCR1\baseOCR1\bin\Debug\baseOCR1.pdb
     文件       24224  2019-05-03 22:16  baseOCR1\baseOCR1\bin\Debug\baseOCR1.vshost.exe
     文件         187  2019-04-29 23:07  baseOCR1\baseOCR1\bin\Debug\baseOCR1.vshost.exe.config
     目录           0  2019-05-03 22:41  baseOCR1\baseOCR1\bin\Release\
     目录           0  2019-04-29 23:07  baseOCR1\baseOCR1\obj\
     目录           0  2019-05-03 16:43  baseOCR1\baseOCR1\obj\Debug\
     文件         865  2019-05-03 16:09  baseOCR1\baseOCR1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6943  2019-04-30 12:07  baseOCR1\baseOCR1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2019-05-03 22:41  baseOCR1\baseOCR1\obj\Debug\TempPE\
     文件           0  2019-04-29 23:07  baseOCR1\baseOCR1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2019-04-29 23:07  baseOCR1\baseOCR1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
............此处省略10个文件信息

评论

共有 条评论