且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

比较图像并保存差异

更新时间:2023-12-05 16:02:10

如果您阅读我的图像处理文章,就可以看到如何(在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


也许还有其他例子吗?