Let's use the logical operations to do some fund stuff.
Before we move on, try to understand why RGB images has 3 colors.
Look at the following figure, other colors can be created by the combination of the R, G, and B components.
the following image processing tasks, you will have to separate the RGB
images into 3 slices, and then process one by one, then combine them.
Just following the tutorial, you will get it.
1. Download the
foreground figure here.
Have your script
file in the same directory, then use the following script to show the
generated 's' in your workspace, do you understand the three numbers in
mean the size of the image is 480 pixels x 852 pixels by 3 layers. Why
3 layers? The image has Red, Green, and Blue, 3 layers. It is a RGB
Now, let's pick
up a background image for this foreground. Download the background here:
Now you should
see two images:
extract the person from the left figure, merge the extracted image to
the one on the right.
the code better, you probably need to go back to last lecture's
You should see a
2. Download the
figure from here:
following code to plot the intensity profile of the figure:
should see the following plot. Note that the thin white line drawn in
the middle of the figure, and the profile of the intensity was drawn
along the line.
note that, plot([1,318], [80,80],'w') in the script is an independent
plot function. The range in the first bracket is the X range of the
plot, the range in the second bracket is the Y range of the plot.
Again, it is an independent plot, don't think deep on this.
Repeat the first
example shown in the tutorial.
second example shown in the tutorial.
‘laser.png’ and its
profile in one figure set (two
sub-figures). The profile line is a at column 600, and all the rows.
R, G, and B profiles at that line in the same sub-figure. Email me your
with the plotting on it.
example from the class: (note that you are plotting a
column profile but not a row profile like I did in this example)