Pregunta

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'

¿Fue útil?

Solución

It's simple.

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top