图像清晰化处理源码程序 - vb源码程序 - 谷速源码
下载频道> 资源分类> 编程语言> VB源码> 图像清晰化处理源码程序

标题:图像清晰化处理源码程序
分享到:

所属分类: VB源码 资源类型: 文件大小: 37.49 KB 上传时间: 2016-01-25 19:59:29 下载次数: 8 资源积分:1分 提 供 者: xiaopeng2 图像清晰化处理源码程序
内容:
图像清晰化处理源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
function [outputImage, number_of_nuclei] = nuclei_counter(sourceImage, threshold)
% This script accept an input nuclei image taken under microscope,
% then preprocess the image with tophat and bottomhat filter, enhance its 
% contrast by multiplying gamma. Convert it to binary image with a histogram 
% based threshold, count the number of connected components and detect edges
% of nucleus with LoG filter, then plot edges. Or calculate distance transform 
% and detect seed points,use watershed algorithm for segmentation.
% flow chart:
% input image ---> tophat/bottomhat filter ---> image enhancement--->binarization by a histogram based threshold
%  ---> calculate seed points ---> segmentation or plot edges of blobs ---> count connected components
%  
% refrence:
% * Yousef Al-Kofahi, et al. Improved Automatic Detection and Segmentation of Cell Nuclei in Histopathology Images. 
%   IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, VOL. 57, NO. 4, APRIL 2010
% * Jos B.T.M, et al, The Watershed Transform: Defnitions, Algorithms and Parallelization Strategies
%   Fundamenta Informaticae 41 (2001) 187{228
% Input
%     sourceImage: 8 bits grayscale image;
%     threshold: threshold [0 1] for binarization.
%     
% Output:
%     outputImage: source image with overlayed contour
%     number_of_nuclei: number of nucleis in image
%     
% If you have any ideas or improvements about this method, welcome to contact me 'zhyh8341@gmail.com'.
 
 
% display original image
image = sourceImage;
figure;imshow(image);
title('input image');
 
total = numel(image);
 
 
% apply top hat and bottom hat filter
se = strel('disk',30);
tophat = imtophat(image,se);
bottomhat = imbothat(image,se);
filterImage = image + (tophat - bottomhat);
se = strel('disk',15);
tophat = imtophat(filterImage,se);
bottomhat = imbothat(filterImage,se);
filterImage = filterImage + (tophat - bottomhat);
 
% calculate histogram of filtered image
% estimate more than 78.5% area is background (pi/4 = .785)
[counts,x] = imhist(filterImage);
ssum = cumsum(counts);
bg = .215*total;
fg = .99*total;
low = find(ssum>bg, 1, 'first');
high = find(ssum>fg, 1, 'first');
adjustedImage = imadjust(filterImage, [low/255 high/255],[0 1],1.8);
 
 
% image binarization, threshold is choosen based on experience
if(nargin < 2)
    matrix = reshape(adjustedImage,total,1);
    matrix = sort(matrix);
    threshold = graythresh(matrix(total*.5:end));
end
binarization = im2bw(adjustedImage,threshold);
 
 
% open image and then detect edge using laplacian of gaussian
se2 = strel('disk',5);
afterOpening = imopen(binarization,se2);
nsize = 5; sigma = 3;
h = fspecial('log',nsize,sigma);
afterLoG = uint8(imfilter(double(afterOpening)*255,h,'same').*(sigma^2)); 
 
 
se2 = strel('disk',5);
afterOpening = imopen(binarization,se2);
number_of_nuclei = bwconncomp(afterOpening);
 
 
% % you can either use watershed method to do segmentation
% D = -bwdist(~afterOpening);
% D(~afterOpening) = -Inf;
% L = watershed(D);
 
 
outputImage = sourceImage + afterLoG*5;
figure;imshow(outputImage);
title('output image');
 
    

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

图像清晰化处理源码程序/
图像清晰化处理源码程序/Nuclei_Counter/
图像清晰化处理源码程序/Nuclei_Counter/example.m
图像清晰化处理源码程序/Nuclei_Counter/img01.JPG
图像清晰化处理源码程序/Nuclei_Counter/nuclei_counter.m

关键词: 源码 图像 程序

编程语言下载排行

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved