What is the function to reverse cv::magnitude()?

Asked 2 years ago, Updated 2 years ago, 64 views

I am using OpenCV 2.4.13.

cv::magnitude(vecX,vecY,vec); allows you to find the vector size, but
On the contrary, is the function for finding the X and Y components of the vector prepared in OpenCV?

I'm calculating it myself, but I thought it would be better to use it if it exists, so please take care of it.

opencv

2022-09-30 19:28

1 Answers

If you know the magnitude of the vector and the normalized (i.e., length 1) directional vector, you can calculate the scalar times of the vector to find each component of the vector.

For example, if the vector size is given as a floating-point variable dist, and a list of direction vectors is given as a variable of type cv::Mat, you can do the calculation with dist*dir.


2022-09-30 19:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.