Help with my code please!
3 次查看(过去 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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145558/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145559/image.jpeg)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Filtering and Enhancement 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!