Determining template type when accessing OpenCV Mat elements

后端 未结 3 904
粉色の甜心
粉色の甜心 2021-02-06 08:02

I\'m using the following code to add some noise to an image (straight out of the OpenCV reference, page 449 -- explanation of cv::Mat::begin):

void
         


        
3条回答
  •  爱一瞬间的悲伤
    2021-02-06 08:53

    They are hardcoded because performance is better that way.

    In OpenCV1.x there is cvGet2D() , which can be used here since Mat can be casted as an IplImage. But it's slow since each time you access a pixel the function will find out the type, size, etc. Specially inefficient in loops.

提交回复
热议问题