Bug with pixel access in OpenCV 2.x

前端 未结 2 702
栀梦
栀梦 2021-01-21 16:30

I\'m having trouble trying to find out how to access rgb pixel in the new version (2.x) of OpenCV. I tried using a mix of the old and the new method but without success.

2条回答
  •  再見小時候
    2021-01-21 17:29

    Inside your loop, you can do:

    img.at(j,i)[0] = 0;    // Blue Channel
    img.at(j,i)[1] = 0;    // Green Channel
    img.at(j,i)[2] = 0;    // Red Channel
    

    Is this what you wanted or I understood incorrectly?

提交回复
热议问题