Professional Documents
Culture Documents
HashMaps
>> m = containers.Map('KeyType','int32','ValueType','double');
>> m(1) = 3.14;
2. Assignment
1. Write code to find the distance between two string patterns.
(Implement Levenshtein distance; the cheapest way to transform one
string to another)
2. Given an image, it is required to extract the pixels as 3D feature vectors
with features specified by the R, G, and B values.
You should then label each pixel with a class label based on the two
methods described below, such that each pixel belongs to one of 3
classes: Red, Green or Blue.
Plot the image again with each pixel having the R, G, and B values set to
(255, 0, 0), (0, 255, 0), and (0, 0,255) for the Red, Green and Blue
classes respectively.
Plot the histogram of the image using your own function.
Methods of classifying the pixels are as follows:
Method 1: The pixel belongs to the class of max color value. e.g.
pixel (123, 45, 221) belongs to class B, pixel (98, 21, 80)
belongs to class R