# Unwarp an Image

An **EWorldShape** object manages a field-of-view calibration context. Such an object is able to represent the relationship between world coordinates (physical units) and sensor coordinates (pixels), and account for the distortions inherent in the image formation process.

Image calibration is an important process in quantitative measurement applications. It establishes the relation between the location of points in an image (pixel indices) and the actual positions of those points in the real world, on the inspected item.

Calibration can be setup by providing explicit calibration parameters of the calibration model, or a set of known points (landmarks), or a calibration target.

The goal of calibration is twofold:

* To gain independence with respect to the viewing conditions (part placement in the field of view, lens magnification, sensor resolution, …), letting you describe the inspected item once for all using absolute measurements.

![image](assets/images/easygauge/singlemodelvsmultipleviewingconditions.webp)
* To correct some distortion related to the imaging process (perspective effect, optical aberrations, …).

![image](assets/images/easygauge/removalofimagedistortion.webp)

The pixel indices in an image are usually integer numbers, but fractional values can occur when using sub-pixel methods. They are normally obtained by processing an image and locating known feature points. These values are called sensor coordinates.

![image](assets/images/easygauge/featurepointinsensorspace.webp)

The world coordinates describe the location of points on the inspected item are expressed in an appropriate length measurement unit.<br />
\\\\
The world coordinates are actual dimensions, usually gathered from design drawings or by mechanical measurements.<br />
\\\\
They require a reference frame to be defined.

![image](assets/images/easygauge/referenceframeinworldspace.webp)

## Unwarp

Unwarping an image is the application of the image calibration model to create a rectified, distortion-free image.

* To unwarp an image, use the method [`EWorldShape::Unwarp`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a56a976179b0ca99d71c8aa31d5a0d187) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a6e2c19c5f563c2905337e1481b836062) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#aa2ba9fdc96f4c5568a44e2ac8ba3b627).
* If the calibration model is fixed, it is possible to speed up the unwarping process by first computing a Look-Up-Table with [`EWorldShape::SetupUnwarp`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a968f7744d235e98a2d8d6c6ade361b7a) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a613912a689ef2b8d444a983263adba9b) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a8a15c1a54ad2a4612a0a0ec1be2c263e).

![](assets/images/easygauge/distortedimage.webp)![](assets/images/easygauge/unwarpedimage.webp)
