Computer Applications Reviewer
Computer Applications Reviewer
Naming Variables:
action 3
end
if condition
action
end
action 1 Subfunctions
Nested if-else statements -used to choose from Image Processing Toolbox convention is to
more than two options display 0 as black and 1 as white.
if condition1
action 1
elseif condition2
imread(‘filename’)
action2
>> f = imread(‘baga.jpg’) binary images- black and white
indexed images- grayscale
>>imshow(f) %shows the image
RGB images- 3 matrices that overlaps
>>imshow(f, [low high])
Converting between image types
ex.1
>>imwrite(f, ‘filename’)
>>imwrite(f, ‘filename.jpg’,’quality’,q)
Data Classes
The length of the line ROI is the diameter of the
chip.
pos = d.Position;
diffPos = diff(pos);
diameter = hypot(diffPos(1),diffPos(2))
diameter = 45.3448
gray_image = rgb2gray(rgb);
imshow(gray_image)
imshow(gray_image)