Skip to content
Snippets Groups Projects
Commit 0f41d98e authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Add tutorials for building an arena

Edit the tunnel of sridhar, so that we can render what the bee sees
parent 3e679df9
No related branches found
No related tags found
No related merge requests found
No preview for this file type
%% Cell type:markdown id: tags:
# Building an arena
## Check list.
1. Design of the arena (for example in blender)
2. Generating patterns
3. Setting up cameras
* Calibrating camera intrinsics
* Calibrating camera extrinsics
* Validating camera calibration
%% Cell type:markdown id: tags:
# Design the arena
%% Cell type:markdown id: tags:
# Generetting patterns
## rectangular
%% Cell type:code id: tags:
``` python
from navipy.arenatools.patterns import rectangular_pattern, gray2red, norm_img
import matplotlib.pyplot as plt
from matplotlib.image import imsave
length = 1000 # mm
width = 250 # mm
beta = 1.4
pixel_per_mm = 1
pattern = rectangular_pattern(width, length, beta, pixel_per_mm)
pattern=norm_img(pattern)
pattern=gray2red(pattern)
plt.imshow(pattern)
imsave('rectangular_pattern.png', pattern)
```
%% Output
%% Cell type:markdown id: tags:
## pattern uses and convertions
The image saved as a png image can be used in blender for example to cover the objects with pattern.
A printer shop or facility would like to have a pdf of the image to print. We, thus, need to convert the png to a pdf. To obtain the correct dimension, we need to specify to the png to pdf converter the density, i.e. the number of pixel per mm (often pixel per inch). In linux, you can use the convert command:
```bash
convert pathtoimage.png -density mydensity pathtoimage.pdf
```
here, ```pathtoimage``` has to be replaced by the path to your image to be converted, and ```mydensity``` the number of pixel per inch. In our example we used 1 pixel per mm, and thus 25.4 pixel per inch.
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment