更快的位图C#WPF保存方法 [英] Faster saving method of bitmap C# WPF

查看:65
本文介绍了更快的位图C#WPF保存方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm currently working on machine vision project. The issue is saving all of the images fast enough so that the queue of images doesn't build up in RAM and drain the user's memory.





我尝试了什么:





What I have tried:

This method helps the CPU issue, but because its not fast enough. The queue of images builds up and overloads the ram so I don't know what else I can do to solve both issues.

推荐答案

你可以尝试将图像保存为不同的文件类型。



建议的文件类型(在ImageToSave.fileExtension中)是:

ima - Halcons自己的格式。除了Halcon之外什么都不能读取它们。

png 0 - 未压缩的png文件。

bmp - 未压缩的位图文件。



如果您尝试压缩它们,那么CPU可能无法跟上。



一些(典型的)硬件限制:



在没有其他应用程序使用磁盘的典型硬盘上,您应该能够跟上连接到千兆网络端口的单个摄像头。对于单个硬盘驱动器,2个摄像头速度太快。



在SSD上,吞吐量通常快10倍,但SSD速度更慢(也更快)。你可能会很快填满SSD。



如果你可以捕获所有图像,那么你可以稍后压缩它们。
You could try saving the images as a different file type.

Suggested file types (in ImageToSave.fileExtension) are:
"ima" - Halcons own format. Nothing except Halcon will be able to read them.
"png 0" - Uncompressed png file.
"bmp" - Uncompressed bitmap file.

If you try and compress them then the CPU will likely not be able to keep up.

Some (typical) hardware limitations:

On a typical HDD with no other applications using the disk then you should just about be able to keep up with a single camera connected to a gigabit network port. 2 cameras will be too fast for a single hard drive.

On an SSD the throughput is typically 10x faster, but there are slower (and faster) SSDs. You will likely fill up an SSD very quickly.

If you can capture all of the images then you could compress them later.


这篇关于更快的位图C#WPF保存方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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