SUNY Geneseo Department of Mathematics
Friday, April 21
Math 230 02
Spring 2017
Prof. Doug Baldwin
SOFIs have started, you can fill them out through Knightweb.
Please do fill one out for this course, I do read them and they are helpful to me in improving future offerings.
Note: if you take your own subject and/or background pictures, subject and background have to have the same dimensions. You can crop or scale photos in, e.g., ImageJ; see me if you want help.
Also note: The One Button Studio is reserved for us, so you can take pictures there if you want. Either video from which you extract a frame (I’ll help if you can’t figure out how to do this from Matlab documentation) or take still photos while the studio is recording video and ignore the video.
If you want to get a sense for the range of color values in a screen, you can use various image processing programs to sample the colors, or you can use Matlab to pick appropriate parts out of the image as an array. For example
>> me = imread( 'Baldwin.jpg' );
>> imshow( me )
>> me( 1:5, 1:5,: )
ans(:,:,1) =
206 199 133 61 32
208 201 132 51 28
204 200 132 54 29
206 199 132 50 31
208 199 131 47 31
ans(:,:,2) =
210 215 173 121 109
210 217 172 111 107
208 215 173 113 107
209 214 172 111 109
213 215 174 109 112
ans(:,:,3) =
193 204 173 131 127
196 207 172 122 124
194 208 177 127 127
198 209 180 129 129
206 214 180 124 131
Matlab has min
and max
functions that you can use to quickly
get the range of values in a region of an image. But notice that these functions find the
minimum or maximum down the columns when applied to matrices, so use them twice to get the
minimum or maximum over a whole matrix:
>> sample = me( 1:5, 1:5,: );
>> min( sample(:,:,1) )
ans =
204 199 131 47 28
>> min( min( sample(:,:,1) ) )
ans =
28
Strings.
Read textbook sections 7.1 and 7.2.