我使用matlab eight.tif中的8个图像
我有以下代码:
FullImage = imread('eight.tif');
roi_col = [50 50 250 250];
roi_row = [200 50 50 200];
ROI_help1 = roipoly(FullImage,roi_col,roi_row);
roi_col = [100 70 200 200];
roi_row = [180 100 70 180];
ROI_help2 = roipoly(FullImage,roi_col,roi_row);
ROI=logical(ROI_help2-ROI_help1);
YourFilter = @(x) edge(FullImage,'Canny',0.1);
J = roifilt2(FullImage,ROI,YourFilter);
figure, imshow(FullImage)
overlay=imoverlay(FullImage,J,'red');
hold on;
imshow(overlay);这给了我这个:edge detection performed with canny on roi
我如何才能只在圆上执行精明的边缘检测,而不接触内部和外部的红色区域,所以它应该在那里显示正常的图像?
发布于 2018-05-24 16:17:15
解决了我的问题。只需要从J创建一个ROI和substract的补集
ROI_neg=imcomplement(ROI);
LOL=J-ROI_neg;
figure;
overlay=imoverlay(Image,LOL,'red');
hold on;
imshow(overlay);但是,如果我使用不同的图像(拼接的图像。太大而无法更新)它不会工作。我是否遗漏了任何特定的要求?数据类型等?我使用.tif
https://stackoverflow.com/questions/50482033
复制相似问题