Cycle through pixels with opencv

后端 未结 7 2197
情深已故
情深已故 2020-12-07 17:46

How would I be able to cycle through an image using opencv as if it were a 2d array to get the rgb values of each pixel? Also, would a mat be preferable over an iplimage for

7条回答
  •  [愿得一人]
    2020-12-07 18:38

    Since OpenCV 3.0, there are official and fastest way to run function all over the pixel in cv::Mat.

    void cv::Mat::forEach (const Functor& operation)

    If you use this function, operation is runs on multi core automatically.

    Disclosure : I'm contributor of this feature.

提交回复
热议问题