Convolution

Official support for: photosounder.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi,

I've just recently downloaded the latest version of Photosounder, the new changes look great but so far whenever I click on Convolution the program just freezes and then crashes. Is it possibly a Windows 7 issue? This is a new computer Im using.

Thanks

-Dave

Post

daeva0123 wrote:Hi,

I've just recently downloaded the latest version of Photosounder, the new changes look great but so far whenever I click on Convolution the program just freezes and then crashes. Is it possibly a Windows 7 issue? This is a new computer Im using.

Thanks

-Dave
It's not really a bug, it's sort of working the way it's supposed to be. Or rather, it's letting you do things you shouldn't do.

The thing to understand about convolution is that each non-zero pixel initiates a copy (weighted in intensity and with an offset in space) of the sum of the previous layers. That's why you must always make sure your convolution layers don't have too many non-black (or non-zero, or non-blank, or non-set if you prefer) pixels, because the more there are, the longer the processing takes. If you have a hundred pixels or so, it won't take too long to process (although you'll probably be able to see that it makes the processing slower already).

What it means if you open a sound and directly set the only layer to Convolution is that, as the image in question might have around one million set pixels, it will attempt to make a million copies of what's under, which is actually blank. If about a hundred pixels take roughly a second to process, then a million might take roughly 3 hours to process, thus freezing the entire program the whole time.

I know it's undesirable (you don't want to mess up your entire work just because you set a layer to Convolution by mistake), so in the next release there will be a check against such mistakes. You'll be able to define the limit of allowed set pixels on a Convolution layer in the config file (but it'll be set by default to something sensible), and if the layer has too many set pixels you'll get a warning explaining why we can't convolve that and then default to the Addition mode.

Also just so you know it doesn't really make sense to set the first layer to anything but Addition (unless you want to hide it, in which case you might want to use other modes such as Multiplication) as there's nothing before the first layer to mix it with. That's on a layer above that you should set such blending modes, for example by having Layer 0 set to Addition with above it Layer 1 set to Convolution (it processes layers from the bottom up, or from the lower number up if you prefer).
Developer of Photosounder (a spectral editor/synth), SplineEQ and Spiral

Post

Thanks for the help A_SN, I'll try experimenting with it a bit more.

Cheers

-Dave

Post

Hi,

I am a new user of Photosounder and I have not explored many of the advanced features yet (convolution being one of them).
In fact, I have not yet worked out how to work with layers properly (see my separate post).

The only point I would make is that if convolution is an operation that takes so long a warning window would be appropriate, as suggested. Also, If I pressed "OK to proceed" I would like that window to turn to a "cancel button" once the process is running, allowing me to abort the process if I changed my mind.

I think that should be preferred to actually crippling the program to not be able to convolute images containing more than a certain number of non-zero points.
If I have a fast computer (or lots of time on my hands!) and decide to convolve a complex image that should be allowed.

Post

AlienXXX wrote:Hi,

I am a new user of Photosounder and I have not explored many of the advanced features yet (convolution being one of them).
In fact, I have not yet worked out how to work with layers properly (see my separate post).

The only point I would make is that if convolution is an operation that takes so long a warning window would be appropriate, as suggested. Also, If I pressed "OK to proceed" I would like that window to turn to a "cancel button" once the process is running, allowing me to abort the process if I changed my mind.

I think that should be preferred to actually crippling the program to not be able to convolute images containing more than a certain number of non-zero points.
If I have a fast computer (or lots of time on my hands!) and decide to convolve a complex image that should be allowed.
I know it's a problem, however for the next release I'm planning something better than a warning window or a way to cancel or a limit (which was my previous plan). Basically, there are two ways to convolve. Right now I'm using the slow way because I use a trick (only processing the non-zero pixels) that in most cases makes it much faster than the generally fast one. But when there's a lot of set pixels then it quickly gets astronomically slow. So what it'll do in the next version is check how many set pixels there are, if there are few enough it'll stick to the current method, if there are too many it will use the fast convolution method (it involves 2D FFTs on the two concerned layers, then a sort of multiplication between them, so their cost in time is constant).

This way it will never take too long, there will be a pretty low upper-limit on how slow convolution can get (probably never more than a few seconds in most cases).
Developer of Photosounder (a spectral editor/synth), SplineEQ and Spiral

Post Reply

Return to “Photosounder”