📄 main.m
字号:
% % Test program for Quadtree Encoding and Decoding of RGB image
clc, close all, clear all
thvec=[0.5,0.5,0.5]; % threshold for red,green and blue (values b/w 0 and 1)
picname='rafting.png';
I = imread(picname);
[ir ic d]=size(I); % size of I must be M-by-N-by-3
figure, image(I) % original input image
title('\bfOriginal Image');
% % ----------------------------------
% % RGB Quadtree Encoding
[S,valRGB]=qt3ddecom(I,thvec); %lossy encoding
% % OR
% [S,valRGB]=qt3ddecom(I); %lossless encoding
% % ----------------------------------
% % RGB Quadtree Decoding
Iback=qtreergbdecode(S,valRGB); %Iback is approximated (reconstructed) image
IbackTrim=Iback(1:ir,1:ic,:); %trim to original image size
% % ----------------------------------
figure, image(IbackTrim); % decoded image
title('\bfQuadtree Decoded Image');
% % -------------------------------------------------------------------------
% % This program or any other program(s) supplied with it does not provide any
% % warranty direct or implied. This program is free to use/share for
% % non-commercial purpose only, for any other usage contact with author.
% % Kindly reference author.
% % Thanking you.
% % @ Copyright M Khan
% % Email: mak2000sw@yahoo.com
% % mak2000@GameBox.net
% % http://www.geocities.com/mak2000sw
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -