Skip to content

Commit

Permalink
Bayer tif
Browse files Browse the repository at this point in the history
  • Loading branch information
stawel committed Oct 26, 2016
1 parent ef5b85f commit f5f6398
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion colors_hls_3d_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#file_nr = 11050
file_nr = 12000

path = './s4/'
file_nr = 10000

path = './scans/s/'
name1 = path + str(file_nr) + '.jpg'
name2 = path + str(file_nr+1) + '.jpg'

Expand Down
7 changes: 6 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from PIL import Image
import cv2
import numpy as np
import os

# Start a socket listening for connections on 0.0.0.0:8000 (0.0.0.0 means
# all interfaces)
Expand All @@ -20,6 +21,10 @@

i = 10000

path = './scans/s/'

#os.mkdir(path)

try:
while True:
k = cv2.waitKey(1) & 0xFF
Expand All @@ -42,7 +47,7 @@
image = cv2.transpose(image)
image = cv2.flip(image, 0)
cv2.imshow('image', image)
cv2.imwrite(str(i) + '.jpg',image)
cv2.imwrite(path + str(i) + '.jpg',image)
i = i + 1

height, width, channels = image.shape
Expand Down
9 changes: 5 additions & 4 deletions utils/bayer_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ def getimg(stream):
data = getimg(image_stream)
# data = np.fromstring(image_stream.getvalue(), dtype=np.uint8)
# image = cv2.imdecode(data,cv2.IMREAD_COLOR)
image=data
cv2.imshow('image', image)
cv2.imwrite(str(i) + '.jpg',image>>8)
image2=data
cv2.imshow('image', image2)
print image2.shape, image2.dtype
cv2.imwrite(str(i) + '.tif',image2)
i = i + 1

print image_len, image.shape
print image_len, image2.shape

finally:
connection.close()
Expand Down

0 comments on commit f5f6398

Please sign in to comment.