Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

blobFromImage is giving wrong value.

i am creating 4-dimensional blob from image cv::dnn::blobFromImage() function but it is giving rows = -1, cols = -1 and data = " ". i am using simple code as shown below.

Mat inImage = imread("A_1.ppm, 1);
Mat rgbImage;
cvtColor(inImage, rgbImage, COLOR_BGRA2RGB );
Mat 4DImage(rgbImage, 1.0, Size(rgbImage.rows, rgbImage.cols), Scalar(0, 0, 0), false, false);

return 0;

blobFromImage is giving wrong value.

i am creating 4-dimensional blob from image cv::dnn::blobFromImage() function but it is giving rows = -1, cols = -1 and data = " ". i am using simple code as shown below.

Mat inImage = imread("A_1.ppm, 1);
Mat rgbImage;
cvtColor(inImage, rgbImage, COLOR_BGRA2RGB );
Mat 4DImage(rgbImage, 1.0, Size(rgbImage.rows, rgbImage.cols), Scalar(0, 0, 0), false, false);

return 0;

blobFromImage is giving wrong value.

Hi @dkurt i am creating 4-dimensional blob from image cv::dnn::blobFromImage() function but it is giving rows = -1, cols = -1 and data = " ". i am using simple code as shown below.

Mat inImage = imread("A_1.ppm, 1);
Mat rgbImage;
cvtColor(inImage, rgbImage, COLOR_BGRA2RGB );
Mat 4DImage(rgbImage, 1.0, Size(rgbImage.rows, rgbImage.cols), Scalar(0, 0, 0), false, false);

return 0;

blobFromImage is giving wrong value.

Hi @dkurt i am creating 4-dimensional blob from image cv::dnn::blobFromImage() function but it is giving rows = -1, cols = -1 and data = " ". i am using simple code as shown below.

Mat inImage = imread("A_1.ppm, 1);
Mat rgbImage;
cvtColor(inImage, rgbImage, COLOR_BGRA2RGB );
Mat 4DImage(rgbImage, 4DImage = dnn::blobFromImage (rgbImage, 1.0, Size(rgbImage.rows, rgbImage.cols), Scalar(0, 0, 0), false, false);

return 0;
click to hide/show revision 5
None

updated 2019-04-21 02:14:55 -0600

berak gravatar image

blobFromImage is giving wrong value.

Hi @dkurt i am creating 4-dimensional blob from image cv::dnn::blobFromImage() function but it is giving rows = -1, cols = -1 and data = " ". i am using simple code as shown below.

Mat inImage = imread("A_1.ppm, imread("A_1.ppm", 1);
Mat rgbImage;
cvtColor(inImage, rgbImage, COLOR_BGRA2RGB );
Mat 4DImage = dnn::blobFromImage (rgbImage, 1.0, Size(rgbImage.rows, rgbImage.cols), Scalar(0, 0, 0), false, false);

return 0;