![]() That is, a LEVEL of 0.5 has the same visual effect for a double input image as it does for a uint8 input image. Should the interpretation of LEVEL be different, depending on the data type of the input image? To increase the chance that existing user code would work as expected without change, even if the image data type changed from double to uint8, we adopted the convention that LEVEL would continue to be specified in the range, independent of the input image data type. One of the design questions that arose during this transition concerned the LEVEL argument for im2bw. We wanted to be able to handle uint8 and multidimensional arrays smoothly, to the degree possible, with existing user code. Multidimensional array and uint8 support affected almost every function in the toolbox, so version 2.0 was a complex release, especially with respect to compatibility. The other types went undocumented and largely unsupported in both MATLAB and the toolbox for a while longer. Image Processing Toolbox 2.0 provided support for (and documented) uint8 arrays. The capability was so limited that we didn't even mention it in the MATLAB 5 documentation. However, there was almost no functional support or operator support these arrays. At the time, you could make uint8, int8, uint16, int16, uint32, int32, and single arrays. MATLAB 5 also had something else that was big for image processing: numeric arrays that weren't double precision. MATLAB 5 featured multidimensional arrays, cell arrays, structs, and many other features. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |