AI Glossary / Graphs and symbolic AI / Beginner
Shape
Definition
Shape is the geometric form of an object or region, described through features such as its boundary, surface, proportions and arrangement of parts. In computer vision, shape is represented and estimated from images, depth measurements or other data to support recognition, comparison and interaction.
What it means
A system may work with a two-dimensional silhouette, the outline of a segmented image region, or a three-dimensional description of an object. These are related but different representations. The outline visible in one photograph is not a complete description of the object's three-dimensional form.
Shape is also distinct from color and texture. Two objects can have similar geometry while differing in appearance, and two similarly colored regions can have different shapes. A recognition system may combine all these cues rather than rely on one.
What counts as the “same shape” depends on the task. A catalog may treat differently sized versions as equivalent, while a parts-inspection system must preserve physical dimensions. Whether translation, rotation, scale or deformation should be ignored is therefore a modeling decision.
How it works
A vision pipeline first obtains a representation suitable for the task. It might segment an object from the background, trace a contour, collect a depth point cloud or reconstruct a surface from multiple views.
The system can then compute descriptors such as area, perimeter, aspect ratio, moments or distances between selected landmarks. Three-dimensional representations include meshes, point clouds, voxel grids and implicit functions describing a surface. Learned models can also produce features for comparing shapes.
Each representation preserves some information and loses other information. A bounding box is compact but discards most boundary detail. A silhouette omits hidden surfaces and can change substantially with viewpoint. Noisy segmentation can alter measurements before any comparison algorithm runs. Evaluation should therefore distinguish errors in image acquisition, object separation, geometric representation and the eventual decision.
Three practical examples
- A manufacturing prototype checks whether a visible component outline differs from an approved reference under controlled imaging conditions.
- An image-search tool groups product pictures using geometric similarity alongside color and text descriptions.
- A robot uses estimated object geometry and pose to consider possible grasps, while recognizing that shape alone does not reveal friction, weight or hidden obstructions.
Think of it this way
Think of identifying a cookie cutter by tracing its outline. The tracing preserves useful geometry even if the cutter changes color. Yet it does not reveal its thickness, material or the shape of an unseen handle.
The analogy illustrates both the value and limits of a two-dimensional boundary. Computer vision must additionally contend with perspective, partial visibility, shadows and imperfect separation from the background.
Worked example
A descriptor can help without uniquely identifying shape
Consider two ideal, axis-aligned rectangular regions measured in image coordinates. Region A is 20 pixels wide and 10 pixels high. Region B is 40 pixels wide and 20 pixels high. Their width-to-height ratios are both 2, while their geometric areas are 200 and 800 square pixels.
If the task compares proportions regardless of scale, the matching aspect ratios are useful. If the task checks physical part dimensions, that ratio is insufficient; the system needs calibration or another way to relate image measurements to physical units.
Now compare Region C, a 20-by-10 rectangle with a corner cut away, while its extreme width and height remain unchanged. Its bounding-box aspect ratio is also 2, despite a different outline and smaller area. A single descriptor cannot uniquely specify the shape. These calculations use ideal geometric rectangles; pixel-count area and contour-based area can differ for rasterized boundaries.
Illustrative case study
Fictional case study: Alder Vision evaluates a camera system for sorting flat components. Early tests use clean images on a uniform background, and a simple aspect-ratio rule separates the examples.
When the team introduces rotated parts and overlapping objects, the axis-aligned bounding boxes change and merged regions produce misleading shapes. The team reviews segmentation, camera placement and the choice of descriptors before adding more elaborate classification.
It also distinguishes size-sensitive inspection from scale-insensitive category recognition. The fictional lesson is that “recognises the shape” is incomplete as a requirement. A useful specification identifies the geometric representation, allowed variation and conditions under which measurements must remain meaningful. No measured accuracy or production success is claimed for this invented system.
Common misconceptions and mistakes
- A two-dimensional outline uniquely determines the three-dimensional object. Different objects and viewpoints can produce similar silhouettes.
- Shape similarity means object identity. Different objects may share geometry, and one object may look different under viewpoint changes.
- A scale-invariant descriptor verifies actual size. Invariance deliberately removes information that dimensional inspection may need.
- A better classifier fixes poor segmentation automatically. A merged or missing object region can already have corrupted the geometric evidence.
Business use
Shape-based analysis can support inspection, visual search and robotic handling when geometry is relevant to the decision. The business requirement should state whether the aim is category recognition, dimensional measurement, defect detection or interaction planning.
Test variations in orientation, distance, lighting, occlusion and background that occur in the intended environment. When physical dimensions matter, document calibration and measurement uncertainty. Combine shape with other evidence when necessary; geometry alone may not distinguish products that differ only in material, markings or internal structure.
People also ask
Is shape the same as an object's bounding box?
No. A box is a coarse enclosure and discards detailed boundaries and internal holes.
Can an AI model infer hidden geometry?
It may predict plausible geometry from learned patterns and available observations, but an inferred hidden surface is not the same as a direct measurement.
Must shape analysis use deep learning?
No. Many methods use explicit contours, moments, geometric measurements or matching algorithms. The suitable approach depends on data and task requirements.
Check your understanding
Two segmented regions have equal bounding-box aspect ratios. Does that establish that their complete shapes are identical?
Answer: No. Many different outlines share the same extreme width and height. Additional geometric information and a task-specific comparison are needed.
Related terms
- Computer vision
- Segmentation
- Image moment
- Pose
- contour
- silhouette
- shape descriptor
- point cloud
- mesh
- geometric invariance
Learn next
Read contour and shape descriptor. Draw two different outlines inside identical rectangles, then list which descriptors distinguish them. Decide which changes your task should ignore and which changes it must detect before selecting a similarity measure.
More in Graphs and symbolic AI
- Set-level - Set-level is a planning-graph heuristic that estimates the distance to a conjunctive goal by finding the earliest proposition layer where every goal literal...
- Set of support - A set of support is a selected group of clauses used to guide resolution-based theorem proving.
- Set semantics - Set semantics interprets a collection through set membership: an item is either present or absent, and repeated copies do not add meaning.
- Shaving - Shaving is a constraint-programming technique that temporarily tests a possible variable value or domain restriction, propagates its consequences and...
- Shift-reduce parsing - Shift-reduce parsing builds a grammatical analysis by moving input items onto a stack and combining items at the top of that stack into larger structures.
- Shortest Augmenting Path - Shortest Augmenting Path is a maximum-flow approach that increases flow through a network by using short source-to-sink paths in the residual network.
Sources
OpenCV official structural-analysis and shape-descriptor documentation: https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html. John Galeotti, CMU Shape teaching material: https://www.cs.cmu.edu/~galeotti/methods_course/Shape.pdf. Park and colleagues, DeepSDF, for an example of learned implicit three-dimensional representation: https://arxiv.org/abs/1901.05103. Relevant returned descriptions were reviewed; rectangle calculations and the sorting case are original illustrations.
Previous: Shannon's source coding theorem Next: Shape from defocus