http://docs.opencv.org/2.4/modules/core/doc/basic_structures.html#inputarray
<pre>The class is designed solely for passing parameters. That is, normally you SHOULD NOT declare class members, local and global variables of this type.</pre>
I suggest you use `src` directly.