I am trying to do something simillar to this, but on Android: http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.html I have an image drawn to ImageView and i want to be able to select 6 points (3 source and 3 target) and use the warpAffine method on OpenCV like the example before. I'm able to reproduce the example above, but when passing the X,Y coordinates from onTouch event, it doesn't give me what i expect. I think the problem is how to convert the android touch coordinates to OpenCV Mat column/row. Maybe i need to display the image on OpenCV surface? I hope i was clear, Thanks in advance.
相关问题
- How can I create this custom Bottom Navigation on
- How to get the background from multiple images by
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
The touch coordinate refer to a point that belongs to your Android's screen resolution (Samsung Galaxy S3 is 720x1280). On the other hand, the OpenCV image could be larger or smaller than that, meaning that a touch coordinate can't be mapped directly into an image coordinate.
What needs to be done to convert from one resolution to the other, is the normalization of the touch coordinate from 720x1280 to the 640x480 range. Therefore, to find the real coordinates on the image you would do: