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

Add the doc

parent 0bf8d72a
No related branches found
No related tags found
No related merge requests found
Showing
with 180 additions and 0 deletions
import numpy as np
import matplotlib.pyplot as plt
from database import DataBaseLoad
import os
# 1) Connect to the database
mydb_filename = os.path.abspath('../database.db')
mydb = DataBaseLoad(mydb_filename)
# 2) Define the position-orinetation at which
# we want the image
rowid = 1000
# 3) Load the image
image = mydb.read_image(rowid=rowid)
# 4) plot the image
to_plot_im = image[:, :, :3]
to_plot_im -= to_plot_im.min()
to_plot_im /= to_plot_im.max()
to_plot_im = to_plot_im * 255
to_plot_im = to_plot_im.astype(np.uint8)
to_plot_dist = image[:, :, 3]
plt.subplot(1, 2, 1)
plt.imshow(to_plot_im)
plt.gca().invert_yaxis()
plt.subplot(1, 2, 2)
plt.imshow(to_plot_dist)
plt.gca().invert_yaxis()
plt.show()
doc/build/html/example/processing/apcv.hires.png

277 KiB

File added
doc/build/html/example/processing/apcv.png

200 KiB

import matplotlib.pyplot as plt
from database import DataBaseLoad
import processing
import os
import numpy as np
# 1) Connect to the database
mydb_filename = os.path.abspath('../database.db')
mydb = DataBaseLoad(mydb_filename)
# 2) Define the position-orinetation at which
# we want the image
rowid = 5000
my_scene = processing.scene(mydb, rowid=rowid)
my_apcv = processing.apcv(my_scene, mydb.viewing_directions)
my_apcv_sph = processing.tools.cartesian_to_spherical(x=my_apcv[..., 0],
y=my_apcv[..., 1],
z=my_apcv[..., 2])
elevation = mydb.viewing_directions[...,
processing.constants.__spherical_indeces__[
'elevation']]
azimuth = mydb.viewing_directions[...,
processing.constants.__spherical_indeces__[
'azimuth']]
f, axarr = plt.subplots(1, 2, figsize=(15, 4))
to_plot_im = my_scene[:, :, :3, 0]
to_plot_im -= to_plot_im.min()
to_plot_im /= to_plot_im.max()
to_plot_im = to_plot_im * 255
to_plot_im = to_plot_im.astype(np.uint8)
to_plot_dist = my_scene[:, :, 3, 0]
ax = axarr[0]
for chan_i, chan_n in enumerate(['R', 'G', 'B']):
color = chan_n
ax.plot(np.rad2deg(my_apcv_sph[..., chan_i, 1]),
np.rad2deg(my_apcv_sph[..., chan_i, 0]), 'o', color=color)
ax.imshow(to_plot_im, extent=[np.min(azimuth), np.max(azimuth),
np.max(elevation), np.min(elevation)])
ax.invert_yaxis()
ax = axarr[1]
color = 'k'
ax.plot(np.rad2deg(my_apcv_sph[..., 3, 1]),
np.rad2deg(my_apcv_sph[..., 3, 0]), 'o', color=color)
ax.imshow(to_plot_dist, extent=[np.min(azimuth), np.max(azimuth),
np.max(elevation), np.min(elevation)])
ax.invert_yaxis()
f.show()
doc/build/html/example/processing/contrast_weighted_nearness.hires.png

497 KiB

File added
doc/build/html/example/processing/contrast_weighted_nearness.png

335 KiB

This diff is collapsed.
doc/build/html/example/processing/michelson_contrast.hires.png

527 KiB

File added
doc/build/html/example/processing/michelson_contrast.png

362 KiB

This diff is collapsed.
This diff is collapsed.
doc/build/html/example/processing/scene.hires.png

277 KiB

File added
doc/build/html/example/processing/scene.png

200 KiB

This diff is collapsed.
doc/build/html/example/processing/skyline.hires.png

133 KiB

File added
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