Pixel access in OpenCV 2.2

前端 未结 3 1480
不思量自难忘°
不思量自难忘° 2020-11-28 14:54

Hi I want to use opencv to tell me the pixel values of a blank and white image so the output would look like this

10001
00040
11110   
00100
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 15:47

    IplImage is the old format for images. You should use the new format, CvMat, which can store arbitrary matrices. An image is just a matrix, after all.

    You can then access the pixels using the function cvGet2D, which returns a CvScalar.

提交回复
热议问题