資源簡介
Matlab實現圖像風格化 倒影,浮雕,素描
代碼僅供參考、交流

代碼片段和文件信息
function?[IMG]?=?cameo(img)
????[height?width?channel]?=?size(img);
????gray?=?rgb2gray(img);
????IMG?=?uint8(zeros(height?width));
????for?i?=?1:height
????????for?j?=?1:width
????????????if?(i?<=?2?||?j?<=?2?||?i?+?2?>=?height?||?j?+?2?>=?width)
????????????????IMG(i?j)?=?128;
????????????else
????????????????IMG(i?j)?=?uint8(gray(i-2?j-2)?-?gray(i+2?j+2)?+?128);
????????????end
????????end
????end
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-08-28?05:44??code\
?????文件?????1273902??2019-04-05?14:52??code\building.PNG
?????文件?????????431??2019-04-05?17:33??code\cameo.m
?????文件?????????498??2019-04-05?17:23??code\reflect.m
?????文件?????????815??2019-04-05?19:41??code\sketch.m
?????文件?????????491??2019-04-05?16:51??code\stylize.m
?????文件??????389859??2018-09-21?14:44??code\yuanming.jpg
?????目錄???????????0??2019-08-28?05:44??demo\
?????文件?????1273902??2019-04-05?14:52??demo\building.PNG
?????文件?????1004410??2019-04-05?16:51??demo\cameo_img.png
?????文件?????2048948??2019-04-05?16:51??demo\reflect_img.png
?????文件?????1282616??2019-04-05?16:51??demo\sketch_img.png
?????文件??????389859??2018-09-21?14:44??demo\yuanming.jpg
評論
共有 條評論