comparison scripts/image/ind2gray.m @ 917:b843a65fa977

[project @ 1994-11-11 02:00:28 by jwe]
author jwe
date Fri, 11 Nov 1994 02:06:42 +0000
parents 3470f1e25a79
children 56520a75b5b3
comparison
equal deleted inserted replaced
916:2f35156aa18b 917:b843a65fa977
17 17
18 # Convert colormap to intensity values. 18 # Convert colormap to intensity values.
19 yiq = rgb2ntsc(map); 19 yiq = rgb2ntsc(map);
20 y = yiq(:,1); 20 y = yiq(:,1);
21 21
22 # We need Fortran indexing capability, but be sure to save the user's 22 # We need Fortran indexing capability, but be sure to save the user's
23 # preference. 23 # preference.
24
24 pref = do_fortran_indexing; 25 pref = do_fortran_indexing;
25 do_fortran_indexing = "true";
26 26
27 # Replace indices in the input matrix with indexed values in the output 27 unwind_protect
28 # matrix.
29 [rows, cols] = size(X);
30 Y = y(X(:));
31 Y = reshape(Y,rows,cols);
32 28
33 # Restore the user's preference. 29 do_fortran_indexing = "true";
34 do_fortran_indexing = pref; 30
31 # Replace indices in the input matrix with indexed values in the output
32 # matrix.
33
34 [rows, cols] = size(X);
35 Y = y(X(:));
36 Y = reshape(Y,rows,cols);
37
38 unwind_protect_cleanup
39 do_fortran_indexing = pref;
40 end_unwind_protect
35 41
36 endfunction 42 endfunction