Преглед изворни кода

Rectify meteor night passes

tags/1.5
Nico Rey пре 4 година
родитељ
комит
6f72416a02
1 измењених фајлова са 20 додато и 10 уклоњено
  1. +20
    -10
      rectify.py

+ 20
- 10
rectify.py Прегледај датотеку

@@ -73,11 +73,16 @@ def wthread(rectified_width, corr, endrow, startrow):

# Linearly interpolate
for i in range(delta):
interp_r = int((start_px[0]*(delta-i) + end_px[0]*i) / delta)
interp_g = int((start_px[1]*(delta-i) + end_px[1]*i) / delta)
interp_b = int((start_px[2]*(delta-i) + end_px[2]*i) / delta)

rectified_pixels[cur_col, row] = (interp_r, interp_g, interp_b)
# For night passes of Meteor the image is just gray level and
# start_px and end_px being an int instead of a tuple
if type(start_px) != int:
interp_r = int((start_px[0]*(delta-i) + end_px[0]*i) / delta)
interp_g = int((start_px[1]*(delta-i) + end_px[1]*i) / delta)
interp_b = int((start_px[2]*(delta-i) + end_px[2]*i) / delta)
rectified_pixels[cur_col,row] = (interp_r, interp_g, interp_b)
else:
interp = int((start_px*(delta-i) + end_px*i) / delta)
rectified_pixels[cur_col,row] = interp
cur_col += 1

start_px = end_px
@@ -94,11 +99,16 @@ def wthread(rectified_width, corr, endrow, startrow):

# Linearly interpolate
for i in range(delta):
interp_r = int((start_px[0]*(delta-i) + end_px[0]*i) / delta)
interp_g = int((start_px[1]*(delta-i) + end_px[1]*i) / delta)
interp_b = int((start_px[2]*(delta-i) + end_px[2]*i) / delta)

rectified_pixels[cur_col, row] = (interp_r, interp_g, interp_b)
# For night passes of Meteor the image is just gray level and
# start_px and end_px being an int instead of a tuple
if type(start_px) != int:
interp_r = int((start_px[0]*(delta-i) + end_px[0]*i) / delta)
interp_g = int((start_px[1]*(delta-i) + end_px[1]*i) / delta)
interp_b = int((start_px[2]*(delta-i) + end_px[2]*i) / delta)
rectified_pixels[cur_col,row] = (interp_r, interp_g, interp_b)
else:
interp = int((start_px*(delta-i) + end_px*i) / delta)
rectified_pixels[cur_col,row] = interp
cur_col -= 1

start_px = end_px


Loading…
Откажи
Сачувај