Is there a function in OpenCV that is similar to 'gen_measure_rectangle2' in halcon?

!