InputArray and OutputArray are references themselves. Please, remove extra references. "int&" should also be replaced with "int".