How to access the elements of single channel IplImage in Opencv

前端 未结 3 1086
無奈伤痛
無奈伤痛 2021-01-20 19:51

How can I access the Elements of an IplImage (single channel and IPL_DEPTH_8U depth).

I want to change the pixel value at a particu

3条回答
  •  终归单人心
    2021-01-20 20:46

    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

提交回复
热议问题