資源簡介
USM_Sharpen基于matlab的銳化程序,matlab程序中將矩陣左移10位擴(kuò)展適用于fpga使用,下載后只需要修改圖片路徑即可直接驗(yàn)證使用。銳化效果還很不錯。
代碼片段和文件信息
clc
clear
img=imread(‘D:\Prj\Ext_Prj\PC\image\5.jpg‘);??%對圖像進(jìn)行銳化
figure;?imshow(img);
%???分別讀取RGB
image_r=img(::1);
image_g=img(::2);
image_b=img(::3);
%??測試RGB輸出
%?figure;
%?subplot(221)imshow(image_r)title(‘Red?component‘);??
%?subplot(222)imshow(image_g)title(‘green?component‘);??
%?subplot(223)imshow(image_b)title(‘blue?component‘);??
%?subplot(224)imshow(img)title(‘original?image‘);?
[mn]=size(img);
img_r=double(image_r);img_g=double(image_g);img_b=double(image_b);
sigma=0.5;lamda=20;
gausFilter=round(fspecial(‘gaussian‘[33]sigma)*1024);
Mod_r=round(imfilter(img_rgausFilter‘replicate‘)/1024);
Mod
評論
共有 條評論