What are stitching and dewarping, and how do they differ?
They solve opposite-looking problems with related mathematics. Stitching starts with several separate images and joins them into one larger picture. Dewarping starts with one distorted image, such as the circle from a fisheye lens, and straightens it. Both depend on knowing exactly how light travels through the lens to the sensor, so that every pixel can be moved to where it belongs on a flat, natural-looking view. Both also resample pixels, which can cost a little sharpness.
Which one a camera needs depends on how it reaches a wide view. Multisensor panoramic cameras stitch. Fisheye cameras dewarp. Some products do both, for example a unit that stitches several wide lenses and then flattens the result. For a buyer, the practical question is not the name but where the processing happens, how good the result looks across the whole frame, and whether the original, unprocessed image can still be recovered.
How does stitching work, step by step?
The process begins with alignment. Each sensor sees a slightly different part of the scene, with a narrow overlap shared with its neighbor. Software finds matching details in the overlap, or uses factory calibration, to work out how much each image must be shifted and rotated. Exposure and white balance are synchronized across sensors so one side of a seam does not look brighter or warmer than the other, which is easy to overlook and very visible if it goes wrong.
Next, each image is warped onto a common surface, and the overlap is blended. Warping corrects barrel distortion from each lens, so straight lines stay straight, and compensates for a tilted mounting so the horizon looks level. Blending then fades one image into the next across the overlap, so brightness and color change smoothly. Factory calibration is the main reason stitched cameras can work in real time; at the camera, the same mapping is applied to every frame.
Why do projection surfaces matter?
A wide scene cannot be flattened onto a rectangle without compromise, much like a world map. Cylindrical projection wraps the scene around a vertical cylinder: vertical lines stay vertical, which suits buildings and fences, but the top and bottom of the picture stretch. Spherical projection wraps the scene on a sphere, which suits full-circle views but bends straight lines. A flat, rectilinear projection keeps lines straight but stretches objects badly toward the edges when the field is very wide.
Manufacturers choose a projection to suit the camera's job. For a 180-degree outdoor panorama, a cylindrical surface is common, because it keeps fences and building edges upright. For a dewarped fisheye, a panorama view is also a form of cylindrical mapping, while a virtual PTZ view uses a rectilinear one, because a small region looks natural when it is flat. Understanding the projection helps you read the picture: stretched edges are a property of the mapping, not necessarily a fault.
How does dewarping a fisheye image work?
A fisheye lens follows a known mathematical relationship between the angle of incoming light and the position where it lands on the sensor. Dewarping inverts that relationship. For each pixel in the output view, software calculates which spot on the circular image it came from, then fetches that color, interpolating between neighboring pixels because the spot rarely lands exactly on one. The same lens model drives every view mode, whether the output is a panorama, a double panorama, a quad layout, or a virtual PTZ window.
Mounting orientation is part of the model. A ceiling mount, a wall mount, and a table mount each need a different mapping, or the horizon will tilt and the panorama will look wrong. A virtual PTZ view is a small region dewarped on demand, which is why you can pan and zoom smoothly with no motor. The limit is the sensor: zooming into a region cannot add pixels that the sensor never captured, and pixels near the rim of the circle are fewer and more stretched.
Where does the processing happen?
There are three places. In the camera, the device does the work and sends a ready-to-view stream, which is easy for any viewer but uses the camera's processor and may discard the original. On the recording server, the raw image is stored and the server produces views on demand, which keeps flexibility but needs computing power. In the viewing client, the browser or app does the dewarping, which is flexible and light on the server but depends on the viewing device and requires software support.
The most important question is what is stored. If the full circle, or the full set of unstitched slices, is saved, you can reprocess it later and choose views after an incident. If only a processed view is saved, you cannot. Also confirm that open standards such as ONVIF and RTSP deliver the stream in a form your platform understands, and whether the platform applies the correct mapping automatically or needs manual lens settings.
What artifacts should you check for?
For stitched cameras, look at the seams. Watch a person walk across them and check for doubling, jumps, missing slices, or visible lines. Look for brightness or color steps between sensors, especially at dusk, when lighting changes quickly. Objects close to the camera are the hardest to join because the sensors see them from slightly different positions, so test with someone close to the housing as well as far away.
For dewarped fisheye views, look at the edges: straight lines should appear straight, the horizon should be level, and faces should not look stretched. Check the sharpness at the rim and when zooming in. In both cases, ask how the camera handles low light, since processing can amplify noise. A good demonstration uses your own site or a similar scene, in the conditions you care about, at the distance where you need the detail.
Key terms
- Stitching
- Combining overlapping images from several sensors into one continuous picture by aligning and blending them.
- Dewarping
- Software correction that unwraps a distorted wide-angle or fisheye image into a natural-looking flat view.
- Projection
- The rule for mapping a curved view onto a flat image, such as cylindrical, spherical, or rectilinear.
- Overlap zone
- The strip of the scene seen by two neighboring sensors, used to align and blend images.
- Interpolation
- Estimating a pixel's value from its neighbors when a mapped position falls between original pixels.
- Virtual PTZ
- A cropped and dewarped region of a wide image that can be panned and zoomed without any motor.
On a trailer like this, the processing question matters because the link is cellular. Video is carried over a dual-SIM 4G/5G router, so sending a heavy raw wide-angle stream is costly. Edge recording on the unit keeps full-quality video locally, and cameras use ONVIF and RTSP. AI VisionStream supports a video portal with playback and a clip library, so reviewing the right moment does not need the raw stream.
Common questions
Is stitching done in the camera or in software?
Both exist. Many multisensor cameras stitch inside the device using factory calibration and send one stream. Others send separate slices and let a server or client combine them. Check which approach a camera uses before you design your recording.
Does dewarping reduce image quality?
It resamples pixels, so some softness is possible, and zoomed views are limited by the sensor's original pixels. Keeping the full circular image in storage lets you reprocess it later without further loss, and choose better views.
Why does a seam sometimes look wrong on close objects?
Each sensor views a close object from a slightly different position, called parallax, so the overlap does not match perfectly. Distant scenes join cleanly, while close subjects near a seam can look doubled or partly missing.