Halcon——opencv的Mat和Halcon的Hobject互转

 Mat转Hobject:

void Mat_2_HImage(Mat img, Hobject & HImage)
{

	int height = img.rows;
	int width = img.cols;
	
	uchar *dataGray = new uchar[width*height];

	for(int i = 0; i

Hobject转Mat:

void HImage_2_Mat(Hobject *HImage, Mat *dst)
{

	HTuple hv_Pointer, hv_byte;
	int W = 0, H = 0;
	cout<<"get_image_pointer1 before"<data, pdata, W*H);

}

 

你可能感兴趣的:(Halcon工业检测)