本文介绍了如何访问单通道的IplImage的OpenCV中的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何可以访问的元素的的IplImage (单通道和IPL_DEPTH_8U深度)。
How can I access the Elements of an IplImage (single channel and IPL_DEPTH_8U depth).
我想在图像的特定(X,Y)的位置改变的像素值。
I want to change the pixel value at a particular (x, y) position of the image.
推荐答案
的OpenCV提供CV_IMAGE_ELEM方法来访问的IplImage的元素,这是一个宏,
opencv provide CV_IMAGE_ELEM method to access elements of IplImage,it's a macro,
define CV_IMAGE_ELEM( image, elemtype, row, col ) \
(((elemtype*)((image)->imageData + (image)->widthStep*(row)))[(col)])
第二个参数是类型
second parameter is the type of
这篇关于如何访问单通道的IplImage的OpenCV中的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!