1

写真からオブジェクトを測定する方法が必要です...オブジェクトをカードのサイズと比較してオブジェクトのサイズを取得できるということですが、これを比較する方法がわかりません...何か案が?

これが私が写真を撮っている方法です

- (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];
 }
4

1 に答える 1

3

これは、いくつかの ios 移植された画像処理アルゴリズムを含むサイトです。画像の外縁と参照オブジェクトを検出できれば (そしてそれらが同じ深さにあることがわかっていれば)、サイズを概算できるはずです。

編集 - そのリンクにコードがないことがわかりました。 これは、OpenCVを使用してエッジ検出を行うことに関するSOの回答です。とにかく、要点は、写真から測定可能な特徴を引き出すには画像処理が必要だということです。

于 2013-02-25T15:30:16.697 に答える