Tough one and I'm on the road for the next few days so won't have access to my compliers. Will have access to my email though so keep the solutions coming. I need the following to be very fast and very stable. All points go to whoever gives me a working routine. Because I need this quickly and of a high quality I am offering 750 points. OK, here we go:
I have an acoustic model from a 3rd Party that produces as output a file containing values. The values are then sent to a contouring routine to plot them on screen. I have the model working and the contouring working. However, the output from the model is a bit 'peeky'.
What I want is a routine that can 'smooth' or 'blur' a 2D array of values using a 3x3 matrix. This is very similar to blur/smooth 3x3 filters such as used in Paintshop Pro but to be used on a set of values rather than a bitmap. Still, very similar. (Image|User Defined Filters in Painthsop Pro).
OK, I want a routine that I can pass two arrays and two integers to:
The first array containing the values. This array will contain 601 x 601 values, but may be variable. I.e. the routine has to accept an array that has been sized dynamically in the main program. However, it will always be square i.e. 100x100 or 900x900. We will call this array ArrayPoints, and will be of type double
The second array will contain the matrix values and will always be 3x3. We will call this array ArrayMatrix and will be of type integer.
The first integer is the Division factor. We will call this MatrixDivision.
The second integer is the Bias factor. We will call this MatrixBias.
The routine will use the 3x3 ArrayMatrix and the two integer values passed in to 'scan' over the values in ArrayPoints, applying the filter in the same way as Paintshop Pro. The values in the 3x3 array will of course be set before calling the routine.
Online at http://www.netcomuk.co.uk/~iwatkins/test.zip
contains three files:
1. BEFORE.TXT - A file containing 601 x 601 values
2. BEFORE.JPG - A bitmap representation of the values in the file above before adjustment
3. AFTER.JPG - A bitmap representation of the values in the file above after filtering
Obviously, file 3 is just made up to give you some idea what I am after.