IplImage* imageClassifier::getRegionByCoordinate(int x, int y) { CvScalar tmp; tmp = cvGet2D(classImg, y, x); if(tmp.val[0] == 0 || tmp.val[0] > label) { fprintf(stderr, "ERROR: imageClassifier, invalid coordinate.\n"); return 0; } return getRegionByLabel((int)tmp.val[0]); }
IplImage* imageClassifier::getRegionByCoordinate(int x, int y) { // input: coordinate, int // output: none // return: region which labelled 'labelNumber', binary image, IplImage // // return region image which contain the (x, y) coordinate pixel CvScalar tmp; tmp = cvGet2D(classImg, y, x); if(tmp.val[0] == 0 || tmp.val[0] > label) { fprintf(stderr, "ERROR: imageClassifier, invalid coordinate.\n"); return 0; } return getRegionByLabel((int)tmp.val[0]); }