필터 지우기
필터 지우기

Help with my code please!

조회 수: 2 (최근 30일)
Portgas Ace
Portgas Ace 2014년 9월 30일
I attached images from one literature i read and what is written there is what i want to do. Can you guys help me correct my code? Because i can't make it work. :(
gray_no_OD=im2double(ODRemove);
r=gray_no_OD(:,:,1);
g=gray_no_OD(:,:,2);
b=gray_no_OD(:,:,3);
I=(r+g+b)/3;
MaxI = max(I(:));
MinI = min(I(:));
%subplot(1,2,2); imshow(gray_no_OD)
bs_r=50; %Row value for block segmentation
bs_c=55; %colume value for block (84*84)
[r, c]=size(gray_no_OD)
kk=0;
q=0;
w=0;
store_orig_image = gray_no_OD;
% Dividing the Cover image into bs_r x bs_c Blocks
for i=1:(r/bs_r)
for j=1:(c/bs_c)
feature(:,:,kk+j)=(gray_no_OD((bs_r*(i-1)+1:bs_r*(i-1)+bs_r),(bs_c*(j-1)+1:bs_c*(j-1)+bs_c)));
mean_block = mean2(feature(:,:,kk+j));
std_block = std2(feature(:,:,kk+j));
%===============Sigmoid function================
for m=1:bs_r
for n=1:bs_c
sigm = inv(1+ exp((mean_block-feature(m,n,kk+j))/std_block));
gray_no_OD(m+q,n+w) = 255*((sigm-MinI)/(MaxI-MinI));
end
end
%===============================================
w = w+55;
end
m= m+50;
kk=kk+(r/bs_c);
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by