Fast way to convert a Bitmap into a Boolean array in C#?

后端 未结 1 1887
隐瞒了意图╮
隐瞒了意图╮ 2021-01-24 06:57

I am making an XNA application where I capture the screenshot from a webcam 4 times a second and then I try to convert it into an Boolean array when the pixel color Red is below

相关标签:
1条回答
  • 2021-01-24 07:15

    The answer provided by Hans Passant is correct, it is better to use LockBits and process the data all at once.

    You might also try writing a shader that thresholds the data and thereby utilize the power of the GPU to parallel-process the input image stream much, much faster.

    0 讨论(0)
提交回复
热议问题