2

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

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.