获取密集矩形 - GetDenseRect
函数简介
查找二值化图片中像素最密集的区域,可以配合找色块等功能做二次分析。
接口名称
GetDenseRect
DLL调用
int GetDenseRect(long instance, long image, int width, int height, int* x1, int* y1, int* x2, int* y2);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| image | 长整数型 | 图像句柄 |
| width | 整数型 | 矩形宽度 |
| height | 整数型 | 矩形高度 |
| x1 | 整数型指针 | 返回左上角x坐标 |
| y1 | 整数型指针 | 返回左上角y坐标 |
| x2 | 整数型指针 | 返回右下角x坐标 |
| y2 | 整数型指针 | 返回右下角y坐标 |
示例
C++
long instance = CreateCOLAPlugInterFace();
int x1, y1, x2, y2;
// 在二值化图像中查找50x50像素最密集的区域
long image = 0; // 图像句柄
int ret = GetDenseRect(instance, image, 50, 50, &x1, &y1, &x2, &y2);
// x1,y1为左上角坐标,x2,y2为右下角坐标
Python
# 待补充
返回值
1 成功,0 失败。
