比较图像并保存差异 [英] Compare images and save difference

查看:104
本文介绍了比较图像并保存差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单来说,我正在截取屏幕截图,我希望能够通过TCP或UDP发送它们.

我希望它更快,所以我只希望它在两个屏幕中发送差异.谁能帮我,或写一个例子?

顺便说一句,这是一个家庭作业,反正是夏天,所以就没上课..

To put it simply I am taking screenshots and I want to be able to send them via TCP or UDP.

I want it to be faster so I just want it to send the difference in the two screens. Can anyone help me, or code an example?

This ISN''T a homework assignment btw, it''s summer anyway so no school..

推荐答案

如果您阅读我的图像处理文章,就可以看到如何(在C#中)以比较像素级别的图像.一旦知道哪些像素发生了变化,就可以创建代表变化区域的图像(需要为矩形).您无法在VB.NET中执行此操作,它不允许以相同的速度访问像素级.
If you read my image processing articles, you can see how, in C#, to compare images on the pixel level. Once you know what pixels have changed, you can create images that represent the changed areas ( which need to be rectangular ). You can''t do this in VB.NET, it does not allow pixel level access at the same speed.


您似乎想实现自己的帧间图像压缩.由于您要处理多个图像,因此实际上是一种帧间视频压缩.

有许多易于使用的帧间压缩器(MPEG2,MPEG4,H264等),但它们通常用于真实"视频图像.
将它们用于屏幕捕获的问题在于它们有损耗,并且会给屏幕图像带来一些失真.有无损压缩器,但是大多数压缩器是帧内的(在单个帧上工作,而不是在帧间上工作).

以下论坛帖子包含一个代码示例,该代码示例使用专门为屏幕捕获而设计的编解码器,同时进行帧间压缩和无损压缩.
将屏幕内容流式传输到网络并在其他PC上播放
It appears you want to implement your own inter-frame image compression. Since you''re dealing with multiple images, this is in effect a type of inter-frame video compression.

There are many readily-available inter-frame compressors (MPEG2, MPEG4, H264, etc.), but they are generally meant for ''real-life'' video images.
The problem with using them with screen capture is that they are lossy and will introduce some distortion to the screen images. There are lossless compressors, but most of them are intra-frame (work on individual frames, not inter-frame).

The following forum post contains a code sample that uses a codec designed specifically for screen capture by doing both inter-frame and lossless compression.
Stream screen contents to a network and play on different PC


也许还有其他例子吗?


这篇关于比较图像并保存差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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