Mitsuba Learning in C++ #528
-
I am trying to implement a mitsuba 3 learning cycle in C++, where I learn scene properties from actual photographs (rather than renderings). I can successfully render my initial guess, and I can load my photographs into Mitsuba Bitmaps via mitsuba::refmitsuba::Bitmap photo = new mitsuba::Bitmap("filename.png") however, I try unsuccessfully to populate a suitable DrJIT Tensor with the bitmap data. Essentially, I am asking for the translation of the python function Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @lfbuchmann Here you go: ref<Bitmap> bmp = (...);
size_t tensor_shape[3] = { bmp->height(), bmp->width(), bmp->channel_count() };
TensorXf tensor(bmp->data(), 3, tensor_shape); A word of caution though, a lot of the convenience functions for automatic differentiation in Dr.Jit have only been written in Python. Writing an entire optimization in C++ will require quite a bit of work. |
Beta Was this translation helpful? Give feedback.
Hi @lfbuchmann
Here you go:
A word of caution though, a lot of the convenience functions for automatic differentiation in Dr.Jit have only been written in Python. Writing an entire optimization in C++ will require quite a bit of work.