Assignment A5: Morphological Operations CS 4640

$35.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (5 votes)

For this problem, handin Matlab .m files for the functions described by the headers below
(also see p. 733 of the text). Note that one of these is a driver which creates inputs for each
function and runs the function on those inputs to obtain the output.
You are also to handin a pdf file (called A4.pdf) reporting on the analysis of the image
00.tif. Extract the part of the image with text, and provide an RMS error comparison as
well as an image difference image of:
1. CS4640 MM boundary vs. bwmorph’s boundary operator
2. CS4640 MM cc vs. bwlabel
3. CS4640 MM convhull vs. bwconvhull
4. CS4640 MM skeleton vs. bwmorph’s skeleton operator
Some notes:
• Indent headers correctly (5 spaces indented lines)
• Do not exceed 72 characters per source line
• CS4640 A5 driver: should show that each function works
None of the functions should write to the interpreter, draw, etc.
1
function Bt = CS4640_MM_translate(B,r0,c0,r,c)
% CS4640_MM_translate – translates the origin of B to point z
% On input:
% B (MxN array): binary image with 1 connected component (labeled
% 1)
% whose origin is at (r0,c0) in the image
% ro (int): row origin value
% c0 (int): col origin value
% r (int): destination row (for origin)
% c (int): destination col (for origin)
% On output:
% Bt (MxN array): binary image with B translated to (r,c)
% Call:
% B22 = CS4640_MM_translate(B,23,54,34,35);
% Author:
%
% UU
% Spring 2018
%
function Br = CS4640_MM_reflect(B,r0,c0)
% CS4640_MM_reflect – reflects B about its origin
% On input:
% B (MxN array): binary image with 1 connected component (labeled
% 1)
% whose origin is at (r0,c0) in the image
% ro (int): row origin value
% c0 (int): col origin value
% On output:
% Br (MxN array): binary image with B reflected about (r0,c0)
% Call:
% Br = CS4640_MM_reflect(B,23,54);
% Author:
%
% UU
% Spring 2018
%
function Ac = CS4640_MM_complement(A)
2
% CS4640_MM_complement – complement of A
% On input:
% A (MxN array): binary image with 1 connected component (labeled
% 1)
% On output:
% Ac (MxN array): binary image with complement of A
% Call:
% Ac = CS4640_MM_complement(A);
% Author:
%
% UU
% Spring 2018
%
function AmB = CS4640_MM_diff(A,B)
% CS4640_MM_diff – difference of A and B
% On input:
% A (MxN array): binary image with 1 connected component (labeled
% 1)
% B (MxN array): binary image with 1 connected component (labeled
% 1)
% On output:
% AmB (MxN array): binary image with difference of A and B
% Call:
% AmB = CS4640_MM_diff(A,B);
% Author:
%
% UU
% Spring 2018
%
function Ab = CS4640_MM_boundary(A)
% CS4640_MM_boundary – boundary of A
% On input:
% A (MxN array): binary image with 1 connected component (labeled
% 1)
% On output:
% Ab (MxN array): binary image with boundary of A
% Call:
3
% Ab = CS4640_MM_boundary(A);
% Author:
%
% UU
% Spring 2018
%
function Acc = CS4640_MM_cc(im)
% CS4640_MM_cc – connected components of im
% On input:
% im (MxN array): binary image
% On output:
% Acc (MxN array): binary image with n connected components of im
% (labeled 1 to n)
% Call:
% Ab = CS4640_MM_cc(im);
% Author:
%
% UU
% Spring 2018
%
function Ach = CS4640_MM_convhull(A)
% CS4640_MM_convhull – convex hull of component in A
% On input:
% A (MxN array): binary image with 1 component (labeled 1)
% On output:
% Ach (MxN array): binary image with convex hull of component A
% Call:
% Ach = CS4640_MM_convhull(A);
% Author:
%
% UU
% Spring 2018
%
function As = CS4640_MM_skeleton(A)
% CS4640_MM_skeleton – skeleton of component A
4
% On input:
% A (MxN array): binary image with 1 component (labeled 1)
% On output:
% As (MxN array): binary image with skeleton of component A
% Call:
% As = CS4640_MM_skeleton(A);
% Author:
%
% UU
% Spring 2018
%
5_driver
% CS4640_A5_driver – driver for A5 functions
% On input:
% N/A
% On output:
% N/A
% Call:
% CS4640_A5_driver
% Author:
%
% UU
% Spring 2018
%
5