Comments (4)
Hello @vucenovic,
I've transferred your issue to the Mitsuba 3 repo, hopefully this is correct. If not, I strongly encourage you to upgrade, as Mitsuba 3 has many improvements and bugfixes over Mitsuba 2.
Here's a good way to do it with the Python API:
>>> b
Bitmap[
pixel_format = rgba,
component_format = uint8,
size = [500, 656],
srgb_gamma = 1,
struct = Struct<4>[
uint8 R; // @0, normalized, gamma
uint8 G; // @1, normalized, gamma
uint8 B; // @2, normalized, gamma
uint8 A; // @3, normalized, alpha
],
data = [ 1.25 MiB of image data ]
]
>>> mi.TensorXf(b)
TensorXf(shape=(656, 500, 4))
>>> mi.TensorXf(b).array
[0.0, 0.0, 0.0, 0.0, 0.0, .. 1311990 skipped .., 0.0, 0.0, 0.0, 0.0, 0.0]
>>>
On the last line, you can see that the tensor is just a wrapper around a Float
object. We recommend keeping the TensorXf
though, since it maintains the shape of the data as well.
from mitsuba2.
Thanks for the quick response! Sadly I am not able to upgrade for the time being, would this also work on Mitsuba2? And could you maybe add the required imports to the solution (what is 'mi')?
from mitsuba2.
Here would be an option for Mitsuba 2:
>>> import numpy as np
>>> import mitsuba
>>> mitsuba.set_variant('cuda_ad_rgb')
>>> b = mitsuba.core.Bitmap('path/to/image.exr')
>>> mitsuba.core.Float(np.array(b).ravel())
KeyboardInterrupt
>>> mitsuba.core.Float(np.array(b).ravel())
[0.0, 0.0, 0.0, 0.0, 0.0, .. 1311990 skipped .., 0.0, 0.0, 0.0, 0.0, 0.0]
mi
is just the recommended alias we use in Mitsuba 3.
Unfortunately, we most likely won't have the bandwidth to provide support for Mitsuba 2. The migration shouldn't be too hard (majority of changes are components having moved around and some renames), and would be well worth it.
from mitsuba2.
Thank you! I will look into Mitsuba3 and the migration process soon :)
Kind regards
from mitsuba2.
Related Issues (20)
- [🔨 compilation issue] 'cmake -GNinja' step HOT 3
- [❔ other question]runtime API error = 0719 HOT 1
- [🐛 bug report] importing Pytorch after mitsuba => Segmentation fault (core dumped) HOT 1
- [❔ other question] Performance on Windows much lower than Linux? HOT 5
- [🐛 bug report] hdrfilm.cpp: duplicate channel detection HOT 3
- [❔ other question] how to uninstall mitsuba2 in linux? HOT 4
- The examples of Differentiable rendering applications HOT 2
- [🐛 bug report] OptiX "arithmetic involving uninitialized variable!" with Certain Scenes HOT 1
- [✨ feature request] Tutorial on differential rendering material acquisition HOT 1
- Something about code HOT 1
- Caught a critical exception: main [properties.cpp:401] └1∩Æ∞☺
- [✨ feature request] Does the mitsuba2 support bsdf for cloth model? HOT 1
- 用java或C++用物件導向的概念設計程式解下面的問題:讀取一組時間,計算出時針與分針的夾角,時間的格式是0:00到12:00,小時數可能為1或2位數,分鐘數總是2位數,00到59之間。輸出腳讀為0到180之間的值,角度的精確度到千分之一。例如9:00是90.000度,不是-90,也不是270,2:00則是60 HOT 1
- Rendered polarized images' intensity doesn't change according to the change of polarization angle- [❔ other question] HOT 1
- [❔ other question] setting the variant("llvm_spectral_polarized"), the code didn't work HOT 2
- [❔ other question]How can we output UV map in python? HOT 1
- - [❔ other question] I want to optimize the values in the transform component of my sensor plugin HOT 1
- Unable to compile: Windows 10: Visual Studio Community 2022 HOT 1
- White noise in spectral rendering - [❔ other question] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mitsuba2.