Ask Your Question
0

Meaning of Input Array and noArray()

asked 2015-04-01 08:41:38 -0600

mcExchange gravatar image

Hi

In the wiki I found the following description of a function:

C++: Vec2d EM::predict(InputArray sample, OutputArray probs=noArray())

what does it mean exactly? I.e.

a) What exact type can "InputArray" be? A cv::Mat? or also a std::vector or also a simple C-style array?

b) What does the value noArray() specify? Is this a function? Or does it simply mean that I don't have to pass this argument because OpenCV can choose a default value here?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2015-04-01 09:14:25 -0600

updated 2015-04-01 09:26:07 -0600

thdrksdfthmn gravatar image

Could you maybe do a little research before posting?

If you google "InputArray", this is the first hit which leads you directly to the docu

"Or does it simply mean that I don't have to pass this argument because OpenCV can choose a default value here?" Yes.

edit flag offensive delete link more
1

answered 2019-10-17 05:44:50 -0600

Freeman gravatar image

noArray() basically returns an empty array:

static _OutputArray _none; OutputArray
noArray() { return _none; }

As InputArray derives from OutputArray, and OutputArray is an static empty array.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-04-01 08:41:38 -0600

Seen: 6,247 times

Last updated: Oct 17 '19