Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image processing 用于原始二进制文件的opencv_Image Processing_Opencv_Computer Vision - Fatal编程技术网

Image processing 用于原始二进制文件的opencv

Image processing 用于原始二进制文件的opencv,image-processing,opencv,computer-vision,Image Processing,Opencv,Computer Vision,我有一个文件,它使用opencv将拜耳过滤器应用于黑白图片的图像,从而为其提供RGB值。当我运行一个16位无符号整数映像时,一切都很好,但当我运行一个8位无符号整数时,我得到以下错误代码: OpenCV Error: Unspecified error (could not find a writer for the specified extension) in imwrite_, file /build/buildd/opencv-2.3.1/modules/highgui/src/load

我有一个文件,它使用opencv将拜耳过滤器应用于黑白图片的图像,从而为其提供RGB值。当我运行一个16位无符号整数映像时,一切都很好,但当我运行一个8位无符号整数时,我得到以下错误代码:

OpenCV Error: Unspecified error (could not find a writer for the specified extension) in imwrite_, file /build/buildd/opencv-2.3.1/modules/highgui/src/loadsave.cpp, line 276
terminate called after throwing an instance of 'cv::Exception'
  what():  /build/buildd/opencv-2.3.1/modules/highgui/src/loadsave.cpp:276: error: (-2) could not find a writer for the specified extension in function imwrite_

你知道我可以下载什么插件或扩展来处理更多的图像类型吗?我用Ubuntu命令行运行程序,处理程序是用C++编写的。我使用python imaging库进行了初始处理,将其从16位无符号整数更改为16位。

在运行之前,您始终可以编写代码将8位
无符号整数
图像转换为16位
无符号整数
。告诉你怎么做,小菜一碟

我没有写C++,我只是在做Python转换,没有很多C++的经验,但我想我能找到答案。代码是否会在C++代码中正确运行?这就是我所说的代码:CVMAT*DESTHMETMERSMAT = CVCRATATEMAT(480, 640,CVY16UC1);cv::Mat m2(深度计,真实值);m2.convertTo(m2,CV_8U);当然,只要对大小和类型进行一些转换,我就可以回答这个问题,如果我可以访问你的代码,而我没有。所以我想你得亲自去看看。