当前位置:网站首页>Halcon 小笔记 C# 图片是否有效
Halcon 小笔记 C# 图片是否有效
2022-08-03 16:46:00 【廷益--飞鸟】
判断图片是否有效
if (ho_imgOrg.Key.ToInt64() == 0)
return;
字符串, 格式化
* 数值转为字符串
ShowMsg := BallRadius1 $'.3f'
窗口显示字符串,窗口显示信息
* 显示信息 12 为坐标
disp_message (WindowHandle, 'ShowMsg', 'image', 12, 12, 'black', 'true')
添加到数组,数组添加数据、数组累加、数组合并
普通数值
* 数组的创建
BallDiffAbsList:=[]
* 创建元素
RadiusDiffAbs = 1
* 元素添加到数组中
BallDiffAbsList:=[BallDiffAbsList, RadiusDiffAbs]
区域\图片数组
* 创建数组
gen_empty_obj (BadPadRegions)
* 生成区域 padDetectCircle
* 将区域添加到数组中
concat_obj (BadPadRegions, padDetectCircle, BadPadRegions)
数组的遍历
* 统计数组的个数
count_obj (FoundRegions, objNumber)
* 遍历数组
for I := 1 to objNumber by 1
* 选择其中的一个元素
select_obj (FoundPadRegions, selectRegion, I)
数组中寻找 搜索某个值/搜索数组
* 输出 MinIndex 索引
tuple_find (padDistances, PadsMinDistance, MinIndex)
绝对值
* 数值相减的绝对值
tuple_abs(Radius1 - Radius2, RadiusDiffAbs)
获取数组的最小值、最大值
* 获取数组中最小的值
tuple_min (padDistances, MinDistance)
tuple_max (padDistances, MaxDistance)
计算多个点与中心点的距离 /点点距离/计算点与点距离
* 生成多个 中心点坐标(方便后续多点计算)
tuple_gen_const (Number, PadRow, centerRows)
tuple_gen_const (Number, PadCol, centerCols)
* 多点与点的距离
* Rows, Columns 多点的的数组
* 中心坐标 centerRows centerCols
distance_pp (int(Rows), int(Columns), centerRows, centerCols, padDistances)
* 最近距离
tuple_min (padDistances, PadsMinDistance)
彩色图片==>灰度图片
rgb1_to_gray (Image, GrayImage)
* 抽取通道
access_channel
* 获取通道数
count_channels
* 通道的分离
decompose3
* 合并通道
compose3
获取最大连通域
* 连通域分析
connection (RegionFillUp, ConnectedRegions)
* 获取最大连通域
select_shape_std (ConnectedRegions, SelectedRegions, 'max_area', 100)
连通域的凸包区域
* 凸包区域
shape_trans (RegionFillUp, RegionTrans, 'convex')
最小外接矩形
* 外接矩形
smallest_rectangle2 (RegionTrans, Row, Column, Phi, Length1, Length2)
仿射变换
* 计算仿射变换矩阵
vector_angle_to_rigid (Row, Column, Phi, Row, Column, 0, HomMat2D)
* 将原始图片转正
affine_trans_image (GrayImage, Image2, HomMat2D, 'constant', 'false')
设置显示颜色
dev_set_color ('red')
边栏推荐
猜你喜欢

最强分布式锁工具:Redisson

FinClip | July 2022 Product Highlights

【目标检测】Focal Loss for Dense Object Detection

Detailed explanation of setting HiSilicon MMZ memory and OS memory

罗克韦尔AB PLC RSLogix5000中创建新项目、任务、程序和例程的具体方法和步骤

C专家编程 第3章 分析C语言的声明 3.8 理解所有分析过程的代码段

Component communication - parent-child component communication

To add digital wings to education, NetEase Yunxin released the overall solution of "Internet + Education"

蒋松廷 荣获第六季完美童模全球总决赛 全球总冠军

EasyExcel implements dynamic column parsing and table storage
随机推荐
204. Count Primes
sibling component communication context
数据中台“集存通用治”功能场景说明
Detailed explanation of setting HiSilicon MMZ memory and OS memory
C专家编程 第3章 分析C语言的声明 3.6 typedef int x[10]和#define x int[10]的区别
Kubernetes 笔记 / 入门 / 生产环境 / 容器运行时
Kubernetes 笔记 / 生产环境
C专家编程 第3章 分析C语言的声明 3.5 typedef可以成为你的朋友
Windows 事件查看器记录到 MYSQL
MySQL窗口函数 PARTITION BY()函数介绍
为何微博又双叒叕崩溃了?
C语言04、操作符
Description of the functional scenario of "collective storage and general governance" in the data center
#夏日挑战赛# HarmonyOS 实现一个绘画板
Selective Search学习笔记
JS中对象数组用sort按属性排序
微信小程序 - 数组 push / unshift 追加后数组返回内容为数字(数组添加后打印结果为 Number 数值类型)
C专家编程 第3章 分析C语言的声明 3.4 通过图标分析C语言的声明
Hannah荣获第六季完美童模全球总决赛全球人气总冠军
《社会企业开展应聘文职人员培训规范》团体标准在新华书店上架