Hi,
I am trying to make some transformations on an image with OpenCV and Python. I started by reading the image with cvLoadImage function, and then I got the image data with imageData function.
img = highgui.cvLoadImage("x.png",1)
data = img.imageData
The problem is, the imageData function returns a string data and when I try to do some calculations on the image data, it gives me error because e.g. it is not allowed to do substraction on strings in Python.
I have a C code as an example, and the following calculation works completely well:
x= data[100] + 4*data[40] -data[20]
But in Python, as I said, I can't do this. Any clue about this? What is the difference about Python vs C about this statement and how can apply this kind of calculations in Python?