Basic type misunderstanding in OpenCV programs

So I'm pretty new to OpenCV and I keep running into programs using casting from int to (inputarray) or other opencv classes.

Here's an example:

1
2
3
4
5
6
DLLIMPORT void lv_matchTemplate(int image,int templ,int result,int method,int * err)  //  void matchTemplate( InputArray image, InputArray templ, OutputArray result, int method )
{
try {  matchTemplate((InputArray) image,(InputArray) templ,(OutputArray) result, method);} 
catch( cv::Exception& e ) 		  { 			  Exception *d=new Exception();*d=e;*err=(int)(d);		  }
 }


Here is what the OpenCV documentation says:


This is the proxy class for passing read-only input arrays into OpenCV functions. It is defined as

typedef const _InputArray& InputArray;

where _InputArray is a class that can be constructed from Mat, Mat_<T>, Matx<T, m, n>, std::vector<T>, std::vector<std::vector<T> > or std::vector<Mat>. It can also be constructed from a matrix expression.


Im pretty sure all I have to know about the type is here. I suspect the _inputArray& means the whole class can be represented as a pointer and thats why an int type can be cast into it. But the whole blackened part puzzles me so im not sure.

If someone could go over this problem it could really help. Preferably with as least advanced c++ wording as possible :)

As always, thanks in advance
Topic archived. No new replies allowed.