Borrar filtros
Borrar filtros

extracting avocado fruits from an image (band780).

1 visualización (últimos 30 días)
elena bogdanova
elena bogdanova el 30 de En. de 2019
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

Respuestas (0)

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by