您的当前位置:首页正文

VisionMaster--数据转换

2024-11-22 来源:个人技术集锦
HKA_IMAGE gen_img(IN MVDSDK_BASE_MODU_INPUT* modu_input)
{
    HKA_IMAGE inputimage = { HKA_IMG_MONO_08,0 };
	inputimage.width = modu_input->pImageInObj->GetWidth();
	inputimage.height = modu_input->pImageInObj->GetHeight();
	inputimage.step[0] = inputimage.width;
	inputimage.data[0] = (char*)malloc(inputimage.width * inputimage.height);
	if (inputimage.data[0] != NULL)
	{
		memset(inputimage.data[0], 0, inputimage.width * inputimage.height);
		memcpy_s(inputimage.data[0],inputimage.width * inputimage.height, 
			modu_input->pImageInObj->GetImageData(0)->pData, modu_input->pImageInObj->GetImageData(0)->nSize);
	}

    return inputimage
}
	cv::Mat SRC_IMG;
	if (inputimage.format == HKA_IMG_MONO_08)
	{
		SRC_IMG = cv::Mat(inputimage.height, inputimage.width, CV_8UC1, inputimage.data[0]);
	}

显示全文