필터 지우기
필터 지우기

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 CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by