比较2张图片以检查是否相似 [英] comparing 2 images to check if similar

查看:106
本文介绍了比较2张图片以检查是否相似的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将存储在button.image中的图像与我资源文件夹中的图像进行比较



i得到错误运算符'''''未定义对于类型''System.Drawing.Image''和''对象''



图像为.bmp格式的纯色绿色



我应该用什么方法来比较2张图片来检查相似度





if button1 .image = My.Resources.ResourceManager.GetObject(greenseat)然后



''做点什么



endif

i am comparing the the image i stored in button.image with image from my resources folder

i am getting error "Operator ''='' is not defined for types ''System.Drawing.Image'' and ''Object''"

the images are .bmp format of plain color green

What method should i use to compare the 2 images to check for similarity


if button1.image=My.Resources.ResourceManager.GetObject("greenseat")then

''do something

endif

推荐答案

对象不相等,没有比较器可以处理它。其次,这并不容易,因为按钮使用的图像丢失了元数据,所以它不知道它来自何处。您可以从资源加载图像并比较图像。包括一些链接。但我想你只想检查一些状态并采取相应的行动。在这种情况下,最好使用枚举或数值来跟踪状态。您可以使用它来相应地显示图像或处理在某种状态下需要完成的任何操作。



使用vb比较图像.net [ ^ ]



.NET中的简单图像比较 [ ^ ]



祝你好运!
The objects aren''t equal and no comparator is available to handle it. Second, it isn''t that easy because the image the button uses has lost the meta data, so it doesn''t know where it came from. You could load the image from resource and compare the images. Some links are included. But I guess you want to simply check some state and act accordingly. In that case it would be best to keep track of state using an enum or numeric value. You can use that to show the image accordingly or handle whatever needs to be done at a certain state.

Comparing Images using vb.net[^]

Simple image comparison in .NET[^]

Good luck!


这篇关于比较2张图片以检查是否相似的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆