当前位置:网站首页>Halcon draw area into picture
Halcon draw area into picture
2022-06-24 14:08:00 【Tingyi - flying bird】
Draw the area into the picture ( grayscale )
The area color is white
public static HImage WriteRegion(HImage baseImg, HRegion wRegion)
{
int nWidth, nHeight;
baseImg.GetImageSize(out nWidth, out nHeight);
HImage zeroImage = new HImage();
zeroImage.GenImageConst("byte", nWidth, nHeight);
zeroImage = zeroImage.PaintRegion(wRegion, (HTuple)255, "fill");
return zeroImage;
}
Draw the area into the picture ( Color picture )
The color of the area can be RGB Component setting .
public static HImage GetRegionRGB(HImage baseImg, HRegion wRegion, int iR, int iG, int iB)
{
HImage imgResult = baseImg.CopyImage();
HImage imgR = new HImage();
HImage imgB = new HImage();
HImage imgG = new HImage();
HRegion wBig = wRegion.DilationCircle(3.5);
HRegion wInside = wRegion.DilationCircle(1.5);
HRegion outRegion = wBig.Difference(wInside);
imgR = imgResult.Decompose3(out imgG, out imgB);
imgR = imgR.PaintRegion(outRegion, (HTuple)iR, "fill");
imgG = imgG.PaintRegion(outRegion, (HTuple)iG, "fill");
imgB = imgB.PaintRegion(outRegion, (HTuple)iB, "fill");
imgResult = imgR.Compose3(imgG, imgB);
return imgResult;
}
边栏推荐
- 一个团队可以既做项目又做产品吗?
- Jericho turns on shouting in all modes to increase mic automatic mute [chapter]
- **Puzzling little problem in unity - light and sky box
- Unity 热力图建立方法
- Prometheus pushgateway
- Docker安装redis
- unity 等高线创建方法
- 2022 coal mine gas drainage operation certificate examination questions and simulation examination
- 智慧园区SaaS管理系统解决方案:赋能园区实现信息化、数字化管理
- 位于相同的分布式端口组但不同主机上的虚拟机无法互相通信
猜你喜欢

如何解决 Iterative 半监督训练 在 ASR 训练中难以落地的问题丨RTC Dev Meetup
![Jerry's infrared filtering [chapter]](/img/6b/7c4b52d39a4c90f969674a5c21b2c7.png)
Jerry's infrared filtering [chapter]

百度地图API绘制点及提示信息

Dragon lizard developer said: first time you got an electric shock, so you are such a dragon lizard community| Issue 8

HarmonyOS. two

win10系统问题

杰理之串口接收 IO 需要设置数字功能【篇】

SAP Marketing Cloud 功能概述(三)

Mit-6.824-lab4a-2022 (ten thousand words explanation - code construction)

How to manage tasks in the low code platform of the Internet of things?
随机推荐
Operation of simulated test question bank and simulated test platform for safety production management personnel of fireworks and firecrackers production units in 2022
数学之英文写作——基本中英文词汇(几何与三角的常用词汇)
[5g NR] 5g NR system architecture
pip uninstall all packages except builtin package
2022年施工升降机司机(建筑特殊工种)考试试题及在线模拟考试
二叉树中最大路径和[处理好任意一颗子树,就处理好了整个树]
4个不可不知的“安全左移”的理由
杰理之TIMER0 用默认的 PA13 来检测脉宽【篇】
Kotlin coordination channel
MIT-6.824-lab4A-2022(万字讲解-代码构建)
位于相同的分布式端口组但不同主机上的虚拟机无法互相通信
PM也要学会每天反省
Jupyter notebook操作
百度地图API绘制点及提示信息
Promotion of Project Manager
greendao使用问题
杰理之检测 MIC 能量自动录音自动播放参考【篇】
杰理之开了多种解码格式插卡到播放等待的时间长【篇】
Home office should be more efficient - automated office perfectly improves fishing time | community essay solicitation
【从零开始学zabbix】一丶Zabbix的介绍与部署Zabbix