Finding focal length from image size and FOV [closed] - math

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I have bumped into the following statement in an Engineering journal. The statement is mentioned on right side example.
A 640x480 image with a horizontal FOV of 47 degrees gives focal length
f = 740 pixels.
Please let me know the calculations behind this as I am very new to Computer vision.

AFAIU 740 is not the exact answer for such data but close enough. According to my understanding
f = (width/2) * ctg(HFOV/2)
which give me f = 735.95. And to reverse for f = 740 the HFOV should be 46.77°.
The math behind is following: assume that on their Figure 2 Y1 is actually the top point on the sensor (I'll use vertical field of view here instead of horizontal because it allows me to use that image). Now consider the triangle O-P-Y1. In that triangle ∠P is half of the FOV. On the other hand ctg(∠P) = ctg(FOV/2) is OP/OY1 which is f/(height/2).

Related

Some math abaut circle need mathematical formula [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I have no much time to research net, so can somebody derive the formula for calculating the point belonging to the circle?
as u can see we have point 5,-5 and center, and radius and angle. Thanks for advance, i know that isnt programming problem, but I need this to my project. OFC I see thats point 1,-1. but my pc probably will not ;/
For points inside the circle with radius R and center X,Y:
point (x,y) is inside the circle if:
(X-x)^2+(Y-y)^2 < R^2
Is that what you're after? No.
So what you need is a translate - rotate - translate.
So X,Y is the centre, x,y is the point and angle is the angle in degrees
# Translate
x = x-X ; y = y-Y
# Rotate
rad = angle*M_PI/180
xr = x*cos(rad) + y*sin(rad)
yr = -x*sin(rad) + y*cos(rad)
x = xr+X ; y = yr +Y
So if you only want 90 degrees, replace cos(rad) with 0 and sin(rad) with 1.

Calculating if degree is within bounds of 2 other degrees [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have vectors on a canvas which display a heading.
I also calculated the current heading with which the user is moving his mouse.
When he moves over vectors, i only want to select those that match the heading of the users mouse movements.
e.g. consider vector 1 has 180 degree heading
the user moves his mouse and has an approx heading of 170.
Since the user cannot exactly match the vectors heading, i want to add a margin.
E.g. is heading of vector between (170 - 45) and (170 + 45) ?
The problem arises when the vector has a heading e.g. 350 and the users mouse has a heading of 10 - that would be between (10-45) and (10+45) - now obviously -35 is not good so i add 360 degrees again, in this case 325 < 350 but 350 is not > 55
I obviously need some deeper understanding how to calculate this case.
tldr:
Given degree X, how to measure if it is between degree A and B if you imagine a circle.
Use the difference. Subtract the actual heading from your desired heading. While the answer is <=-180 or >180, add or subtract 360 as appropriate. Then compare the result to your error band (in your example >-45, <45)
Instead of comparing angles I would compare the dot product of the vectors. If a vector has components v=[vx,vy] and I want to compare it to the mouse direction m=[mx,my] then I calculate the following
t = ACOS( (mx*vx+my*vy)/(SQRT(mx^2+my^2)*SQRT(vx^2+vy^2)) )
Then check if the angle t in radians is within the tolerance you want. For example with 6° the code is
IF t<=6*(π/180) THEN ...

Need help finding the points positions [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Here you can see a representation of the problem I need to solve
http://imageshack.us/photo/my-images/542/002yw.png http://imageshack.us/photo/my-images/542/002yw.png
I've two circles defined by their positions BS1 and BS2.
Now I need to get the position of the point A and the only data I've is the distance from point BS1 that is defined by its radius.
Can someone please tell me how can I find the coordiinates of point A?
Thank you very much
PD: I need to do the same with point B.
For simplicity lets say, on your left side of the image you have a center c1, radius r1, and point A. On the right side center c2, radius r2 and point B..
A = ((s1-s2)/|s1-s2|)*r1 + s1
B = ((s2-s1)/|s1-s2|)*r2 + s2
Do not forget, this are vectors.. If you can not understand this equation, tell me and Ill explain it to you.

Calculate destination point [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I want to draw a 3d line from one 3d point to another 3d point.
I know the source point, but need to calculate the destination point. I have the angle and the length of the line. The y coordinate (the height) is the same for the source and the destination point.
Thanks
Basic trig, imagine a bunch of triangles along the various planes and solve for the sides/angles you want to know.
If you give us some sample values for what you already know we can show you the maths.

move a small circle around a big circle [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
this i an interview question i encountered with HULU.
Given two circles, one has radius 1 and the other has radius 2. Let the small one rotate along the perimeter of the big one. how many circles will the small one rotates when it has moves one round inside the big one? and what about outside?
The perimeter of the circle of radius 1 is 2*PI*1 and the other one is 2*PI*2.
Then when the little circles rotates inside it makes 2 round and same thing at the outside... Maybe I don't understand anything...
how many diameters of the small circle are in one diameter of the big one?

Resources