I am studying about C++ BoostPython, But I have one problem about transforming Image data type.
How can I do that? Please...
the follow code could work, i am not sure this is the best approach, but this is how i managed to get the the tensroflow working for me.
void* object = (void*)resized.ptr() ;
int64_t* dims; //set dims
//C API
TF_Tensor* tftensor = TF_NewTensor(TF_DataType::TF_FLOAT, dims, nDims, object, data_size, &deallocator, 0);
//C++ API
tensorflow::Tensor input_tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({ batch_size, objectHeight, objectWidth, objectChannels }));
int data_size = objectHeight * objectWidth * objectChannels * batch_size * sizeof(float);
std::copy_n((float*)object, data_size, (input_tensor.flat<float>()).data());