Image Mask for Image Matting

7 ビュー (過去 30 日間)
Chen Zhu
Chen Zhu 2017 年 3 月 15 日
回答済み: Renee Coetsee 2017 年 3 月 23 日
I am working on image matting use the code in https://www.mathworks.com/matlabcentral/fileexchange/31412-learning-based-digital-matting.
function demo()
%%parameters to change according to your requests
fn_im='C:\Users\Chen\Desktop\CAS781\learningBasedMatting\data\input_lowres\plasticbag.png';
fn_mask='C:\Users\Chen\Desktop\CAS781\learningBasedMatting\data\trimap_lowres\Trimap1\plasticbag.png';
%%configuration
addpath(genpath('C:\Users\Chen\Desktop\CAS781\learningBasedMatting\code'));
%%read image and mask
imdata=imread(fn_im);
mask=getMask_onlineEvaluation(fn_mask);
%%compute alpha matte
[alpha]=learningBasedMatting(imdata,mask);
%%show and save results
figure,subplot(2,1,1); imshow(imdata);
subplot(2,1,2),imshow(uint8(alpha*255));
% imwrite(uint8(alpha*255),fn_save);
I want to use my own image. I am wondering how to get fn_mask. Could someone help me?
Thanks!

採用された回答

Renee Coetsee
Renee Coetsee 2017 年 3 月 23 日
Since the file exchange submission has the contact information of the author, you can try contacting them directly. It looks like the trimap images came from the following link:
in the "User input (trimaps)" download.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by