please correct TV-L2 inpainting code

7 views (last 30 days)
yuya watabe
yuya watabe on 25 Jun 2018
Edited: yuya watabe on 25 Jun 2018
i make image inpaint code with TV-L2. but this code dont show pic how can i chage to work code.
%
u=imread("pic.jpg")
lalambda = 0.5;
epsilon = 0.001;
p = 0.0005;
N = 2000;
u = ub;
for i = 1:N
[ux,uy] = grad(u);
normgrad = sqrt(ux.^2+uy.^2+epsilon^2);
u = u - p*(u-ub-lambda*div(ux./normgrad,uy./normgrad));
end
figure(3);imshow(u,[]);

Answers (0)

Community Treasure Hunt

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

Start Hunting!