当前位置:网站首页>将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;
}
边栏推荐
- Data analysis - similarities and differences between C-end and b-end data analysis
- Reverse output an integer
- LeetCode 31 ~ 40
- Sunshine boy chenhaotian was invited to be the spokesperson for the global finals of the sixth season perfect children's model
- PTA class a simulated third bomb: 1140-1143
- Find the multiplication order of n
- 17.11 std::atomic续谈、std::async深入谈
- One minute to understand the difference between synchronous, asynchronous, blocking and non blocking
- easyexcel读取文件
- Record a weird picture upload problem
猜你喜欢

Visual studio 2013 redistributable is installed, but MySQL installation fails

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

图形渲染管线

关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法

王老吉药业“关爱烈日下最可爱的人”公益活动在杭启动

Show spirit chenzitong was invited to be the chief experience officer of the global finals of the sixth season perfect children's model

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

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

Mot - clé C facile à comprendre statique

pixel 6 root
随机推荐
Differences and functions of export set env in makefile
图形渲染管线
Abnova anti GBA monoclonal antibody solution
Tcp网络通信中各个状态的含义
PTA class a simulated fifth bomb: 1148-1151
The 19th - 22nd week of scientific research training - about tnet and memnet
Wechat circle of friends test point
biggan:large scale gan training for high fidelity natural image synthesis
Principle of voice wake-up
The first intimate contact of caching technology
Tengwenze, a hot-blooded boy, was invited to serve as the image ambassador of the global finals of the sixth season perfect children's model
创建OpenGl窗口
PTA class a simulated ninth bullet: 1114-1117
How to add a "security lock" to the mobile office of government and enterprises?
一分钟了解同步、异步、阻塞和非阻塞的区别
Use of redis
求n乘阶之和
Computer shortcut keys commonly used by experts
It's better to finish one than start thousands of times (reprinted from Douban)
俏皮少女王艺璇 受邀担任第六季完美童模全球总决赛推广大使