示例:读取并处理图片
halcon
源码:
1:
*
读取图片
2:
read_image(Image,
'D:/MyFile/C#/HalconCsExample/
示例图片
.jpg'
)
3:
get_image_size(Image,Width,Height)
4:
5:
*
图像处理
6:
rgb1_to_gray(Image,GrayImage)
导出的代码(
ImagePro
):
1:
//
2:
// File generated by HDevelop for HALCON/DOTNET (C#) Version 10.0
3:
//
4:
// This file is intended to be used with the HDevelopTemplate or
5:
// HDevelopTemplateWPF
projects
located
under
%HALCONEXAMPLES%\c#
6:
7:
using
System;
8:
using
HalconDotNet;
9:
10:
publicpartialclass
HDevelopExport
11:
{
12:
public
HTuplehv_ExpDefaultWinHandle;
13:
14:
// Main procedure
15:
privatevoid
action()
16:
{
17:
18:
// Local iconic variables
19:
20:
HObjectho_Image, ho_GrayImage;
21:
22:
23:
// Local control variables
24:
25:
HTuplehv_Width, hv_Height;
26:
27:
// Initialize local and output iconic variables
28:
HOperatorSet.GenEmptyObj(
out
ho_Image);
29:
HOperatorSet.GenEmptyObj(
out
ho_GrayImage);
30: