1 | initial version |
It looks like a typo, you are not passing out
by reference (or pointer), therefore everything is working as expected inside gpuResize()
but Mat out;
in main does not occupy the same memory location as Mat out
in static void gpuResize(Mat in, Mat out)
. You can check this is the problem by moving cout << "real size="<<out.size() <<endl;
inside gpuResize()
.
For simplicity I would pass by reference, that is change
static void gpuResize(Mat in, Mat out)
to
static void gpuResize(Mat in, Mat &out)
2 | No.2 Revision |
It looks like a typo, you are not passing out
by reference (or pointer), therefore everything is working as expected inside gpuResize()
but Mat out;
in main does not occupy the same memory location as Mat out
in static void gpuResize(Mat in, Mat out)
. You can check this is the problem by moving cout << "real size="<<out.size() <<endl;
inside gpuResize()
.
For simplicity I would pass by reference, that is change
static void gpuResize(Mat in, Mat out)
to
static void gpuResize(Mat in, Mat &out)