Convert from opencv to matlab codes
Show older comments

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
.........................
Answers (0)
Categories
Find more on OpenCV Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!