Closed daslu closed 4 months ago
I think this is quite cool - definitely similar things strewn about that could use this.
After thinking a bit more today nice documentation (and possibly a nice default value?) for the type parameter might be nice.
@cnuernber - in case you missed this. (:
I think this is great - I think it should go into the libs/buffered-image namespace as that has all the constants involved. There could be default constants for 1 channel, 3 channel, and 4 channel tensors respectively.
Related to this is colorizing tensors.
link to Zulip topic
Often, when working with images, I find it useful to convert them to dtype-next tensors using
tech.v3.libs.buffered-image/as-ubyte-tensor
, then process them as tensors, then convert them back to images.To convert back tensors to images, some helper function is usually handy, something like the following (thanks to @harold's adaptation).
An image processing example using tensors:
Would it make sense to add such a
tensor->image
function to dtype-next?(I added it to another library (the WIP Noj library), but then realized it should probably belong to dtype-next.)