OpenCV Mat array access, which way is the fastest for and why?

后端 未结 4 690
慢半拍i
慢半拍i 2021-01-13 05:39

I am wondering about the way of accessing data in Mat in OpenCV. As you know, we can access to get data in many ways. I want to store image (Width x Height x 1-depth) in Mat

4条回答
  •  旧时难觅i
    2021-01-13 06:29

    at does a range check at every call, thus making it slower than ptr, but safer.

    So, if you're confident that your range calculations are correct and you want the best possible speed, use ptr.

提交回复
热议问题