开发者

Why do emgu images have arrays with extra elements for height?

开发者 https://www.devze.com 2023-01-04 20:42 出处:网络
Just noticed something strange and wondered if there was a reason for it. I have a grayscale image in EmguCV (.net wrapper for openCV). If this image has C channels (1 for grayscale, 3 for RGB), a wi

Just noticed something strange and wondered if there was a reason for it.

I have a grayscale image in EmguCV (.net wrapper for openCV). If this image has C channels (1 for grayscale, 3 for RGB), a width of X pixels and a height of Y pixels, the data array is co开发者_Go百科nsistently of the form:

[Y,X+2,C]

Anyone know why?


EmguCV wrapping Opencv relies on its optimization. Opencv's IplImage requires each row of the data matrix to be aligned by 4 bytes. This is done mainly because of the SSE optimization in OpenCV and to optimize data fetching. SSE optimization is one of the technique that make opencv run fast.

0

精彩评论

暂无评论...
验证码 换一张
取 消