I am using to compile and run code from Features2D + Homography to find a known object tutorial, and I am getting this

OpenCV Error: Assertion failed (npoints >= 0 && points2.checkVector(2) == npoint
s && points1.type() == points2.type()) in unknown function, file c:\Users\vp\wor
k\ocv\opencv\modules\calib3d\src\fundam.cpp, line 1062

run-time error. after debugging I find that the program is crashing at findHomography function.

Unhandled exception at 0x760ab727 in OpenCVTemplateMatch.exe: Microsoft C++ exception: cv::Exception at memory location 0x0029eb3c..

in the Introduction of OpenCV, the "cv Namespace" chapter says that

Some of the current or future OpenCV external names may conflict with STL or other libraries. In this case, use explicit namespace specifiers to resolve the name conflicts:

I changed my code and use everywhere explicit namespace specifiers, but problem did not solved. If you can, please help me in this problem, or say which function do same thing as findHomography, and do not crash program.

And this is my code

#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/calib3d/calib3d.hpp"

void readme();

/** @function main */
int main( int argc, char** argv )
{
    if( argc != 3 )
    { readme(); return -1; }

    cv::Mat img_object = cv::imread( argv[1], CV_LOAD_IMAGE_GRAYSCALE );
    cv::Mat img_scene = cv::imread( argv[2], CV_LOAD_IMAGE_GRAYSCALE );

    if( !img_object.data || !img_scene.data )
    { std::cout<< " --(!) Error reading images " << std::endl; r
Edit
Report