Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

this looks murky, you're copying a CV_8U image to a CV_32F one:

img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

i guess, you have to convert the input manually to float, before copying it:

img1 convertTo(img1, CV_32F);
img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

or, even shorter:

img1 convertTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))), CV_32F);

this looks murky, you're copying a CV_8U image to a CV_32F one:

img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

i guess, you have to convert the input manually to float, before copying it:

img1 convertTo(img1, CV_32F);
img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

or, even shorter:

img1 convertTo(Mat(img1.rows, img1.convertTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))), CV_32F);

this looks murky, you're copying a CV_8U image to a CV_32F one:

img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

i guess, you have to convert the input manually to float, before copying it:

img1 convertTo(img1, img1.convertTo(img1, CV_32F);
img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

or, even shorter:

img1.convertTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))), CV_32F);

this looks murky, you're copying a CV_8U image to a CV_32F one:

img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

i guess, you have to convert the input manually to float, before copying it:

img1.convertTo(img1, CV_32F);
CV_32F); // does it need scaling ? idk.
img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

or, even shorter:

img1.convertTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))), CV_32F);

this looks murky, you're copying a CV_8U image to a CV_32F one:

img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

i guess, you have to convert the input manually to float, before copying it:

img1.convertTo(img1, CV_32F); // does it need scaling ? idk.
img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

or, even shorter:

img1.convertTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))), CV_32F);

you're copying a CV_8U image to a CV_32F one:

img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

i guess, you have to convert the input manually to float, before copying it:

img1.convertTo(img1, CV_32F); // does it need scaling ? idk.
img1.copyTo(Mat(img.rows, img.cols, img1.copyTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))));

or, even shorter:

img1.convertTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))), CV_32F);

you're copying a CV_8U image to a CV_32F one:

img1.copyTo(Mat(img.rows, img.cols, CV_32F, blob.ptr((0, 0))));

i guess, you have to convert the input manually to float, before copying it:

img1.convertTo(img1, CV_32F); // does it need scaling ? idk.
img1.copyTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))));
blob.ptr(0, 0)));

or, even shorter:

img1.convertTo(Mat(img1.rows, img1.cols, CV_32F, blob.ptr((0, 0))), blob.ptr(0, 0)), CV_32F);