当前位置:网站首页>vc hacon 联合编程 GenImage3Extern WriteImage
vc hacon 联合编程 GenImage3Extern WriteImage
2022-06-12 19:02:00 【weixin_39926429】
//在以前的文章中描述了联合编程读图,详见vc halcon 联合编程的配置 ReadImage demo_weixin_39926429的博客-CSDN博客
//本文描述生成图片和保存图片到硬盘。
void NewImage(HObject* pHobj)
{
unsigned char* image_red;
unsigned char* image_green;
unsigned char* image_blue;
int r, c;
image_red = (unsigned char*)malloc(640 * 480);
image_green =( unsigned char*) malloc(640 * 480);
image_blue = (unsigned char*)malloc(640 * 480);
for (r = 0; r < 480; r++)
for (c = 0; c < 640; c++)
{
image_red[r * 640 + c] = c % 255;
image_green[r * 640 + c] = (c + 64) % 255;
image_blue[r * 640 + c] = (c + 128) % 255;
}
//halcon 函数生成图片
GenImage3Extern(pHobj, "byte", 640, 480, (Hlong)image_red, \
(Hlong)image_green, (Hlong)image_blue, (Hlong)free);
}
main()
{ HObject Image;
NewImage(&Image);
WriteImage(Image, "bmp", 0, "d:\\test1000.bmp");//保存图片到硬盘
}
//保存的图片打开后如下
边栏推荐
- [image denoising] image denoising based on anisotropic filtering with matlab code
- 数据库全量SQL分析与审计系统性能优化之旅
- Redis(三十二)-用Redis做分布式锁
- Uniapp uses the Ali Icon
- Attack and defense world (WEB) -- supersqli
- 王学岗room+paging3
- bilibili视频列表名字太长显示不全的解决方法
- MySQL数据库(28):变量 variables
- 【矩阵论 & 图论】期末考试复习思维导图
- WinCC7.5 SP1调整画面尺寸以适应显示分辨率的方法
猜你喜欢
[5gc] Introduction to three SSC (session and service continuity) modes
[matrix theory & graph theory] final exam review mind map
[0008] unordered list
leetcode:5270. Minimum path cost in Grid [simple level DP]
WinCC7.5 SP1调整画面尺寸以适应显示分辨率的方法
吃饭咯 干锅肥肠 + 掌中宝!
In 2021, the global revenue of chlorinated polyvinyl chloride (CPVC) was about $1809.9 million, and it is expected to reach $3691.5 million in 2028
OpenGL shadow implementation (soft shadow)
leetcode:6095. 强密码检验器 II【简单模拟 + 不符合直接False】
Research Report on the overall scale, major manufacturers, major regions, products and application segments of lifeboats in the global market in 2022
随机推荐
Cookie & Session & kaptcha验证码
【图像去噪】基于各向异性滤波实现图像去噪附matlab代码
leetcode:6096. 咒语和药水的成功对数【排序 + 二分】
no available service ‘null‘ found, please make sure registry config correct
io.seata.common.exception.FrameworkException: can not connect to services-server.
Standard library template learning introduction original
A journey of database full SQL analysis and audit system performance optimization
How to download Vega in China
liunx部署Seata(Nacos版)
bilibili视频列表名字太长显示不全的解决方法
实验10 Bezier曲线生成-实验提高-交互式生成B样条曲线
Global and Chinese smart government industry market research and investment risk outlook report 2022-2028
Design of smart home control system (onenet) based on stm32_ two thousand and twenty-two
Cookie & Session & kaptcha驗證碼
Redis (XXXII) - using redis as a distributed lock
ISCC2022
Leetcode 1049. Weight of the last stone II
232-CH579M学习开发-以太网例程-TCP服务器(项目应用封装,局域网或广域网测试)
tarfile解压嵌套tar
Super heavy! Apache Hudi multimode index optimizes queries up to 30 times