I have matlab code and i have to convert this code in java.I dont know how to do this.Can you help me please??? here is my Matlab code

clc;
clear all;
close all;
I=imread('test46.jpg');
I=imcrop(I);
I=rgb2gray(I);
I=im2double(I);
sigma = 20/255;
y = I + sigma*randn(size(I));
%-------------------------------------------------NON LOCAL MEANS
S = 10;
P = 3;
h = 10 * sigma;
% xx is denoised image
xx=nonLocalMean(y,h,P,S);
h = fspecial('gaussian',[5 5],1.9);
G=conv2(N,h,'same');
toc
PSNR_gaussian=PeakSignaltoNoiseRatio(I,G)
B=bfilter2(N,[5 5],[3 0.2]);
toc
PSNR_Bilateral=PeakSignaltoNoiseRatio(I,B)
PSNR_StandardNLM = PeakSignaltoNoiseRatio1(I,xx)
%PSNR_NLMMethodNoise=PeakSignaltoNoiseRatio1(I,Fin al)
%-------------------------------------------
figure,imshow(I),title('original')
figure,imshow(y),title('noisy')
figure,imshow(xx),title('Standard NLM')
figure,imshow(gg),title('Gaussian blurring')
figure,imshow(bb),title('Standard NLM')
%imwrite(xx,'z1.png');