Ask Your Question
0

How to print the type name but not the value?

asked 2017-11-07 21:05:36 -0600

yode gravatar image

updated 2017-11-07 21:06:11 -0600

Such as I have such code

Mat img = imread("blobn.png", 0);
cout << img.type();

The output is 0, But it is not my expectation. Is possible print the name CV_8UC1 instead of the value 0?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-11-08 03:01:52 -0600

VxW gravatar image

In C++

The only solution I've found was this: print types

In Java (but I'm not so familar with Java)

It seems to be easier: System.out.println(CvType.typeToString(yourMat)); see

edit flag offensive delete link more

Comments

Thanks anyway. :)

yode gravatar imageyode ( 2017-11-08 03:13:16 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-07 21:05:36 -0600

Seen: 299 times

Last updated: Nov 08 '17