Skip to content

Commit

Permalink
Fix typos undistort.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelgg93 authored Sep 25, 2023
1 parent a99eeb0 commit c2bfc3e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/neon/how-tos/advance-analysis/undistort.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Undistorting Neon's scene camera video and gaze data, using the in
permalink: /neon/how-tos/advance-analysis/undistort/

Check warning on line 4 in src/neon/how-tos/advance-analysis/undistort.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (undistort)
---
# Correcting for the lens distortion on Neon's scene camera
A circumstance that often arises in wearable eye tracking setups is the presence of distortions on the scene camera. The type of lenses used, with their wide-angle characteristics, allow for a broad field of view, enabling the capture of more information within a single frame. However, this advantage comes at the cost of introducing distortions to the image. <!-- rectilinear distortions -->
A circumstance that often arises in wearable eye-tracking setups is the presence of distortions on the scene camera. The type of lenses used, with their wide-angle characteristics, allows for a broad field of view, enabling the capture of more information within a single frame. However, this advantage comes at the cost of introducing distortions to the image. <!-- rectilinear distortions -->

While we account for them in Pupil Cloud, and we even give you the possibility to download the undistorted video using the [Gaze Overlay enrichment](/enrichments/gaze-overlay), this is not the case when using the [Realtime API](/neon/real-time-api) or raw data, where you may want to correct it by yourself.

Expand Down Expand Up @@ -41,13 +41,13 @@ keyboard=enabled
</div>
:::tip
**TLDR**; Correcting for lens distortions is crutial for spatial analysis and comparability across studies.
**TLDR**; Correcting for lens distortions is crucial for spatial analysis and comparability across studies.

Check warning on line 44 in src/neon/how-tos/advance-analysis/undistort.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (TLDR)
:::

## How to correct for the lens distortions?
In this tutorial, we will cover how to read the provided intrinsic and extrinsic camera parameters and correct for the lens distortions in Neon's scene camera. We will also show you how to undistort the gaze data, so that you can map the gaze position onto the undistorted scene camera video.

Check warning on line 48 in src/neon/how-tos/advance-analysis/undistort.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (undistort)

We will be using Python and OpenCV to perform the undistortion but the same principles apply to other programming languages and libraries.
We will be using Python and OpenCV to perform the undistortion, but the same principles apply to other programming languages and libraries.

## Requirements
To follow this guide, you will need to have the following libraries installed on your python environment:
Expand All @@ -69,7 +69,7 @@ def read_from_json(path):
data = json.load(f)
return data
```
Where **path** points to the **scene_camera.json** file. Then, we will store the scene camera matrix, distortion coefficients in variables for later use.
Where **path** points to the **scene_camera.json** file. Then, we will store the scene camera matrix, and distortion coefficients in variables for later use.

```python
calibration = read_from_json(path)
Expand Down Expand Up @@ -106,7 +106,7 @@ def read_instrinsics_neon(path):
)
```

Where **path** points to the calibration file, which is located in the same folder as the raw data with the name **calibration.bin**. Then, we will store the scene camera matrix, distortion coefficients in variables for later use.
Where **path** points to the calibration file, which is located in the same folder as the raw data with the name **calibration.bin**. Then, we will store the scene camera matrix, and distortion coefficients in variables for later use.

``` python
calibration = read_instrinsics_neon(path)
Expand Down Expand Up @@ -176,11 +176,11 @@ xy_undist = cv2.undistortPoints(xy.reshape(-1, 1, 2).astype(np.float32),
K, D, P=K)
xy_undist = xy_undist.reshape(-1, 2)
```
On the examplme below, we show the original gaze points overlaid ove the undistorted frame (in red) and the undistorted point positions (in yellow):
On the example below, we show the original gaze points overlaid over the undistorted frame (in red) and the undistorted point positions (in yellow):

<div class="mb-4" style="display:flex;justify-content:center;">
<v-img class="rounded" :src="require('../../../media/neon/undist/undist_neon_with_gaze.jpg')"
max-width="70%"
alt="Image showing the original frame overlaid with the undistorted frame."
title="Image showing the original frame overlaid with the undistorted frame." />
</div>
</div>

0 comments on commit c2bfc3e

Please sign in to comment.