function f_threshold(file_name)
% Evan Ruzanski and Chiou-Wei Tsai
% UCSB, 11/3/2003
clc
% Initialize variables
thresh = 77;
gray_range = 256;
% Read and display test image as given in Lee, p. 712
im = imread(file_name);
figure
imshow(im); title('Original 2D image');
% Perform binary spatial lifting
s = size(im);
imz(1:s(1),1:s(2),1:gray_range) = 0;
im = double(im); % Typecast for arithmetic operations
for i = 1:s(1)
for j = 1:s(2)
if im(i,j) > 1
imz(i,j,1:im(i,j)) = 1; % Make 3rd Dim binary
end
end
end
% 3D representation of lifting the image
figure(2)
x = 1:s(1);
y = 1:s(2);
[X,Y] = meshgrid(x,y);
colormap(gray)
rotate3d
mesh(X,Y,im); axis tight
title('Lifted representation of 2D image')
% Take 3D FFT of binary lifted data
IMZT = fftn(imz);
% Slice and extract
S = size(IMZT);
un = [zeros(1,thresh - 1) ones(1,S(3) - (thresh - 1))]; % Create unit step
U = fft(un);
for i = 1:S(1),
for j = 1: S(2),
IM2D(i, j) = IMZT(i,j,:)*U';
end
end
% Recover and disply 2D image
im2d = ifft2(IM2D);
im2d = 1/256*fix(real(im2d));
figure
imshow(uint8(im2d)); title('Thresholded image');
f_threshold.rar_threshold_自动阈值 图像 分割_自动阈值分割_自动阈值处理_阈值分割
版权申诉
120 浏览量
2022-07-14
20:44:52
上传
评论
收藏 3KB RAR 举报
weixin_42651887
- 粉丝: 75
- 资源: 1万+
最新资源
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- 【ERP标准流程-标准流程-进货管理】(DOC 17页).doc
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- Java爬虫项目【项目开发计划】(共12页).docx
- 11111111111
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0