use matlab Project 2: Connected components (4 connected and 8 connected) Instruc
ID: 3870136 • Letter: U
Question
use matlab
Explanation / Answer
answres instruction wise:
1) A = imread(filename, fmt ) reads a greyscale or color image from the file specified by the string filename , where the string fmt specifies the format of the file. If the file is not in the current directory or in a directory in the MATLAB path, specify the full pathname of the location on your system.
example. A=imread(holo.jpg)
2) gray = rgb2gray ( rgb ) Convert RGB image or colormap to grayscale. In this case gray=rgb2gray(A).
3) BW = im2bw(I, level) converts the grayscale image I to a binary image. ... Therefore, a level value of 0.5 is midway between black and white, regardless of class. To compute the level argument, you can use the function graythresh . If you do not specify level , im2bw uses the value 0.5. In this case BW=im2bw(gray,0.5).
4) Reading the image size: [x1,y1,z1] = size(A);
5)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.