Question

I tried to transfer opencv c++ code to python. but i got no idea how to change this line below:

((uchar*)(img->imageData + img->widthStep*i))[j];

when i write it like this: (img.imageData + img.widthStep * i)[j]

it occurs this Error message: 'cv2.cv.iplimage' object has no attribute 'imageData'

Était-ce utile?

La solution

It's simple.

img[i, j] will give you a tuple of (B, G, R) at pixel i, j.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top