Mat of int64
Hellow everybody. I have an array of tensorflow::int64 numbers like this :
tensorflow::int64 data[10] = {1,2,3,4,5,7,8,9,10,11}
now i want to initialize a Mat with this array , but opencv doesn't support CV_64SC1 or int64 datatype. can anybody help me how can create a Mat of int64 datatype and initialize it with this array ? Thank you in advance.
At present there is no
CV_64S
support, so your best option is to convert/cast toCV_32S
for down stream processing.@Der Luftmensch thanks for your answer and sorry for delay in my answer. Casting in tensorflow takes a while and i can't precess my video in relatime. I'm wondering to create a Mat of int64 type . Do you have any idea about that ?
As I said above, there is no int64 support in
cv::Mat
. Have you measured the performance costs of casting to int32? It might be significantly smaller than you think, modern compilers are great at vectorizing.Yes i tested casting in tensorflow c++ api and it reduces process speed significantly. My original array is a pointer of a tensor values , so tried casting with reinterpret_cast as an other solution , but it didn't give me a correct answer. I can bring you my code if you want.
@Der Luftmensch Yes , this is actually what is needed , i got the correct answer, Thank you so much sir.