我正在尝试设计一个页面,我们可以在其中上传图像,然后比较上传的图像 [英] I am trying to design a page in which we can upload an image and then compare the uploaded image
本文介绍了我正在尝试设计一个页面,我们可以在其中上传图像,然后比较上传的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是一个新手asp.net ..我正在尝试设计一个页面,我们可以上传图像,然后将上传的图像与数据库中的所有图像进行比较,并显示与上传的图像相匹配的图像image ... 我无法做第二部分,即比较和重做相关的结果..所以我需要一个帮助...提前谢谢
I am a newbie asp.net .. I am trying to design a page in which we can upload an image and then compare the uploaded image with all the image in the database and display the images which match the uploaded image... I am not able to do the second part i.e comparing and didplaying related result ..so i need a help on that .. Thanks in advance
推荐答案
我要做一些假设
1.您正在将单个图像与多个图像进行比较。
2.比较是两个图像的字节到字节比较。
3.图像的格式相同。
然后
I''m going to make some assumptions
1. You are comparing a single image with a number of images.
2. The comparison is a byte-to-byte comparison of two images.
3. Images are in the same format.
Then
foreach image in database
{
images_equal = true
if ( image.Size != uploaded_image.Size )
{
images_equal = false
}
else
{
foreach byte in the images
{
if ( image_byte != uploaded_image_byte )
{
images_equal = false
break
}
}
}
if ( images_equal )
{
do something with equal images
}
else
{
do something with unequal images
}
}
字节到字节的比较可能需要是System.Runtime.InteropServices。
The byte to byte comparison may require System.Runtime.InteropServices.
这篇关于我正在尝试设计一个页面,我们可以在其中上传图像,然后比较上传的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文