Loading jp4.py +8 −4 Original line number Diff line number Diff line __copyright__ = "Copyright 2018, Elphel, Inc." __license__ = "GPL-3.0+" __maintainer__ = "Oleg Dzhimiev" __email__ = "oleg@elphel.com" ''' SPDX-License-Identifier: GPL-3.0-or-later Copyright (c) 2020, Elphel, Inc. Author: Oleg Dzhimiev <oleg@elphel.com> Description: Class for converting JP4 raw images to JPEG for previewing ''' import numpy as np #import imageio Loading jp4_batch_convert.py +15 −5 Original line number Diff line number Diff line #!/usr/bin/env python3 ''' SPDX-License-Identifier: GPL-3.0-or-later Copyright (c) 2020, Elphel, Inc. Author: Oleg Dzhimiev <oleg@elphel.com> Description: Converts jp4 images to jpeg for preview Scans all images in src-dir and puts results to dst-dir ''' from jp4_composite import JP4_C #import cv2 import numpy as np Loading Loading @@ -30,10 +39,11 @@ for f in lst: #print(img.exif.data['Model']) img.deblock() img.demosaic_bilinear() img.saturation() img_arr = img.saturation() im = Image.fromarray(img_arr.astype(np.uint8)) im.save(os.path.join(dst,img.basename+"_"+str(img.subnames)+".jpeg")) subs = img.extract_subframes() for i in range(len(subs)): #subs = img.extract_subframes() #for i in range(len(subs)): #subs[i].save(os.path.join("../res",img.basename+"_"+str(img.subnames[i])+".png")) subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg")) # subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg")) jp4_batch_convert_singles.py→jp4_batch_convert_eyesis4pi.py +15 −7 Original line number Diff line number Diff line #!/usr/bin/env python3 ''' SPDX-License-Identifier: GPL-3.0-or-later Copyright (c) 2020, Elphel, Inc. Author: Oleg Dzhimiev <oleg@elphel.com> Description: Converts composite jp4 images from Eyesis4Pi-like camera or camera with mux. A "composite" image consists of 2-3 images stacked vertically. Scans all images in src-dir and puts results to dst-dir. ''' from jp4_composite import JP4_C #import cv2 import numpy as np Loading Loading @@ -30,12 +41,9 @@ for f in lst: #print(img.exif.data['Model']) img.deblock() img.demosaic_bilinear() img_arr = img.saturation() im = Image.fromarray(img_arr.astype(np.uint8)) im.save(os.path.join(dst,img.basename+"_"+str(img.subnames)+".jpeg")) img.saturation() #subs = img.extract_subframes() #for i in range(len(subs)): subs = img.extract_subframes() for i in range(len(subs)): #subs[i].save(os.path.join("../res",img.basename+"_"+str(img.subnames[i])+".png")) # subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg")) subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg")) jp4_composite.py +12 −0 Original line number Diff line number Diff line ''' SPDX-License-Identifier: GPL-3.0-or-later Copyright (c) 2020, Elphel, Inc. Author: Oleg Dzhimiev <oleg@elphel.com> Description: Class for converting composite JP4 raw images to JPEG for previewing. Composite images consist of 2-3 single ones stacked vertically - for example in Eyesis4Pi panoramic camera. The methods here are specifically for Eyesis4Pi - channels are hardcoded. ''' import re import os Loading Loading
jp4.py +8 −4 Original line number Diff line number Diff line __copyright__ = "Copyright 2018, Elphel, Inc." __license__ = "GPL-3.0+" __maintainer__ = "Oleg Dzhimiev" __email__ = "oleg@elphel.com" ''' SPDX-License-Identifier: GPL-3.0-or-later Copyright (c) 2020, Elphel, Inc. Author: Oleg Dzhimiev <oleg@elphel.com> Description: Class for converting JP4 raw images to JPEG for previewing ''' import numpy as np #import imageio Loading
jp4_batch_convert.py +15 −5 Original line number Diff line number Diff line #!/usr/bin/env python3 ''' SPDX-License-Identifier: GPL-3.0-or-later Copyright (c) 2020, Elphel, Inc. Author: Oleg Dzhimiev <oleg@elphel.com> Description: Converts jp4 images to jpeg for preview Scans all images in src-dir and puts results to dst-dir ''' from jp4_composite import JP4_C #import cv2 import numpy as np Loading Loading @@ -30,10 +39,11 @@ for f in lst: #print(img.exif.data['Model']) img.deblock() img.demosaic_bilinear() img.saturation() img_arr = img.saturation() im = Image.fromarray(img_arr.astype(np.uint8)) im.save(os.path.join(dst,img.basename+"_"+str(img.subnames)+".jpeg")) subs = img.extract_subframes() for i in range(len(subs)): #subs = img.extract_subframes() #for i in range(len(subs)): #subs[i].save(os.path.join("../res",img.basename+"_"+str(img.subnames[i])+".png")) subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg")) # subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg"))
jp4_batch_convert_singles.py→jp4_batch_convert_eyesis4pi.py +15 −7 Original line number Diff line number Diff line #!/usr/bin/env python3 ''' SPDX-License-Identifier: GPL-3.0-or-later Copyright (c) 2020, Elphel, Inc. Author: Oleg Dzhimiev <oleg@elphel.com> Description: Converts composite jp4 images from Eyesis4Pi-like camera or camera with mux. A "composite" image consists of 2-3 images stacked vertically. Scans all images in src-dir and puts results to dst-dir. ''' from jp4_composite import JP4_C #import cv2 import numpy as np Loading Loading @@ -30,12 +41,9 @@ for f in lst: #print(img.exif.data['Model']) img.deblock() img.demosaic_bilinear() img_arr = img.saturation() im = Image.fromarray(img_arr.astype(np.uint8)) im.save(os.path.join(dst,img.basename+"_"+str(img.subnames)+".jpeg")) img.saturation() #subs = img.extract_subframes() #for i in range(len(subs)): subs = img.extract_subframes() for i in range(len(subs)): #subs[i].save(os.path.join("../res",img.basename+"_"+str(img.subnames[i])+".png")) # subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg")) subs[i].save(os.path.join(dst,img.basename+"_"+str(img.subnames[i])+".jpeg"))
jp4_composite.py +12 −0 Original line number Diff line number Diff line ''' SPDX-License-Identifier: GPL-3.0-or-later Copyright (c) 2020, Elphel, Inc. Author: Oleg Dzhimiev <oleg@elphel.com> Description: Class for converting composite JP4 raw images to JPEG for previewing. Composite images consist of 2-3 single ones stacked vertically - for example in Eyesis4Pi panoramic camera. The methods here are specifically for Eyesis4Pi - channels are hardcoded. ''' import re import os Loading