2013-07-09 1 views
-1

사람들은 약간 당혹 스럽다면 미안합니다. 누구든지 이미지 크기의 평균 크기를 계산하는 방법을 도울 수 있습니다.java.awt.Dimension의 평균

Dimension d = new Dimension (d); 
//where: 
int width = (int)d.getWidth 
int heigth = (int)d.getHeigth 

===> image size = (width, length); 
//Example 
image1 = (200, 350); 
image2 = (250, 280); 
image3 = (340, 260); 

3 개 이미지의 평균 크기는 어떻게 계산할 수 있습니까 ???

+1

다른 숫자를 어떻게 평균합니까? – mattbdean

+0

평균 ** 면적 ** (평균 (너비 * 길이))을 의미합니까? 또는 특성 항목 (평균 (너비), 평균 (길이))? – CPerkins

답변

1
Dimension result = new Dimension() 
result.width = image1.getWidth() + image2.getWidth() + image3.getWidth(); 
result.height = image1.getHeight() + image2.getHeight() + image3.getHeight(); 
result.width /= 3; 
result.height /= 3; 

기본적으로 다른 평균과 비슷합니다.

+0

... 이렇게하는 특별한 방법이 있다고 생각합니다. 고마워요! –