Exemple #1
0
void main()
{
	/*
		Set-up variables for image matching
	*/

	string detector, descriptor, matcher;
	string config_file;

	detector = "STAR";
	descriptor = "BRISK";
	matcher = "BruteForce-Hamming";

	config_file = "D:/Experiment/Set_3_SIDEVIEW/Input_SV_REF/config.txt";

	// Do function
	FeatureExtractor test_im
		(detector, descriptor, matcher, config_file);

	test_im.matchImgSeq();



	cout << "the end" << endl;


}
TEST(xphoto_simplefeatures, regression)
{
    float acc_thresh = 0.01f;

    // Generate a test image:
    Mat test_im(1000, 1000, CV_8UC3);
    RNG rng(1234);
    rng.fill(test_im, RNG::NORMAL, Scalar(64, 100, 128), Scalar(10, 10, 10));
    threshold(test_im, test_im, 200.0, 255.0, THRESH_TRUNC);
    test_im.at<Vec3b>(0, 0) = Vec3b(240, 220, 200);

    // Which should have the following features:
    Vec2f ref1(128.0f / (64 + 100 + 128), 100.0f / (64 + 100 + 128));
    Vec2f ref2(200.0f / (240 + 220 + 200), 220.0f / (240 + 220 + 200));

    vector<Vec2f> dst_features;
    xphoto::extractSimpleFeatures(test_im, dst_features, 255, 0.98f, 64);
    ASSERT_LE(cv::norm(dst_features[0], ref1, NORM_INF), acc_thresh);
    ASSERT_LE(cv::norm(dst_features[1], ref2, NORM_INF), acc_thresh);
    ASSERT_LE(cv::norm(dst_features[2], ref1, NORM_INF), acc_thresh);
    ASSERT_LE(cv::norm(dst_features[3], ref1, NORM_INF), acc_thresh);

    // check 16 bit depth:
    test_im.convertTo(test_im, CV_16U, 256.0);
    xphoto::extractSimpleFeatures(test_im, dst_features, 65535, 0.98f, 64);
    ASSERT_LE(cv::norm(dst_features[0], ref1, NORM_INF), acc_thresh);
    ASSERT_LE(cv::norm(dst_features[1], ref2, NORM_INF), acc_thresh);
    ASSERT_LE(cv::norm(dst_features[2], ref1, NORM_INF), acc_thresh);
    ASSERT_LE(cv::norm(dst_features[3], ref1, NORM_INF), acc_thresh);
}
Exemple #3
0
void test_entry()
{
	
	int selection, depth;
	int i, j;
	unsigned char readout;

	selection = -1;
	depth = -1;

	while (1) {

		sendtocom0("****************\n");
		sendtocom0("SYSTEM TEST MENU\n");
		sendtocom0("****************\n\n");


		for (i=0; i<3; i++) sendtocom0(" ");
		sendtocom0("[01]   GPS TEST\n");

		for (i=0; i<3; i++) sendtocom0(" ");
		sendtocom0("[02]   IMU TEST\n");

		for (i=0; i<3; i++) sendtocom0(" ");
		sendtocom0("[03]   CAN TEST\n");

		for (i=0; i<3; i++) sendtocom0(" ");
		sendtocom0("[04] RS422 TEST\n");

		for (i=0; i<3; i++) sendtocom0(" ");
		sendtocom0("[05]   EMV TEST\n");
		sendtocom0("\n");

		depth = *((unsigned char*)DBGADDR+0x10);

		for (j=0; j<10; j++)
			;

		if (depth > 0) {

			for (i=0; i<depth; i++) {

				readout = *((unsigned char*)DBGADDR);

				for (j=0; j<10; j++)
					;

			}

		}

		sendtocom0("Please Enter Your Choice:\n\n");

		for (j=0; j<20000000; j++)
			;
	
		do {

			depth = *((unsigned char*)DBGADDR+0x10);
			for (j=0; j<10; j++)
				;

			if (depth > 0) {

				selection = *((unsigned char*)DBGADDR);
				for (j=0; j<10; j++)
					;
				break;
			}

		} while (selection == 0 || depth == 0);


		for (j=0; j<20000000; j++)
			;

		switch (selection) {
		case 1:
			test_gps();
			break;
		case 2:
			test_im();
			break;
		case 3:
			test_can();
			break;
		case 4:
			test_com();
			break;
		case 5:
			test_EMV();
			break;
		}
	}
}