Convert from opencv to matlab codes
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!