当前位置:网站首页>vc hacon 聯合編程 GenImage3Extern WriteImage
vc hacon 聯合編程 GenImage3Extern WriteImage
2022-06-12 19:06: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");//保存圖片到硬盤
}
//保存的圖片打開後如下

边栏推荐
- Six stone cognition: the apparent and potential speed of the brain
- Attack and defense world (WEB) -- supersqli
- How to download proxystrike in China
- Mysql database (28): Variables
- [image denoising] image denoising based on regularization with matlab code
- Cookie & session & kaptcha verification code
- How to modify the authorization of sina Weibo for other applications
- Shell 编程正则表达式及元字符
- Redis中的事务
- CVPR 2022 oral Dalian Institute of technology proposed SCI: a fast and powerful low light image enhancement method
猜你喜欢

超级重磅!Apache Hudi多模索引对查询优化高达30倍

被八股文害惨了。。。

Meituan won the first place in fewclue in the small sample learning list! Prompt learning+ self training practice

Redis(三十二)-用Redis做分布式锁

RT-Thread 模拟器 simulator 搭建 LVGL 的开发调试环境

【0008】无序列表

攻防世界(web篇)---supersqli

Start with no place to live
![leetcode:98. Count the number of subarrays whose score is less than k [double pointers + number of calculated subsets + de duplication]](/img/97/67d74ae93be2cd4c0153a764cbe4c1.png)
leetcode:98. Count the number of subarrays whose score is less than k [double pointers + number of calculated subsets + de duplication]

On how to make digital transformation after the loan of large policy banks- Yixinhuachen
随机推荐
On how to make digital transformation after the loan of large policy banks- Yixinhuachen
【0008】无序列表
Detailed explanation of yolox network structure
YOLOX网络结构详解
A fruitful afternoon
Exploration of a flexible injection scheme for istio sidecar
RT-Thread 模拟器 simulator 搭建 LVGL 的开发调试环境
实验10 Bezier曲线生成-实验提高-控制点生成B样条曲线
Leetcode 494. Objectives and
Wireshark basic commands
The practice of machine learning in meituan distribution system: restoring the real world with technology - Notes
论大型政策性银行贷后,如何数字化转型 ?-亿信华辰
In 2021, the global spice and seasoning revenue is about 18720million US dollars, and it is expected to reach 25960million US dollars in 2028
liunx部署Seata(Nacos版)
leetcode:98. 统计得分小于 K 的子数组数目【双指针 + 计算子集个数 + 去重】
Cookie & session & kaptcha verification code
Dacom G150双模耳机,为爱发声,呵护孩子听力健康成长
Kali2022 how to install w3af
The 14th five year development plan and investment prospect analysis report of China's oil and gas pipeline engineering construction 2022-2027
ISCC2022