142 lines
8.2 KiB
C++
142 lines
8.2 KiB
C++
#pragma once
|
|
#include<halconcpp/HalconCpp.h>
|
|
#include<halconcpp/HDevThread.h>
|
|
|
|
//#include <opencv2/opencv.hpp>
|
|
//#include <opencv2/imgcodecs/imgcodecs.hpp>
|
|
|
|
using namespace HalconCpp;
|
|
|
|
#if 1 后端调用函数
|
|
/*
|
|
* 端面高度差测量函数
|
|
|
|
*/
|
|
extern "C" __declspec(dllexport) void _stdcall _984_10_3D(HObject ho_Image_H, HObject ho_Image_L, HTuple hv_in_x, HTuple hv_in_y,
|
|
HTuple hv_in_z, HTuple * hv_out_meanValue, HTuple * hv_out_maxValue, HTuple * hv_out_minValue,
|
|
HTuple * hv_Make);
|
|
/*
|
|
二维码识别函数
|
|
*/
|
|
extern "C" __declspec(dllexport) void _stdcall _984_10_erweima(HObject ho_InputImage, HTuple hv_Path, HTuple * hv_out_string,
|
|
HTuple * hv_make);
|
|
/*
|
|
电池侧面长度测量
|
|
*/
|
|
extern "C" __declspec(dllexport) void _stdcall _984_10_distance_CM(HObject ho_IputMendImage, HObject ho_IputImage, HTuple * hv_DistanceMin,
|
|
HTuple * hv_DistanceMax, HTuple * hv_Lines1, HTuple * hv_Lines2, HTuple * hv_Make);
|
|
/*
|
|
电池正极同心度检测
|
|
*/
|
|
extern "C" __declspec(dllexport) void _stdcall _984_10_Positive_Concentricity(HObject ho_InputImage, HTuple * hv_Out_Circle1,
|
|
HTuple * hv_Out_Circle2, HTuple * hv_Distance, HTuple * hv_Make);
|
|
//电池胶圈及极柱测量
|
|
extern "C" __declspec(dllexport) void _stdcall _984_10_Pole_rubber_Distance(HObject ho_InputImge, HObject ho_InputImge_L,
|
|
HTuple * hv_Out_Circle1, HTuple * hv_Out_Circlel2, HTuple * hv_Out_Circlel3, HTuple * hv_Pole_Pillar_Distance,
|
|
HTuple * hv_Rubber_rings_Distance, HTuple * hv_Make);
|
|
//二维码测量
|
|
extern "C" __declspec(dllexport) void _stdcall _984_10_QR_measurement(HObject ho_InputImage1, HObject ho_InputImage2, HTuple * hv_left_Line,
|
|
HTuple * hv_Right_Line, HTuple * hv_Up_Line, HTuple * hv_down_Line, HTuple * hv_Left_right_distance,
|
|
HTuple * hv_Up_down_distance, HTuple * hv_Make);
|
|
//2D转3D
|
|
//extern "C" __declspec(dllexport) void _stdcall _10_2d_3d(HObject ho_Light_Image, HObject ho_Light_Image_T, HObject ho_Gray_Image,
|
|
// HObject ho_Gray_Image_T, HObject ho_Image_T, HObject ho_Input_H, HObject * ho_Light_ImageOut,
|
|
// HObject * ho_Light_ImageTOut, HTuple hv_in_x, HTuple hv_in_y, HTuple hv_in_z,
|
|
// HTuple * hv_out_meanValue, HTuple * hv_out_maxValue, HTuple * hv_out_minValue, HTuple * hv_out_Point);
|
|
|
|
extern "C" __declspec(dllexport) void _stdcall _10_2d_3d(HObject ho_Light_Image, HObject ho_Light_Image_T, HObject ho_Gray_Image,
|
|
HObject ho_Gray_Image_T, HObject ho_Image_T, HObject ho_Light_ImageOut, HObject * ho_Light_ImageTOut,
|
|
HTuple hv_in_x, HTuple hv_in_y, HTuple hv_in_z, HTuple * hv_out_meanValue, HTuple * hv_out_maxValue,
|
|
HTuple * hv_out_minValue, HTuple * hv_out_Point, HTuple * hv_segNumber, HTuple * hv_Scale_row,
|
|
HTuple * hv_Scale_Column);
|
|
|
|
// 二维码刻码角度补偿
|
|
extern "C" __declspec(dllexport) void _stdcall _984_10_Engraving_Angle(HObject ho_InputImage, HTuple * hv_Line1, HTuple * hv_Line2,
|
|
HTuple * hv_Line3, HTuple * hv_Rotation_Angle, HTuple * hv_Make, HTuple * hv_QR_number);
|
|
|
|
//灰度计算
|
|
extern "C" __declspec(dllexport) void _stdcall _984_10_Gray_scale_calculation(HObject ho_InputImageseg, HObject ho_InputImage,
|
|
HTuple * hv_CenterRows, HTuple * hv_CenterColumns, HTuple * hv_CircumscribedRectangle,
|
|
HTuple * hv_SegNumber, HTuple * hv_Gray, HTuple * hv_Make);
|
|
#endif
|
|
|
|
#if 1 halcon调用函数
|
|
//3D
|
|
void cal_height_gap(HObject ho_in_imageH, HObject ho_in_zeroRegion, HObject ho_in_calRegion,
|
|
HTuple hv_in_zeroMode, HTuple hv_in_xResolution, HTuple hv_in_yResolution, HTuple hv_in_zResolution,
|
|
HTuple* hv_out_meanValue, HTuple* hv_out_maxValue, HTuple* hv_out_minValue);
|
|
|
|
void cal_region_gap(HObject ho_imageX, HObject ho_imageY, HObject ho_imageZ, HObject ho_zeroRegion,
|
|
HObject ho_calRegion, HTuple* hv_meanValue, HTuple* hv_maxValue, HTuple* hv_minValue);
|
|
|
|
void get_normal_region(HObject ho_imageH, HObject ho_tmpDetectRegion, HObject ho_tmpZeroRegion,
|
|
HObject* ho_detectRegion, HObject* ho_zeroRegion);
|
|
void get_normal_region_1(HObject ho_imageH, HObject ho_tmpDetectRegion, HObject ho_tmpZeroRegion,
|
|
HObject* ho_detectRegion, HObject* ho_zeroRegion);
|
|
|
|
void _984_10_3D_Hight(HObject ho_InputImage, HObject ho_Input_Rogion, HTuple hv_in_x,
|
|
HTuple hv_in_y, HTuple hv_in_z, HTuple* hv_out_meanValue, HTuple* hv_out_maxValue,
|
|
HTuple* hv_out_minValue, HTuple* hv_Make);
|
|
void analyze_graph_event(HObject ho_BackgroundImage, HTuple hv_MouseMapping, HTuple hv_Button,
|
|
HTuple hv_Row, HTuple hv_Column, HTuple hv_WindowHandle, HTuple hv_WindowHandleBuffer,
|
|
HTuple hv_VirtualTrackball, HTuple hv_TrackballSize, HTuple hv_SelectedObjectIn,
|
|
HTuple hv_Scene3D, HTuple hv_AlphaOrig, HTuple hv_ObjectModel3DID, HTuple hv_CamParam,
|
|
HTuple hv_Labels, HTuple hv_Title, HTuple hv_Information, HTuple hv_GenParamName,
|
|
HTuple hv_GenParamValue, HTuple hv_PosesIn, HTuple hv_ButtonHoldIn, HTuple hv_TBCenter,
|
|
HTuple hv_TBSize, HTuple hv_WindowCenteredRotationlIn, HTuple hv_MaxNumModels,
|
|
HTuple* hv_PosesOut, HTuple* hv_SelectedObjectOut, HTuple* hv_ButtonHoldOut,
|
|
HTuple* hv_WindowCenteredRotationOut);
|
|
void cal_height_gap(HObject ho_in_imageH, HObject ho_in_zeroRegion, HObject ho_in_calRegion,
|
|
HTuple hv_in_zeroMode, HTuple hv_in_xResolution, HTuple hv_in_yResolution, HTuple hv_in_zResolution,
|
|
HTuple* hv_out_meanValue, HTuple* hv_out_maxValue, HTuple* hv_out_minValue);
|
|
void cal_region_gap(HObject ho_imageX, HObject ho_imageY, HObject ho_imageZ, HObject ho_zeroRegion,
|
|
HObject ho_calRegion, HTuple* hv_meanValue, HTuple* hv_maxValue, HTuple* hv_minValue);
|
|
void color_string_to_rgb(HTuple hv_Color, HTuple* hv_RGB);
|
|
void determine_optimum_pose_distance(HTuple hv_ObjectModel3DID, HTuple hv_CamParam,
|
|
HTuple hv_ImageCoverage, HTuple hv_PoseIn, HTuple* hv_PoseOut);
|
|
|
|
|
|
//2D
|
|
void gen_arrow_contour_xld(HObject* ho_Arrow, HTuple hv_Row1, HTuple hv_Column1,
|
|
HTuple hv_Row2, HTuple hv_Column2, HTuple hv_HeadLength, HTuple hv_HeadWidth);
|
|
void get_rectangle2_corners(HTuple hv_Row, HTuple hv_Column, HTuple hv_Phi, HTuple hv_Length1,
|
|
HTuple hv_Length2, HTuple* hv_row, HTuple* hv_col);
|
|
void pts_to_best_line(HObject* ho_Line, HTuple hv_Rows, HTuple hv_Cols, HTuple hv_ActiveNum,
|
|
HTuple* hv_Row1, HTuple* hv_Column1, HTuple* hv_Row2, HTuple* hv_Column2);
|
|
void rake(HObject ho_Image, HObject* ho_Regions, HTuple hv_Elements, HTuple hv_DetectHeight,
|
|
HTuple hv_DetectWidth, HTuple hv_Sigma, HTuple hv_Threshold, HTuple hv_Transition,
|
|
HTuple hv_Select, HTuple hv_Row1, HTuple hv_Column1, HTuple hv_Row2, HTuple hv_Column2,
|
|
HTuple* hv_ResultRow, HTuple* hv_ResultColumn);
|
|
void pts_to_best_circle(HObject* ho_Circle, HTuple hv_Rows, HTuple hv_Cols, HTuple hv_ArcType,
|
|
HTuple hv_ActiveNum, HTuple* hv_RowCenter, HTuple* hv_ColCenter, HTuple* hv_Radius,
|
|
HTuple* hv_StartPhi, HTuple* hv_EndPhi, HTuple* hv_PointOrder, HTuple* hv_ArcAngle);
|
|
void region_to_spoke(HObject ho_Region, HTuple hv_Offset, HTuple* hv_SpokeRows,
|
|
HTuple* hv_SpokeCols);
|
|
void spoke(HObject ho_Image, HObject* ho_Regions, HTuple hv_Elements, HTuple hv_DetectHeight,
|
|
HTuple hv_DetectWidth, HTuple hv_Sigma, HTuple hv_Threshold, HTuple hv_Transition,
|
|
HTuple hv_Select, HTuple hv_ROIRows, HTuple hv_ROICols, HTuple hv_Direct, HTuple* hv_ResultRow,
|
|
HTuple* hv_ResultColumn, HTuple* hv_ArcType);
|
|
void spoke_pairs(HObject ho_Image, HObject* ho_Regions, HTuple hv_Elements, HTuple hv_DetectHeight,
|
|
HTuple hv_DetectWidth, HTuple hv_Sigma, HTuple hv_Threshold, HTuple hv_Transition,
|
|
HTuple hv_Select, HTuple hv_ROIRows, HTuple hv_ROICols, HTuple hv_Direct, HTuple* hv_ResultRow1,
|
|
HTuple* hv_ResultColumn1, HTuple* hv_ResultRow2, HTuple* hv_ResultColumn2, HTuple* hv_MenDistance,
|
|
HTuple* hv_ArcType);
|
|
|
|
//胡工的找圆函数
|
|
void Get_Region_Spoke(HObject ho_Region, HTuple hv_Offset, HTuple* hv_SpokeRows,
|
|
HTuple* hv_SpokeCols);
|
|
void Get_Spoke(HObject ho_Image, HObject* ho_Regions, HTuple hv_ROIRows, HTuple hv_ROICols,
|
|
HTuple hv_Elements, HTuple hv_Direct, HTuple hv_DetectHeight, HTuple hv_DetectWidth,
|
|
HTuple hv_Transition, HTuple hv_Select, HTuple hv_Sigma, HTuple hv_Threshold,
|
|
HTuple* hv_ArcType, HTuple* hv_ResultRow, HTuple* hv_ResultColumn);
|
|
void Get_Best_Circle(HObject* ho_Circle, HTuple hv_Rows, HTuple hv_Cols, HTuple hv_ActiveNum,
|
|
HTuple hv_ArcType, HTuple* hv_RowCenter, HTuple* hv_ColCenter, HTuple* hv_Radius,
|
|
HTuple* hv_StartPhi, HTuple* hv_EndPhi, HTuple* hv_ArcAngle, HTuple* hv_PointOrder);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|