
These were very big releases for both products. MATLAB 5 and Image Processing Toolbox version 2.0 shipped in early 1998. Anyway, you can see that a LEVEL of 0.5 is used if you don't specify it yourself. This indicates that the developer intended to go back and do something else here before shipping but never did.

Here is relevant code fragment: if isempty(level), % Get level from userĮxperienced software developers will be amused by the code comment above, "Use default for now". Specifically, the LEVEL argument could be omitted. It turns out that im2bw had other syntaxes that did not appear in the documentation. Xlabel( 'Cameraman image courtesy of MIT') Here are two examples, an indexed image and a gray-scale image. RGB (or truecolor) images had to be represented with three different matrices, one for each color component. The second impact on functional design can be seen in the syntax IM2BW(R,G,B,LEVEL). This choice was influenced by the mathematical orientation of MATLAB as well as the fact that there was no one-byte-per-element data type. First, the toolbox established as the conventional dynamic range for gray-scale images. This affected the early functional design in two ways. Everything in MATLAB was a double-precision matrix. % less than LEVEL and 1 (white) for all other values.Īt that time, the prefix "im" in the function name meant that the function could take more than one image type (indexed, intensity, RGB).Īt this point in the early history of MATLAB, the language really only had one type. BW is 0 (black) for all pixels with luminance

% BW = IM2BW(R,G,B,LEVEL) converts the RGB image to black

% value less than LEVEL and 1 (white) for all other values. % BW = IM2BW(I,LEVEL) converts the gray level intensity image % than LEVEL and 1 (white) for all other values. % BW is 0 (black) for all pixels with luminance less % colormap MAP to a black and white intensity image BW. % BW = IM2BW(X,MAP,LEVEL) converts the indexed image X with Here is the help text from that early function: %IM2BW Convert image to black and white by thresholding. That was about the time I interviewed for my job at MathWorks. The function im2bw appeared in Image Processing Toolbox version 1.0, which shipped in early fall 1993. Today I'll start by talking about im2bw and graythresh, two functions that have been in the product for a long time.

As I promised last time, I'm writing a series about functional designs for image binarization in the Image Processing Toolbox.
