OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Tue, 05 Sep 2017 19:19:43 -0500Degree Values after conversionhttp://answers.opencv.org/question/173655/degree-values-after-conversion/Hi All,
I have few sets of pair coordinates. For each pair, i would like to get the value of the degree and here is my code
double deg = atan((b.y-a.y)/(b.x-a.x)) * 180 / PI;
std::cout << "deg" <<deg<< std::endl;
file<<deg<<",";
From the value, it can be resulted for 40 degree. As we know, there is another degree which similar to 40 degree which is 180+40 = 220 degree.
So far, by using the formula, i had never encountered a degree more than 180. Is it possible to have that value i.e 220 degree after arctan process?
zmsTue, 05 Sep 2017 19:19:43 -0500http://answers.opencv.org/question/173655/Why degree from image is not the same at the theory in math?http://answers.opencv.org/question/71978/why-degree-from-image-is-not-the-same-at-the-theory-in-math/ Hello,
I have question on the degree calculated from the atan function between two points (x1,y1) and (x2,y2). From what I get from the online tutorial, the formula would be atan((y2-y1)/(x2-x1)) and convert it to degree later. Please refer to the image below.[C:\fakepath\degree.png](/upfiles/14436839992436152.png)
![image description](/upfiles/14436842259764549.png)
The question is, if there is negative degree value, in normal mathematical quadrant, it will be located in quadrant 2 and 4 but from the picture it shows that it is in quadrant 1 and 3. Am I correct in interpreting this degree in terms of image processing?zmsThu, 01 Oct 2015 02:22:56 -0500http://answers.opencv.org/question/71978/Hough Transform degree calculated from which angle?http://answers.opencv.org/question/44491/hough-transform-degree-calculated-from-which-angle/Hello expert,
I'm still curious where the degree for the houghtransformP function start? I had debugged my code and got funny answer
All the while I thought the degree will start from top corner (0,0) coordinate and clockwise direction, but eventually when I execute my code, looks like it is not from top corner(0,0) using C++ opencv but it is look like the degree start from 0 degree lower left corner anti clock wise direction.
Please help to enlighten me on this. Quite confusing with the result
zmsThu, 16 Oct 2014 02:24:04 -0500http://answers.opencv.org/question/44491/Hough Transform Probablistic with selected degreehttp://answers.opencv.org/question/42375/hough-transform-probablistic-with-selected-degree/Just another question related to Hough Transform but for Probabilistic Hough Line Transform. In this function, the HT Prob
HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
with the arguments:
- dst: Output of the edge detector. It should be a grayscale image (although in fact it is a binary one)
- lines: A vector that will store the parameters (x_{start}, y_{start}, x_{end}, y_{end}) of the detected lines
- rho : The resolution of the parameter r in pixels. We use 1 pixel.
- theta: The resolution of the parameter \theta in radians. We use 1 degree (CV_PI/180)
- threshold: The minimum number of intersections to “detect” a line
- minLinLength: The minimum number of points that can form a line. Lines with less than this number of points are disregarded.
- maxLineGap: The maximum gap between two points to be considered in the same line.
Here can the rho and theta been employed again to get the selective degree? The lines now are vectors X start, Y start, X end and Y end which is different.
Can I limit the range that houghLines probablistic searches through? If yes, should I declare again using x start, y start, x end and y end?zmsFri, 19 Sep 2014 04:03:29 -0500http://answers.opencv.org/question/42375/