简体   繁体   中英

Which values of numpy array in Python correspond to Mat from OpenCV in Java?

I'm very new to Python, and I'm converting Python code into Java, and I've been having trouble trying identifying which array corresponds to what value in Python. For example, for Mat in Java (correct me if I'm wrong), I know that in

Mat matrix = new Mat();
matrix.Get(a, b)[c];

a = channel, b = row/x, c = column/y

But in Python if I have

img = cv2.imread("picture.jpeg")
img[d][e][f]

What values do the arrays of d, e, f correspond to? For example d = row/x, e = column/y

The array has the shape (row, col, channel) . Of course it depends on the mode you are loading, grayscale will yield a 2D array.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM