Computer Vision with Neural Networks
Measure the overlap of two seed rectangles
BOTIE
Examples, experiments and workspace controls
Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.
Try your own inputs
Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.
Context for this challenge
Add both box areas and subtract their intersection once.
Botie has a predicted rectangle and a labelled rectangle. Calculate their intersection over union using continuous boundary coordinates.
Inspect the component calculation
Subtract(
Starting value: Add(
First contribution: Measure a rectangle's area(
Rectangle boundaries: Predicted rectangle
)
Second contribution: Measure a rectangle's area(
Rectangle boundaries: Labelled rectangle
)
)
Value to remove: Measure two rectangles' intersection(
First rectangle: Predicted rectangle
Second rectangle: Labelled rectangle
)
)Examples and results
- Predicted rectangle
- 00
- 10
- 24
- 34
- Labelled rectangle
- 02
- 10
- 26
- 34
- Required result
24
- Predicted rectangle
- 00
- 10
- 22
- 32
- Labelled rectangle
- 03
- 13
- 25
- 35
- Required result
8
- Predicted rectangle
- 01
- 12
- 24
- 36
- Labelled rectangle
- 01
- 12
- 24
- 36
- Required result
12
Try a fresh construction
This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.
Stuck? Inspect a worked construction
The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.
Assumptions and test precision
All rectangles must have positive width and height. This calculation is one pairwise localisation measure, not a complete detection evaluation. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.
Two rectangles touch along an edge
This check uses the pieces from “Count the shared area once in the union”.
BOTIE
- Predicted rectangle
- 00
- 10
- 23
- 32
- Labelled rectangle
- 03
- 10
- 25
- 32
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
Which cases distinguish disjoint boxes, containment and exact agreement?
Use the declared coordinate convention; continuous box areas do not add an extra pixel to each side length.
All rectangles must have positive width and height. This calculation is one pairwise localisation measure, not a complete detection evaluation.
Work through the Python challenges →