John Dolese

125 Reputation

3 Badges

6 years, 171 days

MaplePrimes Activity


These are questions asked by John Dolese

It took me a while to figure out what was causing this unusual sort result;

I loaded the MTM package because I want to convert numbers to integers for indexing. This sort result seem like it could be a bug.

Sort a List of Floats

NULL

with(MTM):

NULL

x := [1/3, 0, 4] = [1/3, 0, 4]``

``

sort(x) = [0, 1/3, 4]``

NULL

f_x_MTM := [seq(convert([x[n], n], float), n = 1 .. 3)] = [[.3333333333, 1.], [0., 2.], [4., 3.]]NULL

sort(f_x_MTM) = [[.3333333333, 1.], [0., 2.], [4., 3.]]NULL

NULL

unwith(MTM):

f_x := [seq(convert([x[n], n], float), n = 1 .. 3)] = [[.3333333333, 1.], [0., 2.], [4., 3.]]

NULL

sort(f_x) = [[0., 2.], [.3333333333, 1.], [4., 3.]]

``

 

Download MTMsort.mw

When assigning a color to a given wave length I initially used ColorTools WavelengthToColor. Acer commented that this wasn't the most accurate. I looked into this a little further and it seems there could be a better result. The attached document compares some different ways of assigning colors to wave lengths. 

Warning- The CIEDE2000 computation for deltaE is very slow. I think this is because of the hue angle calculations which use piecewise a lot. The CIE94 delta E method produces nearly the same result and takes minutes instead of hours.

 

Questions;

 I think I could speed up my calculation if I could find the position of the minimum element of an Array similar to FindMinimalElement of a list. 

I created my own atan2 function (similar to Excel). If there were a built in Maple equivalent perhaps it would be faster? I didn't see any such function.

6bit_Wavelength_Color_CIEDE2000.mw

I was hoping to browse color results using a slider and text box. I see the "use DocumentTools" command, but was not able to get "use ColorTools" to allow execution of the "Color()" function. 

My slider "n" has the following code;

use DocumentTools in

Do(%outn=%n);
Do(%outrgb=my_rgb(%n));
use ColorTools in
Do(%outcolor=color_my_rgb(%n));
end use;
end use;

The black point correction for xyY to sRGB was incorrect in my original post. It should be done the same ways as for xyY to aRGB which was correct. Hope nobody was inconvenienced. 

 

I would be curious if others have found a more elegant way to index through an Array to perform an operation on a set of vectors. I had to use the single quote to get the operation performed first and the index increment second.

 

Corrections to the original version of theis document;
• Make the scaling for a nonzero black point the same for all RGB color spaces.
• Clip negative RGB values to zero.
• Remove the redundant Array container from matrix multiplications.
Use map in place of the $ to apply a function to each element of an Array.

Pixel_Conversion_B.mw

I found an error in a file I posted that I would like to correct. Can I modify the existing post? Delete it and make an new one?

Page 1 of 1