【发布时间】:2014-09-19 22:17:46
【问题描述】:
我根据预定义的(例如)距离和图像宽度和高度来分配图像大小。我参考了这些链接:link1link2
height_of_frame = ((obj_distance) * measured_object_height_in_mm / 1000.0))/focal;
width_of_frame = ((obj_distance) * measured_object_width_in_mm / 1000.0))/focal;
int imagesize_height = ((152.4)*1990/1000)/0.33;
int imagesize_width = ((152.4)*3500/1000)/0.33;
距离以厘米为单位 = 152.4,ipadMini 相机焦距为 3.3mm = 0.33cm
但是,如果我这样做,它会减小图像大小而不是靠近或靠近。
基于纵横比的图像大小:
CGFloat widthRatio = self.view.frame.size.width / enteredRoomSize.width;
CGFloat heightRatio = self.view.frame.size.height / enteredRoomSize.height;
CGSize imageSize = CGSizeMake(350 * widthRatio, 199 * widthRatio);
mmageView=[[UIImageView alloc]init];
CGRect frame = mmageView.frame; frame.size = imageSize; mmageView.frame = frame;
【问题讨论】:
-
我编辑了我的答案以匹配您的符号,但您需要澄清您的问题......“但是,如果我这样做,它会减小图像大小而不是接近或接近”是什么意思。 ?
标签: ios objective-c image-processing augmented-reality core-motion