Change blobFromImage dimensions order
Hello everyone,
I faced a problem with C++ blobFromImage function. I trained a CNN-network in Keras which takes a 4-d blob as input (common practice, nothing special). The problem is that my blob order is NHWC (where Channle size is always 6) but blobFromImage returns only NCHW. There is no any trouble to reshape numpy-blob in python but I haven't found any solution for C++.
Is there any way to create blob of NHWC in C++ or reshape blobFromImage result to NHWC?
EDIT:
After spending whole day solving the problem I finally got correct result. It turned out that my input images were CV_8U but my blob held CV_32F, so I simply converted inputs to CV_32F and it worked! Thanks @berak for help.
what does the input data for this look like ? how do you acquire it ?
Input data is two 3-channel images stitched together (at channel axis) in one blob. For example, if images resolution is 1280x720 than blob shape will be (1, 720, 1280, 6)