blurring a float matrix?
okay, so I may be losing my marbles completely here, but... how on earth do you blur a float32 matrix?
jit.fastblur is char only, and the closest thing I've found is jit.avg4, which isn't really it either.
My matrix is "mymatrixname 3 float32 100 100", so it's rather small, and I can afford to throw some processing at it, but I *cant* do shaders, since I need this in matrix-land still.
any pointers? I reckon there might be a simple jit.pix hack I could do? I don't mind quirky blurs, either.
One way is simply to downsample and then re-upsample with interpolation, but the more sophisticated way is convolution with jit.convolve, I think.
thanks. I love how jit.convolve's help file AND reference assume that the jitter users know what convolving two matrices with each other entails. ;)
I'll be using this, but damn, it ain't pretty.
jit.gl.slab.gauss6x works pretty well also with float32 matrices, and it's great! :)
i would use jit.gl.slab.gauss6x, and then go back from openGL to CPU...
slab processing for a small matrix which is just a tiny bit of a larger whole? Am I completely nuts for thinking that that is too convoluted? (pardon the pun)
well it depends what kind of blurring you're after
well, I reckon what I'd really like is something like jit.gl.slab.gauss6x, but in matrix-land.
Do any of you have this wrapped up in an abstraction that handles the back-and-forth from- and to- matrices internally?
it's not an abstraction but i hope it will help you anyway...
PS: the rendering context is made with jit.window, which is a bit annoying - there is a "useless" window floating. for some unknown reasons, my Max crashes if i make the rendering context with jit.matrix...? anyway, all you have to do is to adjust the dimensions...
?
@napentro: Thanks, that is even sexyer solution! I removed also the videoplane and changed the "jit.pwindow @name maax" with "jit.matrix maax", to remove the unnecessary processing.
PS: Creating rendering context with jit.matrix seems to work for smaller matrices. I remember I had problems with larger ones...my Max always crashed. And even few moments ago that happened with 320x240 matrix. I don't know what is the reason for that dodgy behavior...
I played a little bit more with the patch and it seems that if creating rendering context with matrix, patch works slow and dodgy. Can anyone explain that?
i think, that videoplane is nessesary. there is jitter tutorial 31RenderDestinations, that allows you to change the destination of opengl objects, but in my case when trying render to matrix pops up "jit.gl: invalid extension called" - maybe it is some kind of bug.
anyway i think, that videoplane is nessesary to send the context of renderer anywhere.
it is a modyfied version of the tutorial with "jit.gl: invalid extension called" error:
if it would work the patch with rendering gl.slab to matrix should looks like that:
or maybe i'am missing something @:)
after all sorry for my english :)
i don't get any errors in your first patch. also the last patch i posted (without videoplane) works. but as i said, it is dodgy. now, for instance, when i tested it again, it first didn't work, then my Max crashed, but after i restarted it, it started to work.
i would expect that when i make the rendering context with matrix instead of window or pwindow, that the patch would run faster, since there is nothing (necessary) to display. but as i said, things start to crash, behave dodgy, works slow...???