iPhone编程将IplImage坐标转换为UIImage坐标
我正在制作一个实时显示视频源的应用程序,并使用 OpenCV 处理帧以检测其中存在的人脸。为此,我需要将帧转换为 UIImage,然后转换为 IplImage。然后我运行面部检测,到目前为止一切都很好,除了检测到面部时捕获的坐标是 IplImage 的坐标并且原点从右下角开始......并且我需要具有左上角原点的坐标。
换句话说,我需要将具有右下原点的坐标点转换为具有左上角原点的坐标。有谁知道 Xcode 中是否有一个函数可以做到这一点?或者我可以从哪里开始寻找创建一个?
我需要坐标点,但无法直接在 IplImage 上绘制并转换回 UIImage 进行显示,因为我正在使用从面部检测获得的坐标点进行进一步处理。
任何帮助将不胜感激:) 谢谢!
I am making an application that shows the video feed in real time and I am processing the frames using OpenCV to detect faces present in them. To do this, I need to convert the frames into UIImage and then IplImage. Then I run the face detection and everything so far works great except that the coordinates captured when a face is detected are those for an IplImage and the origin starts at the bottom right corner... and I need coordinates with a top left origin.
In other words, I need to convert the coordinate points I have with a bottom right origin to coordinates with a top left origin. Does anyone know if there is a function to do this in Xcode? or where I can start to look to create one?
I need the coordinate points and cannot draw directly over the IplImage and convert back to UIImage to display because I am using the coordinate points I get from the face detection to do further processing.
Any help will be greatly appreciated :)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果 UIImage 和 IPLImage 的高度相同,您不能只从图像的高度中减去 y 坐标吗?
If the UIImage and IPLImage are the same height can't you just subtract the y coordinate from the image's height?