フィルターのクリア

Detect Edges having length greater than 50km

1 回表示 (過去 30 日間)
Nadia jabeen
Nadia jabeen 2020 年 10 月 19 日
コメント済み: Nadia jabeen 2020 年 10 月 20 日
Hi all,
I have detected edges using Canny Edge detector. But I want to detect Edges having length greater than 50km. I have attached code. Can anyone help me to edit code to detect edges of given length?
X = cell2mat(struct2cell(load('F:\study\practise\New folder\2010\script\preprocessed2010.mat', 'Alpha')));
for k=1:length(X)
b=X(k).img;
b(b==0)=NaN;
b (b > -5) = NaN;
b (b < -32) = NaN;
figure, temp1 = imagesc(b);title('Original Image') ;colormap('gray'); colorbar;
baseFileName = sprintf('%d.jpg',k);
% % % Specify some particular, specific folder:
fullFileName = fullfile('E:\practise\images', baseFileName);
figure(gcf); % Activate the figure again.
export_fig(fullFileName);
% Get edges
A = edge(b, 'canny');
figure, temp1 = imagesc(A);title('Edge Detected Image') ;colormap('gray'); colorbar;
baseFileName = sprintf('%dCanny.jpg',k);
fullFileName = fullfile('E:\practise\images', baseFileName);
figure(gcf); % Activate the figure again.
export_fig(fullFileName);
%
end

採用された回答

Image Analyst
Image Analyst 2020 年 10 月 19 日
You forgot to attach preprocessed2010.mat.
After you get the binary image, A, you can call bwareaopen() to extract only those blobs with area more than however many pixels 50 km is;
fiftyKm = round(50 * pixelsPerKm);
A50 = bwareaopen(A, fiftyKm);
  2 件のコメント
Nadia jabeen
Nadia jabeen 2020 年 10 月 20 日
Pixel area is 30*30m. I want to extract edges having length more than 50km.
Nadia jabeen
Nadia jabeen 2020 年 10 月 20 日
I don't want to extract pixels. All edges have been extracted from bwareaopen() function.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by