Parameter training of hidden Markov model in wavelet domain using EM algorithm

1. Problem description:

 Parameter training of hidden Markov model in wavelet domain using EM algorithm

2. Part of the program:

 

clear;
close all;
clc;
%==================Open the picture (underwater color picture) ==============
[ imname, pathname]=uigetfile({'*.jpg';...
    '*.bmp';...
    '*.gif';...
    '*.png';...
    '*.tif'} ,...
    'Open the files of images');
%================================== ==================
%==================Classic operator=========================================================================================================================================================================================================== ===================
I=imread(imname);
I1=im2double(I);% Turn the color
picture sequence into double precision I2=rgb2gray(I1);% Turn the color image into a gray image
[thr, sorh, keepapp]=ddencmp('den','wv',I2);% ddencmp gets the default threshold (soft or hard) entropy standard  
I3=wdencmp('gbl',I2 ,'sym4',2,thr,sorh,keepapp);% wavelet denoising
I4=medfilt2(I3,[9 9]);% median filter
I5=imresize(I4,0.8,'bicubic');% image size

                

BW1=edge(I5,'sobel'); %sobel image edge extraction
BW2=edge(I5,'roberts'); %roberts image edge extraction
BW3=edge(I5,'prewitt'); %prewitt image edge extraction
BW4= edge(I5,'log'); %log image edge extraction
BW5=edge(I5,'canny'); %canny image edge extraction
figure;
subplot(1,2,1); %The image is divided into three images in one line, The first picture
imshow(I);% plot
title('original image');% annotation
subplot(1,2,2);
imshow(I5);
title('median filtered image');% third picture
%================= Classic operator detection display=========================
figure;
subplot(2,3,1);
imshow(BW1);
title('Sobel operator');
subplot(2,3,2);
imshow(BW2);
title('Roberts operator');
subplot(2, 3,3);
imshow(BW3);
title('Prewitt operator');
subplot(2,3,4);
imshow(BW4);
title('log operator');
subplot(2,3,5);
imshow(BW5);
title('Canny operator');
%============ =============================================
%==== ================ Wavelet Edge Detection==========================
%@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@
%The wavelet function used
%wname='bior4.4';
I5=double(I5);
%================ Wavelet decomposition of the image ==== ================
[c,s]=wavedec2(I5,3,'bior4.4');
%============= ========== Refactoring=========================
a0=wrcoef2('a',c,s, 'bior4.4',0);
a1=wrcoef2('a',c,s,'bior4.4',1);
a2=wrcoef2('a',c,s,'bior4.4',2) ;
a3=wrcoef2('a',c,s,'bior4.4',3);

3. Simulation conclusion:

D-14

Guess you like

Origin blog.csdn.net/ccsss22/article/details/115019712