Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 如何将所有**容器**对准同一方向?_Image_Matlab_Image Processing_Alignment_Medical - Fatal编程技术网

Image 如何将所有**容器**对准同一方向?

Image 如何将所有**容器**对准同一方向?,image,matlab,image-processing,alignment,medical,Image,Matlab,Image Processing,Alignment,Medical,我正在从事一个医学图像处理项目,我想检测图像中血管的方程。我想规范化数据集,以便所有的主要血管都指向同一方向。例如,图像是: 主要船舶将标记为: 对于输入图像 主要船舶将标记为: 我想自动检测方向并在第二个输入图像上执行旋转,如下所示: 如何检测这些容器并相应地进行校准 编辑: 到目前为止,我尝试使用以下代码: clear global clc warning on addpath(genpath('\D:\OCT_enface_registration\codes\ode_alignmen

我正在从事一个医学图像处理项目,我想检测图像中血管的方程。我想规范化数据集,以便所有的主要血管都指向同一方向。例如,图像是:

主要船舶将标记为:

对于输入图像

主要船舶将标记为:

我想自动检测方向并在第二个输入图像上执行旋转,如下所示:

如何检测这些容器并相应地进行校准

编辑

到目前为止,我尝试使用以下代码:

clear global
clc
warning on
addpath(genpath('\D:\OCT_enface_registration\codes\ode_alignment\'));

img = imread('D:\OCT_enface_registration\data\RPEDC\OD_circle\Khader Pasha Sk _2246_AngioVue Disc_OS_2016-06-15_02.png');

%Perform histogram
imgHist = histeq(img);

%Set up the threshold value
Threshold = 120;

%The vessels are extracted using Kirsch templates. It is an operator (mapping) to find the maximum
%edge strength in a few predetermined directions.
bloodVessels = VesselExtract(imgHist(:,:,1), Threshold);
im = im2double(imgHist);

% Convert RGB to Gray via PCA
lab = rgb2lab(im);
f = 0;
wlab = reshape(bsxfun(@times,cat(3,1-f,f/2,f/2),lab),[],3);
[C,S] = pca(wlab);
S = reshape(S,size(lab));
S = S(:,:,1);
gray = (S-min(S(:)))./(max(S(:))-min(S(:)));

%% Background Exclusion
% Apply Average Filter of [9 9] size
h = fspecial('average', [9 9]);

%Gray image having the dimensions of  [9 9]
JF = imfilter(gray, h);
%figure, imshow(JF);

% Take the difference between the gray image and Average Filter
Z = imsubtract(JF, gray);
%figure, imshow(Z);

%% Threshold using the IsoData Method (Iterative Self-Organizing Data Analysis Technique)
%It is a method of unsupervised classification to cluster a data depedning
%on threshold values.
%More information: http://web.pdx.edu/~jduh/courses/Archive/geog481w07/Students/Vassilaros_ISODATA.pdf
level=isodata(Z); % this is our threshold level

%% Convert to Binary
BW = imbinarize(Z, level-.008);

%% Remove small pixels
BW2 = bwareaopen(BW, 100);

%% Overlay: Image put on another image
BW2 = imcomplement(BW2);
out = imoverlay(imgHist, BW2, [0 0 0]);
%figure, imshow(out);
samp=imgaussfilt(double(BW2));
samp1=samp>0.9;
figure;imshow(samp1);
samp2=samp<0.1;
%figure;imshow(samp2);
%figure;imshow(samp2, 'ColorMap', [1 1 1; 1 0 0]);
清除全局
clc
警告
addpath(genpath('\D:\OCT\u enface\u registration\code\ode\u alignment\);
img=imread('D:\OCT\u enface\u registration\data\RPEDC\OD\u circle\Khader Pasha Sk\u 2246\u AngioVue Disc\u OS\u 2016-06-15\u 02.png');
%执行直方图
imgHist=histeq(img);
%设置阈值
阈值=120;
%使用Kirsch模板提取血管。这是一个查找最大值的运算符(映射)
%在几个预定方向上的边缘强度。
血管=血管提取物(imgHist(:,:,1),阈值);
im=im2double(imgHist);
%通过PCA将RGB转换为灰色
实验室=rgb2lab(im);
f=0;
wlab=重塑(bsxfun(@次,cat(3,1-f,f/2,f/2),实验室),[],3);
[C,S]=pca(wlab);
S=重塑(S,尺寸(实验室));
S=S(:,:,1);
灰色=(S-min(S(:))./(max(S(:)-min(S(:)))));
%%背景排除
%应用[9]大小的平均过滤器
h=F特殊(‘平均’,[9]);
%尺寸为[9]的灰色图像
JF=imfilter(灰色,h);
%图,imshow(JF);
%取灰度图像和平均滤波器之间的差值
Z=imsubtract(JF,灰色);
%图,imshow(Z);
%%使用IsoData方法(迭代自组织数据分析技术)的阈值
%它是一种无监督分类方法,用于对依赖于数据的数据进行聚类
%关于阈值。
%更多信息:http://web.pdx.edu/~jduh/courses/Archive/geog481w07/Students/Vassilaros_ISODATA.pdf
级别=isodata(Z);%这是我们的门槛水平
%%转换成二进制
BW=imbinarize(Z,级别-0.008);
%%去除小像素
BW2=bwareaopen(BW,100);
%%覆盖:图像放在另一个图像上
BW2=补码(BW2);
out=imoverlay(imgHist,BW2[0]);
%图,imshow(out);
samp=imgaussfilt(双(BW2));
samp1=samp>0.9;
图形imshow(samp1);

samp2=让我问一个经典的问题:你试过什么?我想你不想让我们为你这么做。除了安德的问题,请说明你如何定义“主要血管”@AnderBiguri,我已经做了必要的编辑,并添加了我尝试过的代码。@Raha,最明亮的是血管。有时,有不止一个同样明亮的容器。