フィルターのクリア

extracting avocado fruits from an image (band780).

1 回表示 (過去 30 日間)
elena bogdanova
elena bogdanova 2019 年 1 月 30 日
I need to extract avocado fruits from an image (band780). besides avocado there are trees and leaves.
In the code now looks like this but the main problem is that i cannot mask out the background as it is not clear what exactly is a background here
%original image
x = imread('REF_024_11072018_084046937_780.TIF');
imshow(x)
title('Raw Image')
%color map
% figure
% imshow(x)
% colormap jet
% title('Jet color map')
%histogram stretch
h=histeq(x);
figure
imshow(h)
title('histogram')
%Negative Histogram
ng = max(h) - h;
figure
imshow(ng)
colormap jet
title ('Negative Histogram')
%invert
n = ng - x;
figure
imshow(n)
title Invert
%background estimation (non uniform illumination)
% bg = imopen(x,strel('disk',10));
% figure
% imshow(bg)
% colormap jet
% title Background
% %Negative Background
% ng = max(bg) - bg;
% figure
% imshow(ng)
% colormap jet
% title ('Negative Background')
%background removal (flatten background level)
% y = imsubtract(x,bg);
% figure
% imshow(y)
% title Flattened
%segment grains from background
bw = im2bw(n,graythresh(n));
figure
imshow(bw)
title GrayThreshed
%edge detection
%sobel
edgeS = edge(bw,'sobel');
% BW2 = edge(bw,'canny');
figure
imshow(edgeS)
title Edge
%label connected regions
Screen Shot 2019-01-30 at 9.23.15 AM.png

回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by