comparison scripts/image/hsv2rgb.m @ 10433:2c01d24459fb

Detabify scripts in 'scripts/image/'
author Soren Hauberg <hauberg@gmail.com>
date Mon, 22 Mar 2010 12:36:30 -0700
parents eb63fbe60fab
children 3140cb7a05a1
comparison
equal deleted inserted replaced
10432:10207338603a 10433:2c01d24459fb
75 ## factor s*v -> f 75 ## factor s*v -> f
76 f = kron ([1, 1, 1], hsv_map(:,2)) .* kron ([1, 1, 1], hsv_map(:,3)); 76 f = kron ([1, 1, 1], hsv_map(:,2)) .* kron ([1, 1, 1], hsv_map(:,3));
77 77
78 ## add s*v* hue-function to rgb map 78 ## add s*v* hue-function to rgb map
79 rgb_map = rgb_map + f .* (6 * (hue < 1/6) .* hue 79 rgb_map = rgb_map + f .* (6 * (hue < 1/6) .* hue
80 + (hue >= 1/6 & hue < 1/2) 80 + (hue >= 1/6 & hue < 1/2)
81 + (hue >= 1/2 & hue < 2/3) .* (4 - 6 * hue)); 81 + (hue >= 1/2 & hue < 2/3) .* (4 - 6 * hue));
82 82
83 ## If input was an image, convert it back into one. 83 ## If input was an image, convert it back into one.
84 if (is_image) 84 if (is_image)
85 rgb_map = reshape (rgb_map, Sz); 85 rgb_map = reshape (rgb_map, Sz);
86 endif 86 endif