read_image (Image_Ori, 'small.jpg')
get_image_size (Image_Ori, Width, Height)
count_obj (Image_Ori, Number_Ori)
gen_rectangle1(Rectangle, 0, 0, Height-1, Width-1)
get_region_points(Rectangle, Rows, Cols)
if (Number_Ori == 3)
decompose3 (Image_Ori, ImageR_Ori, ImageG_Ori, ImageB_Ori)
get_grayval(ImageR_Ori, Rows, Cols, GrayvalsR_Ori)
get_grayval(ImageG_Ori, Rows, Cols, GrayvalsG_Ori)
get_grayval(ImageB_Ori, Rows, Cols, GrayvalsB_Ori)
else
get_grayval(Image_Ori, Rows, Cols, Grayvals_Ori)
endif
gen_rectangle1(Rectangle, 0, 0, Height-1, Width-1)
get_region_points(Rectangle, Rows, Cols)
Rows:=Rows+120
Cols:=Cols+120
read_image (Image_Background, 'big.jpg')
count_obj (Image_Background, Number_Background)
if (Number_Background == 3)
decompose3 (Image_Background, ImageR_Background, ImageG_Background, ImageB_Background)
set_grayval(ImageR_Background, Rows, Cols, GrayvalsR_Ori)
set_grayval(ImageG_Background, Rows, Cols, GrayvalsG_Ori)
set_grayval(ImageB_Background, Rows, Cols, GrayvalsB_Ori)
compose3 (ImageR_Background, ImageG_Background, ImageB_Background, MultiChannelImage)
else
set_grayval(Image_Background, Rows, Cols, Grayvals_Ori)
SingleChannelImage := Image_Background
endif
Halcon小图片粘贴到大图片指点位置
于 2024-12-05 22:31:52 首次发布