Information Technology Reference
In-Depth Information
4 The Design and Call of COM Modules
4.1 M-File Algorithm Programming
The algorithm function file is programmed in the MATLAB M-file editor with one
input parameter and saved as jc.m file.
function [a,b,c,d]=myfind(r)
I=imread(r);
I1=im2double(I);
I2=rgb2gray(I1);
[thr,sorh,keepapp]=ddencmp('den','wv',I2);
I3=wdencmp('gbl',I2,'sym4',2,thr,sorh,keepapp);
I4=medfilt2(I3,[9 9]);
I5=imresize(I4,0.2,'bicubic');
ss=edge(I5,'sobel');
figure;
subplot(1,3,1);
imshow(ss);
title('SobelËã×Ó');
[m,n]=find(ss==1);
a=m(1)
b=m(2)
c=m(3)
4.2 The Creation of COM Modules
COM Builder is a COM builder provided by MATLAB software which can transfer
M-file algorithms into independent COM modules [3]. Objects built can be used un-
der any developing environment which supports COM objects. A COM module could
involve many classes and each class can include many M files. Class files will be
after compiling of M files.
Fig. 2. Project naming dialog
Search WWH ::




Custom Search