top of page
Inaugurated by IN-SPACe
ISRO Registered Space Tutor

S6-SA2-0533

What is the Use of Trigonometry in Computer Vision for Feature Extraction?

Grade Level:

Class 10

AI/ML, Physics, Biotechnology, Space Technology, Chemistry, Engineering, Medicine

Definition
What is it?

Trigonometry helps computers 'see' and understand images by extracting important details, called 'features.' It uses angles and distances to find shapes, edges, and patterns, which are like clues for the computer to identify objects, similar to how we use clues to solve a puzzle.

Simple Example
Quick Example

Imagine your phone needs to unlock using your face. It doesn't just see a blurred image. Instead, it uses trigonometry to measure the angles between your eyes, nose, and mouth, and the distances between them. These measurements are the 'features' that make your face unique, helping the phone recognize you.

Worked Example
Step-by-Step

Let's say a computer vision system needs to find a straight line in an image. We can use trigonometry to define and locate it.

1. **Identify two points on the line:** Let's say the line goes through Point A (0,0) and Point B (3,4) on an image grid.
2. **Form a right-angled triangle:** Imagine a right-angled triangle with the line segment AB as its hypotenuse. The horizontal side would be 3 units (change in x) and the vertical side would be 4 units (change in y).
3. **Calculate the length of the line (hypotenuse):** Using Pythagoras theorem (which is closely related to trigonometry), Length = sqrt(3^2 + 4^2) = sqrt(9 + 16) = sqrt(25) = 5 units.
4. **Calculate the angle of the line:** We can find the angle (theta) the line makes with the horizontal axis using tan(theta) = Opposite/Adjacent. Here, tan(theta) = 4/3.
5. **Find the angle:** theta = arctan(4/3). Using a calculator, arctan(1.33) is approximately 53.13 degrees.
6. **Feature extracted:** The computer has now extracted two key features for this line: its length (5 units) and its orientation (53.13 degrees). These features help distinguish this line from others.

Answer: The line's length is 5 units and its angle with the horizontal is approximately 53.13 degrees.

Why It Matters

Trigonometry is super important in AI and Computer Vision, helping self-driving cars 'see' roads and obstacles, and medical imaging systems detect diseases. Learning this opens doors to exciting careers in robotics, game development, and even space technology at places like ISRO.

Common Mistakes

MISTAKE: Confusing sine, cosine, and tangent and using them interchangeably. | CORRECTION: Remember SOH CAH TOA: Sine = Opposite/Hypotenuse, Cosine = Adjacent/Hypotenuse, Tangent = Opposite/Adjacent. Always identify the opposite, adjacent, and hypotenuse relative to the angle you are working with.

MISTAKE: Not understanding that angles are crucial for orientation. | CORRECTION: Realize that an object's angle (orientation) is as important as its size in computer vision. A tilted square is still a square, and trigonometry helps identify it regardless of its tilt.

MISTAKE: Thinking trigonometry is only for triangles. | CORRECTION: Understand that complex shapes in images can be broken down into many small triangles, or their features (like edges and corners) can be described using angles and distances derived from trigonometry.

Practice Questions
Try It Yourself

QUESTION: A security camera sees a door that is 2 meters wide. If the camera is 3 meters away from the center of the door, what is the angle of view (theta) needed for the camera to see the entire width of the door? (Hint: form a right triangle from the camera to half the door's width). | ANSWER: tan(theta/2) = (1 meter) / (3 meters) = 1/3. theta/2 = arctan(1/3) approx 18.43 degrees. So, theta = 2 * 18.43 = 36.86 degrees.

QUESTION: An object in an image has two points: P1 (1, 2) and P2 (5, 5). Calculate the length of the line segment connecting P1 and P2, and the angle it makes with the horizontal axis. | ANSWER: Change in x = 5-1 = 4. Change in y = 5-2 = 3. Length = sqrt(4^2 + 3^2) = sqrt(16+9) = sqrt(25) = 5 units. Angle = arctan(3/4) = arctan(0.75) approx 36.87 degrees.

QUESTION: A robot needs to identify a square block. Its camera sees one corner at (2,2) and an adjacent corner at (2,7). What is the length of this side? If the robot needs to turn to face the next corner, what angle should it turn if the third corner is at (7,7)? | ANSWER: Length of first side = |7-2| = 5 units. The first side is vertical. The second side from (2,7) to (7,7) is horizontal. The angle between a vertical and horizontal line is 90 degrees. So, the robot needs to turn 90 degrees.

MCQ
Quick Quiz

Which trigonometric function is most directly used to find the orientation (angle) of an edge in an image?

Sine

Cosine

Tangent

Hypotenuse

The Correct Answer Is:

C

Tangent (Opposite/Adjacent) directly relates the vertical and horizontal components of a line segment, which are crucial for determining its angle or orientation. Sine and Cosine involve the hypotenuse, and hypotenuse is a side, not a function.

Real World Connection
In the Real World

Think about how Google Lens or Paytm's QR scanner works. When you point your phone at a QR code, the app uses trigonometry to find the square patterns and their exact angles, even if the code is tilted. This helps it quickly read the information, whether it's for paying a chai-wala or scanning text from a book.

Key Vocabulary
Key Terms

Feature Extraction: The process of finding important information or patterns in data, like edges or shapes in an image. | Computer Vision: A field of AI that enables computers to 'see' and understand images and videos. | Orientation: The angle or position of an object relative to a reference point. | Hypotenuse: The longest side of a right-angled triangle, opposite the right angle. | Tangent: A trigonometric ratio of the length of the opposite side to the length of the adjacent side in a right-angled triangle.

What's Next
What to Learn Next

Next, explore 'Coordinate Geometry' to understand how points and lines are represented in a computer's 'view.' This will further strengthen your understanding of how trigonometry helps computers make sense of the visual world around us!

bottom of page