比较2个tiff文件&创建结果文件 [英] Compare 2 tiff files & create result file

查看:84
本文介绍了比较2个tiff文件&创建结果文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想比较两个tiff文件&结果应该在另一个tif文件中。假设我正在比较a.tiff和b.tiff。必须用不同颜色的c.tiff捕获所有差异。如果给定的tiff文件中的像素相同,那么它必须是一种颜色。如果添加/删除,则它应该是不同的颜色。你能帮我拿到源代码吗?我计划在windows / c ++ / vs2010中构建这个



我尝试过:



我是这类工作的新手。

Hi,
I want to compare two tiff files & result should be in another tif files.Assume that i am comparing a.tiff and b.tiff . all the difference must be captured in c.tiff with different color. If pixels are same in both the given tiff files then it must be in one color. If added/removed then it should be in different color. Could you please help me to get source code. I am planning to build this in windows/c++/vs2010

What I have tried:

I am new to this kind of work.

推荐答案

因为你使用的是Visual Studio我建议使用图像类 [ ^ ]。



CImage ::加载两张图片加载 [ ^ ]和迭代像素( CImage :: GetWidth [ ^ ], CImage :: GetHeight [ ^ ])。根据每个像素的结果( CImage :: GetPixel [ ^ ])设置所需的像素值(CImage :: SetPixel [ ^ ])在其中一个图像上完成后用输出文件名保存( CImage :: Save [ ^ ])。如果您不想为输出重复使用一个输入图像,请创建第三个 CImage ,并填充和保存相同的大小和颜色深度( CImage :: Create [ ^ ])。



以上 CImage :: Save 链接没有提到TIFF格式,但它应该可以使用 Gdiplus :: ImageFormatTIFF
Because you are using Visual Studio I suggest to use the CImage Class[^].

Load the two images with CImage::Load[^] and iterate over the pixels (CImage::GetWidth[^], CImage::GetHeight[^]). According to the result of each pixel (CImage::GetPixel[^]) set the desired pixel value (CImage::SetPixel[^]) on one of the images and save that with the output file name when finished (CImage::Save[^]). If you don't want to re-use one input image for the output, create a third CImage with the same size and colour depth to be populated and saved (CImage::Create[^]).

The above CImage::Save link does not mention the TIFF format but it should work using Gdiplus::ImageFormatTIFF.


Quote:

您能否发送可行的代码?这对我有帮助。

Could you please send the workable code? It will be helpful for me.



如果你很专心,你可能已经注意到这个网站不是免费的代码搜索服务。如果你想让某人做你的工作,可以考虑雇佣一名专业程序员。

聘请自由职业者&在线查找自由职业者 - 自由职业者 [ ^ ]




If you are attentive, you may have noticed that this site is not a free code search service. If you want someone to do your work, think about hiring a professional programmer.
Hire Freelancers & Find Freelance Jobs Online - Freelancer[^]

引用:

我想比较两个tiff文件

I want to compare two tiff files

注意你的陈述非常模糊和数十种算法可以匹配描述而不会有用。

Note that your statement is very vague and tens of algorithm can match description without being useful.


这篇关于比较2个tiff文件&创建结果文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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