Convert from opencv to matlab codes
1 view (last 30 days)
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
.........................
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!