What astype(np.uint8) means?

asked 2019-07-02 21:32:00 -0600

Hi, I'm newbie trying to learn openCV by myself. I can searcy astype(np.uint8) is expressing sth from 0 to 255.(2**8) At the first time, I thought it means its grayscale. But I got confused after this one.

mat1 = np.array([[11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]]).astype(np.uint8)

I try to study this array but have no idea how to understand this one. How do I have to analyze this code??

edit retag flag offensive close merge delete

Comments

1

it's a numpy , not an opencv problem, and there are docs for it.

berak gravatar imageberak ( 2019-07-03 00:09:17 -0600 )edit

Thank you! Guess I have to start from the bottom.

CV_Newbie gravatar imageCV_Newbie ( 2019-07-03 03:10:06 -0600 )edit