当前位置:网站首页>将weishi相机图片进行转换
将weishi相机图片进行转换
2022-06-26 00:26:00 【ooolmf】
//将相机的图像,转变为投影仪用的
int Cmy3DScanMFCDlg::OnStreamCB(MV_IMAGE_INFO *pInfo)
{
/*! * \brief 将回调函数收到的图像信息转换为图像。 * \param [in] hCam 相机句柄 * \param [in] pInfo 采集Callback函数中传来的图像信息指针 * \param [out] pImage 转换结果图像的指针 * \retval MVST_SUCCESS : 成功 */
//MVCamra类cam
MVInfo2Image(cam.hCam, pInfo, &cam.mvimage);
//获取图像宽
int w = cam.mvimage.GetWidth();
//获取图像宽
int h = cam.mvimage.GetHeight();
//CV_8UC3 8位深度,无符号,3通道,就是RGB相机
cam.src.create(h, w, CV_8UC3);
//将彩色图像数据转换为OpenCV的Mat数据格式
MVSTATUS_CODES r;//错误枚举对象,在相机的头文件中MVSTATUS_CODES
/*!MVBayerToBGR * \brief 将Bayer格式的8bit单通道图转换为BGR格式的8Bit三通道图 * \param [in] hCam 相机句柄 * \param [in] psrc 单通道图像的指针 * \param [out] pdst 三通道图像指针 * \param [in] dststep 三通道图像一行图像的字节数。通常为图像宽度*3,但是会为了4字节对齐会补几个字节。 * \param [in] width 图像宽度 * \param [in] height 图像高度 * \param [in] pixelformat 像素格式,由MVGetPixelFormat取得 * \param [in] bMultiCores 是否使用CPU多核计算 * \retval MVST_SUCCESS : 成功 */
r = MVBayerToBGR(cam.hCam, pInfo->pImageBuffer, cam.src.data, w * 3, w, h, cam.pixelformat);
if (r != MVST_SUCCESS)
{
::MessageBox(NULL, _T("转换失败 "), _T("错误"), MB_OK);
/*cout << "转换失败 " << "原因:" << r << endl;*/
}
else /*cout << "转换成功" << endl*/;
//利用cv的进行显示图片
showCamInCall(cam.src);
/*cv::namedWindow("src", 0); cv::resizeWindow("src", cv::Size(800, 600)); cv::imshow("src", cam.src);*/
//cv::waitKey(50);
return 0;
}
边栏推荐
- Redis7.0 installation steps
- How to set achievable medium - and long-term goals?
- readv & writev
- 俏皮少女王艺璇 受邀担任第六季完美童模全球总决赛推广大使
- How to set an achievable annual goal?
- One minute to understand the difference between synchronous, asynchronous, blocking and non blocking
- 关于strlen与sizeof的区别
- easyexcel读取文件
- PTA class a simulated fifth bomb: 1148-1151
- CYCA少儿形体礼仪 乐清市培训成果考核圆满落幕
猜你喜欢

The 19th - 22nd week of scientific research training - about tnet and memnet

biggan:large scale gan training for high fidelity natural image synthesis

甜酷少女金书伊 受邀担任第六季完美童模全球总决赛代言人

One stop solution EMQ for hundreds of millions of communication of Internet of things

What happens from entering a web address in the browser's input box to seeing the contents of the web page?

cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network

-- EGFR FISH probe solution

俏皮少女王艺璇 受邀担任第六季完美童模全球总决赛推广大使

Abnova anti GBA monoclonal antibody solution

分布式系统(二)分布式事务的理解
随机推荐
Tcp网络通信中各个状态的含义
求n乘阶之和
On the difference between strlen and sizeof
17.11 std:: atomic continuation, std:: async in-depth discussion
如何使用命令将文件夹中的文件名(包括路径)写入到txt文件中
一分钟了解同步、异步、阻塞和非阻塞的区别
How to set achievable medium - and long-term goals?
readv & writev
cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
wifi 的理论速度计算方法
The 19th - 22nd week of scientific research training - about tnet and memnet
makefile 中export set ENV 的区别和作用
安装了Visual Studio 2013 Redistributable,mysql还是安装失败
Pre ++, post ++ and pre -- and post -- (+a, a++ and --a, a--)
PTA class a simulated seventh bomb: 1160-1163
Dataframe to list
CYCA少儿形体礼仪 乐清市培训成果考核圆满落幕
求n的乘阶
Wechat circle of friends test point
Easyexcel read file