// Compute features of an image.
bool computeFeatures(CFloatImage &image, FeatureSet &features, int featureType, int descriptorType)
{
    // TODO: Instead of calling dummyComputeFeatures, implement
    // Harris feature detector.  This step fills in "features"
    // with information needed for descriptor computation.
    switch (featureType) {
    case 1:
        dummyComputeFeatures(image, features);
        break;
    case 2:
        ComputeHarrisFeatures(image, features);
        break;
    default:
        return false;
    }

    // TODO: You will implement two descriptors for this project
    // (see webpage).  This step fills in "features" with
    // descriptors.  The third "custom" descriptor is extra credit.
    switch (descriptorType) {
    case 1:
        ComputeSimpleDescriptors(image, features);
        break;
    case 2:
        ComputeMOPSDescriptors(image, features);
        break;
    case 3:
        ComputeCustomDescriptors(image, features);
        break;
    default:
        return false;
    }

    // This is just to make sure the IDs are assigned in order, because
    // the ID gets used to index into the feature array.
    for (unsigned int i=0; i<features.size(); i++) {
        features[i].id = i+1;
    }

    return true;
}
Пример #2
0
// Compute features of an image.
bool computeFeatures(CFloatImage &image, FeatureSet &features, int featureType, int descriptorType) {
	// Compute different types of features depending on value of featureType
	//   1: Dummy Features  - Arbitrary example features for demonstration purposes only DONT USE THIS
	//   2: Harris Features - Features selected using Harris corner detection method
	switch (featureType) {
	case 1:
		dummyComputeFeatures(image, features);
		break;
	case 2:
		ComputeHarrisFeatures(image, features);
		break;
	default:
		return false;
	}

	// Compute different types of feature descriptors depending on value of descriptorType
	//   1: Simple Descriptor - 5x5 square window without orientation centered on feature
	//   2: MOPS Descriptor   - 8x8 oriented window sub-sampled from a 41x41 pixel region around feature
	//   3: Custom Descriptor - extra credit TBD
	switch (descriptorType) {
	case 1:
		ComputeSimpleDescriptors(image, features);
		break;
	case 2:
		ComputeMOPSDescriptors(image, features);
		break;
	case 3:
		ComputeCustomDescriptors(image, features);
		break;
	default:
		return false;
	}

	// This is just to make sure the IDs are assigned in order, because
	// the ID gets used to index into the feature array.
	for (unsigned int i=0; i<features.size(); i++) {
		features[i].id = i;
	}

	return true;
}