背景:
我的问题涉及从电泳凝胶中提取特征(见下文)在这种凝胶中,DNA从顶部加载,并在电压梯度下迁移这种凝胶有筛子,所以较小的分子比较长的分子迁移得更远,从而导致DNA的长度分离分子越高,它就越长。
问题:
在这张图片中,有9个通道,每个通道都有不同的DNA来源我感兴趣的是测量每个车道的平均位置(Y轴上的值)。
我对图像处理还不太熟悉,但我知道MATLAB,我可以用R来解决一些困难如果有人能告诉我如何找到每条车道的平均数,我将非常感激。
matlab - 从电泳凝胶图像测量加权平均长度-LMLPHP

最佳答案

这是我的尝试它要求凝胶很好(即直道和凝胶不应旋转),但应在其他方面相当普遍的工作请注意,有两个与图像大小相关的参数需要调整,以便在不同大小的图像上执行此操作。

%# first size-dependent parameter: should be about 1/4th-1/5th
%# of the lane width in pixels.
minFilterWidth = 10;

%# second size-dependent parameter for filtering the
%# lane profiles
gaussWidth = 5;

%# read the image, normalize to 0...1
img = imread('http://img823.imageshack.us/img823/588/gele.png');
img = rgb2gray(img);
img = double(img)/255;

%# Otsu thresholding to (roughly) find lanes
thMsk = img < graythresh(img);

%# count the mask-pixels in each columns. Due to
%# lane separation, there will be fewer pixels
%# between lanes
cts = sum(thMsk,1);

%# widen the local minima, so that we get a nice
%# separation between lanes
ctsEroded = imerode(cts,ones(1,minFilterWidth));

%# use imregionalmin to identify the separation
%# between lanes. Invert to get a positive mask
laneMsk = ~repmat(imregionalmin(ctsEroded),size(img,1),1);

带有将用于分析的车道的图像
%# for each lane, create an averaged profile
lblMsk = bwlabel(laneMsk);
nLanes = max(lblMsk(:));

profiles = zeros(size(img,1),nLanes);
midLane = zeros(1,nLanes);

for i = 1:nLanes
profiles(:,i) = mean(img.*(lblMsk==i),2);
midLane(:,i) = mean(find(lblMsk(1,:)==i));
end

%# Gauss-filter the profiles (each column is an
%# averaged intensity profile
G = exp(-(-gaussWidth*5:gaussWidth*5).^2/(2*gaussWidth^2));
G=G./sum(G);
profiles = imfilter(profiles,G','replicate'); %'

%# find the minima
[~,idx] = min(profiles,[],1);

%# plot
figure,imshow(img,[])
hold on, plot(midLane,idx,'.r')

09-15 23:35