问题
In this answer described how to get picture from two images so intersection (common part of them) will be coloured black — https://stackoverflow.com/a/31258083/4767232
How can I get this result not as picture but as a rect (e.g. left=100, top=50, bottom=200, right=300)?
回答1:
The position of intersection can be obtained by transforming zero point by the H
matrix.
val p0 = MatOfPoint2f(org.opencv.core.Point(0.0, 0.0))
val result = Mat()
Core.transform(p0, result, H)
(and getting size of the rect is trivial)
来源:https://stackoverflow.com/questions/50171415/get-coordinates-of-images-intersection-with-opencv