Title: Finding Line Orientation Dr' Niels Lobo Computer Science
1Finding Line OrientationDr. Niels
LoboComputer Science
2Finding Line Orientation
- Computer Vision
- Good for substituting machine in place of eye
- Can assist with recognition
- Can assist with navigation
- Can assist with manipulation
3Helpful Mirror
- Computers Highly Interactive
- Imaging Sensors Seamlessly Integrating into Our
Environment - Image Processing to Make Computers See
- Fusion is Key!
4Driverless Cars
Automated Driver Console
Driverless Taxis
DARPA Grand Challenge To Urban Challenge
5SafeCam Force
Camera Network
Airport Security
Title
Your Text here
Speaker
Crowd
Monitor U.S. assets abroad
Border Control
6Medical Imaging
Revolutionizing Medical Science
3D Models
Image Guided Surgery
Computerized Bone Age Estimation
Automated Cancer Scans
7Let us examine a specific subtask
- Monitor an elderly persons medication intake
8Monitoring Taking Medicines
9An Even Simpler Task
- Track babys hands to keep him safe
10Let us see how to do this
- First, break movie into single frames
- Next, work on each frame separately
11Frames in a video
12Suppose have detector for skin
13Measure Orientation of Each Arm
14Orientation is best line thru region
15Best line is measured by distancesDistance
between point and line
16Total Squared Distances
- Now, we can add up the total of all distances
-
(1)
17Find line that minimizes total distances
- Our task then is to find the line that
- minimizes
18This is Optimization
- This brings us to the Calculus topic of
-
- Minimization, which is special case of
- Optimization.
19How your book does Optimization
- Example from your book
- Section 4.7, 3
- Find two positive numbers, whose product
- is 100, and whose sum is a minimum.
20Solution
- Have x y 100, giving y 100/x.
- Now, Sum x y
- or Sum x (100/x) i.e. (x² 100)/x
- d/dx Sum (2x² - x² - 100)/(x²) (x² - 100)/x²
- When we set to zero, we get x 10 or -10
- Problem asked for positive, so x 10, then y
10.
21Back to our application
- Our task was to find the line that
- minimizes
- where
(1)
-
22Small Test
- Write expression for
-
- if the problem also specified that each point
- has weight wi attached to it.
23Proceed to Our Minimization
24Alternative Equation for Line
- Normalized Equation of Line
- Obtainable from A x B y C 0.
- It is
(2)
25Alternate Equations Figure
- This equation can be used for ANY line
26Fearlessly, moving on
- Combining Equation 2 and Figure 1a, get
27Obtain an equation to minimize
- So, Equation 1 now becomes
-
(3) - Need to miminize this new equation
-
28Minimizing equations of 2 variables
- Our equation has two variables
and - We want specific choices of and
-
- that will give a minimum value for
29Minimizing Equations of 2 variables
- When have 2, need to minimize for first
- variable, obtain a new equation that does
- not contain the first, and then minimize
- for second variable.
- We will first minimize for , and then
- for
-
30Minimize for
- Take derivative of with respect to
- and then set the answer to zero, and solve
- for .
31Taking Derivative w.r.t.
- To repeat,
- So,
- Hence,
- Giving,
-
32Simplifying to get Intuition
- Dividing all by N
- we get,
-
- meaning this is the Centroid. It lies on the line.
33Yay!! Removed
- Substituting this new value of gives
-
- This completes the first stage of
differentiation. - Note that new equation has no
-
34Change origin to centroid
- Substituting and
-
- gives
(6) - This represents a change of coordinates.
- If the new coordinate origin is moved to the
centroid, - the only unknown left is the angle of rotation.
35Need to minimize for
- Equation 6 can be expanded as
-
(7)
- where
-
36Minimize for second variable
- We need to differentiate w.r.t. , to
solve for - However, the differentiation will be easier if
- equation 7 can be converted further, as
follows - Use
- and
-
- get
37To differentiate w.r.t.
- simplifies to
- When differentiated w.r.t. , and set to
zero - get
- Could solve for , but complications with
ARCTAN need further steps.
38A way to not take ArcTan 2
- Using double angle formula for tan,
-
- get
- gives
- or
39Get expression for tan
- Use Quadratic Formula Solution,
-
- and the negative option (need minimum)
-
40Finally
- Finally get,
- Phew!! Now can get answer for
- Hence, have final equation for winning line
-
41Small Test 2
- Summarize the major ideas in minimizing
- a two-variable expression.
42In Practice, Just Need Final Steps
- 1. Compute Centroid Position (average x and y)
- 2. Compute new positions
for all points - 3. For new positions, compute a, b, c.
- 4. Compute value for
- 5. Obtain value for
- 6. Plot line for the specific two numbers.