* @brief open face or feature detector from its XML file * @param cascade out * @param filename in: basename.ext of cascade * @param datadir in */
| 769 | * @param datadir in |
| 770 | */ |
| 771 | void OpenDetector(cv::CascadeClassifier& cascade, const char* filename, const char* datadir) |
| 772 | { |
| 773 | if (cascade.empty()) // not yet opened? |
| 774 | { |
| 775 | char dir[SLEN]; |
| 776 | STRCPY(dir, datadir); |
| 777 | ConvertBackslashesToForwardAndStripFinalSlash(dir); |
| 778 | char path[SLEN]; |
| 779 | sprintf(path, "%s/%s", dir, filename); |
| 780 | logprintf("Open %s\n", path); |
| 781 | if (!cascade.load(path)) |
| 782 | Err("Cannot load %s", path); |
| 783 | } |
| 784 | } |
| 785 | |
| 786 | /** |
| 787 | * @brief convert the x and y coords in feats from the search ROI to the image frame |
no test coverage detected