import matplotlib.pyplot as plt 
from matplotlib import style
import numpy as np 

from utils import raw_to_ndarray

fig = plt.figure()
style.use('ggplot')

size = (960,1200)
# images are flipped w.r.t. x-axis
groundTruth = raw_to_ndarray("../figures/nose/croppedjaw_sim-pb-pc-pn1_fr180-gt.raw",size)
bilfilRoi = raw_to_ndarray("../figures/bilfil/croppedjaw_sim-pb-pc-pn16384_fr180_bilfil-roi.raw",size)
bilfilAdpt = raw_to_ndarray("../figures/bilfil/croppedjaw_sim-pb-pc-pn16384_fr180_bilfil-adpt.raw",size) 
bilfilAdptx5 = raw_to_ndarray("../figures/bilfil/croppedjaw_sim-pb-pc-pn16384_fr180_bilfil-adptx5.raw",size)

profile = 450

labels = [
        "Ground truth", 
        "Classical bilateral filter", 
        "Adaptive bilateral filter",
        "Amplified adpt. bil. filter"
        ]

datasets = [
        groundTruth, 
        bilfilRoi, 
        bilfilAdpt,
        bilfilAdptx5
        ]
Пример #2
0
import matplotlib.pyplot as plt
from matplotlib import style

from utils import raw_to_ndarray, save_tex

fig = plt.figure()
style.use('ggplot')

# actual image size
height = 190
width = 340
profile = 28
size = (height, width)

gt = raw_to_ndarray("../figures/nose/croppedjaw_sim-pb-pc-pn_fr180_gt_ww13_wl017_crpx0-860y420-350.raw", size)
guide = raw_to_ndarray("../figures/nose/croppedjaw_sim-pb-pc-pn16384_fr180_guideimg_ww13_wl017_crpx0-860y420-350.raw",size)
raw = raw_to_ndarray("../figures/nose/croppedjaw_sim-pb-pc-pn16384_fr180_rawimg_ww13_wl017_crpx0-860y420-350.raw",size)

plt.plot(gt[profile, :], label="ground truth")
plt.plot(raw[profile, :], label="raw image")
plt.plot(guide[profile, :], label="guide image")

plt.xlabel("Pixel position")
plt.ylabel("Intensity")
plt.grid(True)
plt.legend(loc="lower left")

#plt.show()

save_tex(
        __file__,
import matplotlib.pyplot as plt 
from matplotlib import style
import numpy as np 

from utils import raw_to_ndarray

fig = plt.figure()
style.use('ggplot')

size = (1000,1118)
datasets = {}
# images are flipped w.r.t. x-axis
datasets["Ground truth"] = 10.0*raw_to_ndarray("../figures/bilfil/contrast_max255_groundtruth.raw",size)
datasets["Noisy image"] = raw_to_ndarray("../figures/bilfil/contrast_max2550_poisson.raw",size)
datasets["Conventional bil. filter"] = raw_to_ndarray("../figures/bilfil/contrast_max2550_poisson_roi512-0-90-150.raw",size)
datasets["Adaptive bil. filter"] = raw_to_ndarray("../figures/bilfil/contrast_max2550_poisson_adpt1-0.raw",size)

profile = 720

for label, dataset in datasets.iteritems():
    plt.plot(dataset[profile,355:655], label=label)

plt.legend()
plt.grid(True)

plt.show()

#from utils import save_tex
#save_tex(__file__)