halcon错误备忘录

C#编译部分代码时出现的错误

Wrong number of control values  in local procedure: 'check_color' line: 13, assign_at: 

Input parameter 2 ('Value') must have one element or the same number of elements as parameter 1 ('Index')
提示出入参数不正确,返回halcon运行。

Rotate_R(Image::SelectedRegion:ImagePart)

*切割出电阻
* threshold (Image, Regions, 0, 220)
* connection (Regions, ConnectedRegions)
* select_shape_std (ConnectedRegions, SelectedRegions, 'max_area', 70)
fill_up (SelectedRegion, RegionFillUp)
erosion_circle (RegionFillUp, RegionErosion, 8)
shape_trans (RegionErosion, RegionTrans, 'rectangle2')
reduce_domain (Image, RegionTrans, ImageReduced)
crop_domain (ImageReduced, ImagePart1)
threshold (ImagePart1, Region, 0, 255)//此行出错,输入参数被我改成上一句的输入参数ImageReduced,导致最终仿射变换失败,图像全黑
    
area_center (Region, Area, Row, Column)
orientation_region (Region, Phi)
vector_angle_to_rigid (Row, Column, Phi, Row, Column, 0, HomMat2D)
affine_trans_image (ImagePart1, ImagePart, HomMat2D, 'constant', 'false')
     

return ()
此为将电阻进行仿射变换矫正位置的代码

check_color(Image::Parameters:Result)

MinValue:=Parameters[4]
MaxValue:=Parameters[5]



gray_features (Image, Image, 'mean', Value)//报错位置
if (Value>MinValue and Value
由于电阻位置矫正出错导致gray_features函数Image输入出错,才会报错


你可能感兴趣的:(halcon错误备忘录)