2013-02-25 2 views
1

사진에서 물체를 측정하는 방법이 필요합니다 ... 나는 물체와 크기를 비교하기 위해 물체와 카드의 크기를 비교할 수는 있지만 이걸 어떻게 비교할 지 모르겠다 ... 어떤 생각? 여기카메라로 물체의 크기를 측정하십시오.

내가 어떤 IOS있는 사이트가 사진 여기

- (IBAction)takePicture:(id)sender { 
// Create image picker controller 
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; 

// Set source to the camera 
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; 

// Delegate is self 
imagePicker.delegate = self; 

// Allow editing of image ? 
imagePicker.allowsImageEditing = NO; 

// Show image picker 
[self presentModalViewController:imagePicker animated:YES]; 

    } 

     - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo 
    { 
UIAlertView *alert; 

// Unable to save the image 
if (error) 
    alert = [[UIAlertView alloc] initWithTitle:@"Error" 
             message:@"Unable to save image to Photo Album." 
             delegate:self cancelButtonTitle:@"Ok" 
          otherButtonTitles:nil]; 
else // All is well 
    alert = [[UIAlertView alloc] initWithTitle:@"Success" 
             message:@"Image saved to Photo Album." 
             delegate:self cancelButtonTitle:@"Ok" 
          otherButtonTitles:nil]; 
[alert show]; 
[alert release]; 
} 
+0

표시 한 코드는 이미지 선택기를 호출하는 방법입니다. 그것은 당신의 질문과 어떤 관련이 있습니까? –

+0

예,이 이미지를 가져 와서 정의 된 영역에서 너비와 높이를 가져와야합니다. – Ladessa

+1

올바르게 이해하면이 영역을 식별하고 크기를 가져 와서 일부 실제 세계로 변환하기 위해 일부 이미지 처리를 수행해야합니다. 조치. –

답변

3

있어 복용 image processing algorithms를 포팅하고 방법이다. 이미지의 바깥 쪽 가장자리와 일부 참조 객체를 감지 할 수 있고 (같은 깊이에 있음을 알면) 크기를 대략적으로 표현할 수 있어야합니다.

EDIT - 해당 링크에는 코드가 없습니다. Here's an SO answer about using OpenCV to do edge detection. 어쨌든 요점은 사진에서 측정 가능한 기능을 가져 오려면 이미지 처리가 필요하다는 것입니다.

관련 문제