Convert from opencv to matlab codes

1 Ansicht (letzte 30 Tage)
Rooter Boy
Rooter Boy am 9 Nov. 2020
Bearbeitet: Rooter Boy am 10 Nov. 2020
This code my OpenCV code blog. I want to convert from this codes to matlab codes but i don't know how to do this. Can you help me please?
% I generated random gaussian noise
I = imread('pears.png');
J = rgb2gray(I);
p3 = 0;
p4 = 0.05;
J = im2double(J);
b = J + sqrt(p4)*randn(size(J))+p3;
imshow(b)
dim = size(I);
[rows, columns, numberOfColorChannels] = size(I);
saltpepper_noise=zeros((m, n));
saltpepper_noise=rand(m,n); #creates a uniform random variable from 0 to 1
for i in range(0,m):
for j in range(0,n):
if saltpepper_noise[i,j]<=0.5:
saltpepper_noise[i,j]=0
else:
saltpepper_noise[i,j]=255
.........................

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by