Not getting 360 values from Histogram

조회 수: 2 (최근 30일)
Explorer
Explorer 2014년 2월 11일
답변: Image Analyst 2014년 2월 11일
I should get 360 values of histogram of distances from centroid (signature of object) as mentioned here : http://www.2shared.com/photo/baX-TtQ6/follow.html
But I am getting only ten values from histogram.
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
MATLAB Code :
clear all; close all; imtool close all; clc;
image = imread('C:\Users\Explorer\Desktop\aa_contour.jpg');
BW = im2bw(image);
stats = regionprops(BW, 'Centroid') ;
c = stats.Centroid ;
boundary = bwboundaries(BW);
thisBoundary = boundary{1}; % Or whatever blob you want.
x = thisBoundary(:,1);
y = thisBoundary(:,2);
distances = sqrt((x - c(1)).^2 + (y - c(2)).^2) ;
[nelements, centers] = hist(distances)
bar(centers, nelements);
grid on;
------------------------------------------------------------------------------------
Output
nelements = 178 80 66 60 56 52 52 50 48 49
centers =
Columns 1 through 3
183.161086305936 204.483258917807 225.805431529678
Columns 4 through 6
247.12760414155 268.449776753421 289.771949365293
Columns 7 through 9
311.094121977164 332.416294589035 353.738467200907
Column 10
375.060639812778
-----------------------------------------------------------------------------------

채택된 답변

Image Analyst
Image Analyst 2014년 2월 11일
hist() by default makes 10 bins. Specify 360 in the arg list if you want 360 bins.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by