快速ROI - FastROI
函数简介
返回图像中不为0的最大区域图像,用于自动识别有效区域。
接口名称
FastROI
DLL调用
long FastROI(long instance, long ptr);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| ptr | 长整数型 | 图像指针 |
示例
long image = LoadImage(ola, "D:\\test\\image.png");
if (image != 0) {
long roiImage = FastROI(ola, image);
if (roiImage != 0) {
ShowImage(ola, roiImage);
FreeImagePtr(ola, roiImage);
}
FreeImagePtr(ola, image);
}
返回值
长整数型:成功返回ROI图像对象的地址,失败返回0。
注意事项
- 返回的ROI图像为原图像中不为0的最大连通区域。
- 返回的图像需调用 FreeImagePtr 释放内存。
