Bird
Raised Fist0
Computer Visionml~20 mins

Bounding box representation in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Bounding Box Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding bounding box formats
Which of the following bounding box representations uses the coordinates of the top-left corner and the width and height of the box?
AXYWH format
BXYXY format
CCenter coordinates with width and height
DNormalized coordinates between 0 and 1
Attempts:
2 left
💡 Hint
Think about which format explicitly mentions width and height.
❓ Predict Output
intermediate
2:00remaining
Output of bounding box conversion code
What is the output of this Python code converting a bounding box from XYWH to XYXY format? box_xywh = [50, 30, 100, 200] box_xyxy = [box_xywh[0], box_xywh[1], box_xywh[0] + box_xywh[2], box_xywh[1] + box_xywh[3]] print(box_xyxy)
Computer Vision
box_xywh = [50, 30, 100, 200]
box_xyxy = [box_xywh[0], box_xywh[1], box_xywh[0] + box_xywh[2], box_xywh[1] + box_xywh[3]]
print(box_xyxy)
A[0, 0, 150, 230]
B[50, 30, 100, 200]
C[50, 30, 150, 230]
D[50, 30, 50, 30]
Attempts:
2 left
💡 Hint
Add width to x and height to y to get bottom-right corner.
❓ Model Choice
advanced
2:00remaining
Choosing bounding box format for object detection model
You are designing an object detection model that predicts bounding boxes. Which bounding box representation is most suitable for regression output in a neural network?
ATop-left and bottom-right corners (x1, y1, x2, y2)
BCenter coordinates with width and height (cx, cy, w, h)
CPolygon points around the object
DBinary mask of the object
Attempts:
2 left
💡 Hint
Think about what is easier for a network to predict smoothly.
❓ Metrics
advanced
2:00remaining
Evaluating bounding box predictions with IoU
What does an Intersection over Union (IoU) score of 0.75 between a predicted bounding box and the ground truth indicate?
AThe predicted box overlaps 75% with the ground truth box
BThe predicted box is 75% larger than the ground truth box
CThe predicted box is 75% smaller than the ground truth box
DThe predicted box and ground truth box do not overlap
Attempts:
2 left
💡 Hint
IoU measures overlap area divided by union area.
🔧 Debug
expert
2:00remaining
Debugging bounding box normalization error
Given an image of size 200x100 pixels and a bounding box [50, 20, 150, 80] in XYXY format, a developer tries to normalize the box coordinates by dividing by image width and height as follows: normalized_box = [50/100, 20/200, 150/100, 80/200] What is the main issue with this normalization approach?
AThe box coordinates are not in XYXY format
BThe box coordinates exceed image dimensions
CThe width and height are swapped in division
DThe normalization should use width for x-coordinates and height for y-coordinates
Attempts:
2 left
💡 Hint
Check which coordinates correspond to width and height axes.

Practice

(1/5)
1. What does a bounding box represent in computer vision?
easy
A. The location of an object in an image using four numbers
B. The color of an object in an image
C. The texture pattern of an object
D. The size of the entire image

Solution

  1. Step 1: Understand bounding box purpose

    A bounding box is used to locate objects visually in an image.
  2. Step 2: Identify bounding box representation

    It uses four numbers to mark the top-left and bottom-right corners of the object.
  3. Final Answer:

    The location of an object in an image using four numbers -> Option A
  4. Quick Check:

    Bounding box = object location [OK]
Hint: Bounding box = 4 numbers marking object edges [OK]
Common Mistakes:
  • Confusing bounding box with color or texture
  • Thinking bounding box covers the whole image
  • Believing bounding box uses only two numbers
2. Which of the following is the correct order of values in a bounding box representation?
easy
A. (bottom-left x, bottom-left y, top-right x, top-right y)
B. (center x, center y, width, height)
C. (width, height, top-left x, top-left y)
D. (top-left x, top-left y, bottom-right x, bottom-right y)

Solution

  1. Step 1: Recall bounding box corner points

    The bounding box is defined by the top-left and bottom-right corners.
  2. Step 2: Match the correct order

    The order is (top-left x, top-left y, bottom-right x, bottom-right y).
  3. Final Answer:

    (top-left x, top-left y, bottom-right x, bottom-right y) -> Option D
  4. Quick Check:

    Bounding box corners = top-left and bottom-right [OK]
Hint: Bounding box uses top-left then bottom-right coordinates [OK]
Common Mistakes:
  • Mixing center coordinates with corner points
  • Swapping bottom-left with top-left
  • Using width and height before coordinates
3. Given a bounding box with coordinates (10, 20, 50, 80), what is the width and height of the box?
medium
A. Width = 40, Height = 60
B. Width = 60, Height = 40
C. Width = 50, Height = 80
D. Width = 30, Height = 50

Solution

  1. Step 1: Calculate width from x-coordinates

    Width = bottom-right x - top-left x = 50 - 10 = 40.
  2. Step 2: Calculate height from y-coordinates

    Height = bottom-right y - top-left y = 80 - 20 = 60.
  3. Final Answer:

    Width = 40, Height = 60 -> Option A
  4. Quick Check:

    Width = 50-10, Height = 80-20 [OK]
Hint: Width = x2 - x1, Height = y2 - y1 [OK]
Common Mistakes:
  • Swapping width and height values
  • Adding coordinates instead of subtracting
  • Using top-left y for width calculation
4. Identify the error in this bounding box definition: bbox = (x1=30, y1=40, x2=20, y2=70)
medium
A. y2 should be less than y1
B. x2 is less than x1, which is invalid for bounding boxes
C. Coordinates must be strings, not integers
D. Bounding box must have five values, not four

Solution

  1. Step 1: Check coordinate order validity

    Bounding box requires bottom-right x (x2) to be greater than top-left x (x1).
  2. Step 2: Identify the error

    Here, x2=20 is less than x1=30, which is invalid and would cause errors in drawing or calculations.
  3. Final Answer:

    x2 is less than x1, which is invalid for bounding boxes -> Option B
  4. Quick Check:

    x2 must be > x1 for valid box [OK]
Hint: Bottom-right x must be greater than top-left x [OK]
Common Mistakes:
  • Ignoring coordinate order rules
  • Thinking y2 must be less than y1
  • Assuming bounding box needs 5 values
5. You have bounding boxes in the format (center_x, center_y, width, height). How do you convert them to (top-left x, top-left y, bottom-right x, bottom-right y)?
hard
A. top-left x = center_x; top-left y = center_y; bottom-right x = width; bottom-right y = height
B. top-left x = center_x + width/2; top-left y = center_y + height/2; bottom-right x = center_x - width/2; bottom-right y = center_y - height/2
C. top-left x = center_x - width/2; top-left y = center_y - height/2; bottom-right x = center_x + width/2; bottom-right y = center_y + height/2
D. top-left x = width/2; top-left y = height/2; bottom-right x = center_x; bottom-right y = center_y

Solution

  1. Step 1: Understand center to corner conversion

    Center coordinates are in the middle of the box; to get corners, subtract half width/height for top-left.
  2. Step 2: Calculate corners from center and size

    Top-left x = center_x - width/2; top-left y = center_y - height/2; bottom-right x = center_x + width/2; bottom-right y = center_y + height/2.
  3. Final Answer:

    top-left x = center_x - width/2; top-left y = center_y - height/2; bottom-right x = center_x + width/2; bottom-right y = center_y + height/2 -> Option C
  4. Quick Check:

    Center ± half size = corners [OK]
Hint: Corners = center ± half width/height [OK]
Common Mistakes:
  • Adding half width to top-left instead of subtracting
  • Swapping top-left and bottom-right calculations
  • Using width and height as coordinates directly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard