是否可以使用 cv::VideoCapture 加载 32 位帧
Is it possible to load 32 bits frames using cv::VideoCapture
我正在尝试使用 cv::VideoCapture 读取一堆CV_32FC1
帧,但它默认像CV_8UC3
一样加载它们。
我尝试使用 VideoCapture::set()
更改对象属性,但该方法一直返回 0。
是否可以使用 cv::VideoCapture 加载CV_32FC1
帧?我在文档中找不到答案,但也找不到代码示例。
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include "opencv2/opencv.hpp"
int main(int argc , char** argv )
{
VideoCapture capture;
// return always 0:
std::cout << "FORMAT" = " << capture.get( CV_CAP_PROP_FORMAT ) << std::endl;
capture("./frames/frame_%02d.BMP";
// return always 0:
std::cout << "FORMAT" = " << capture.get( CV_CAP_PROP_FORMAT ) << std::endl;
// status is always false
bool status = capture.set( CV_CAP_PROP_FORMAT, CV_32FC1 );
// still 0:
std::cout << "FORMAT" = " << capture.get( CV_CAP_PROP_FORMAT ) << std::endl;
if( !capture.isOpened() ) // isok?
return -1;
cv::Mat image;
capture.read( image );
// image is 8UC3
return 0;
}
欢迎任何评论,提前感谢。
正如 berak 在评论中的 sait :
"Is it possible to load CV_32FC1 frames using cv::VideoCapture?" - no. also, you can't store float images in a .bmp
相关文章:
- WinAPI C++如何从 64 位应用程序加载资源
- 从C/C++(Win64)中的内存加载64位DLL
- 如何从路径字符串加载Gdiplus::位图
- 如何从资源文件(.rc 文件)加载位图?
- 将RFC5114中定义的 1024 位 P 和 G 值加载到 boost uint1024 中
- 为什么SSE有128位加载函数?
- 如何诊断保存和加载位向量(std::vector)的奇怪行为<bool>?
- 如何在 64 位窗口中加载 32 位 DLL
- 尝试从资源加载位图返回NULL,错误代码为1813
- 使用D3DXLOADSURFAFROMEMORY加载位图
- 无法从资源加载位图
- 是否可以使用 cv::VideoCapture 加载 32 位帧
- 无法从内存正确加载位图
- 在C++中加载位图时出现Big Endian问题
- 加载openv帧时ogre的loadRawData内存问题
- 是否有一些方法可以使用CBitmap::FromHandle在Cimagelist上加载位图
- 如何在不完全重新加载每帧每个像素的情况下更改图像的 alpha 值/ 优化
- 使用GetDIBits加载位图
- 加载位图文件(.bmp)
- visual studio 2010 -加载位图图像到WINApi c++和显示