Making your application perform better
You have seen that image processing happens up to 30 frames per second. This means that memory allocation and clean-up is happening around 30 times per second. This makes performance trail, though it does not matter for a small application; but for a more complex application where there is major work involved other than only a color camera, it could be a big concern.
To make your application perform better, the alternative way is to process images using the WriteableBitmap
object, which serves the purpose of frequently updating the image pixel. You can find this WriteableBitmap
object in the System.Windows.Media.Imaging
namespace. The WriteableBitmap
object works in a different way than BitmapSource
. The WriteableBitmap
object allocates the memory at once and updates only the pixel data on frame change. WriteableBitmap
improves the performance by reducing the memory consumption as well as memory allocation and deallocation.
The overall implementation...