From 0095fb1ca646d577b2ff9c3fd1d67ccabc942df4 Mon Sep 17 00:00:00 2001 From: Josef Brandt Date: Thu, 7 Nov 2019 08:40:00 +0100 Subject: [PATCH] Hotfix for halving image resolution in WITec Interface --- ramancom/WITecCOM.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ramancom/WITecCOM.py b/ramancom/WITecCOM.py index 2eca5ec..327fae7 100644 --- a/ramancom/WITecCOM.py +++ b/ramancom/WITecCOM.py @@ -21,6 +21,7 @@ If not, see . import os import sys +import cv2 try: import pythoncom import win32com.client @@ -31,6 +32,7 @@ from time import sleep, time try: #when running the witectesting, the paths have to be differently, as it is in the same directory as the other raman com modules from .ramanbase import RamanBase from .configRaman import RamanSettingParam + from ..helperfunctions import cv2imread_fix, cv2imwrite_fix except: from ramanbase import RamanBase from configRaman import RamanSettingParam @@ -274,6 +276,9 @@ class WITecCOM(RamanBase): self.ImageNameMan.SetValue(fname) self.ImageSaveMan.OperateTrigger() sleep(.1) + img = cv2imread_fix(fname) + img = cv2.resize(img, None, fx=0.5, fy=0.5) + cv2imwrite_fix(fname, img) def getImageDimensions(self, mode = 'df'): """ Get the image width and height in um and the orientation angle in degrees. -- GitLab