Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

connect two mathod to the same button in pyq5

self.trainPreproBtn.clicked.connect(self.preproClicked, self.thresClicked)

@pyqtSlot()
def preproClicked(self):
    gray = cv2.cvtColor(self.image, cv2.IMREAD_COLOR)
    self.image = cv2.cvtColor(gray,cv2.COLOR_BGR2GRAY)
    #(thresh, im_bw) = cv2.threshold(self.image, 128, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
    #resize_image = cv2.resize(im_bw, (180, 180))
    self.displayImage(2)
@pyqtSlot()
def thresClicked(self):
    gray = cv2.cvtColor(self.image, cv2.IMREAD_COLOR)
    self.image = cv2.cvtColor(gray, cv2.COLOR_BGR2GRAY)
    self.image = cv2.threshold(self.image, 128, 255, cv2.THRESH_BINARY )
    self.displayImage(4)
Comment

connect two mathod to the same button in pyq5

self.trainPreproBtn.clicked.connect(self.connectionFunction)

@pyqtSlot()
def connectionFunction(self):
    self.firstFunction()
    self.secondFunction()
Comment

connect two mathod to the same button in pyq5

self.trainPreproBtn.clicked.connect(self.preproClicked, self.thresClicked)

@pyqtSlot()
def preproClicked(self):
    gray = cv2.cvtColor(self.image, cv2.IMREAD_COLOR)
    self.image = cv2.cvtColor(gray,cv2.COLOR_BGR2GRAY)
    #(thresh, im_bw) = cv2.threshold(self.image, 128, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
    #resize_image = cv2.resize(im_bw, (180, 180))
    self.displayImage(2)
@pyqtSlot()
def thresClicked(self):
    gray = cv2.cvtColor(self.image, cv2.IMREAD_COLOR)
    self.image = cv2.cvtColor(gray, cv2.COLOR_BGR2GRAY)
    self.image = cv2.threshold(self.image, 128, 255, cv2.THRESH_BINARY )
    self.displayImage(4)
Comment

connect two mathod to the same button in pyq5

self.trainPreproBtn.clicked.connect(self.connectionFunction)

@pyqtSlot()
def connectionFunction(self):
    self.firstFunction()
    self.secondFunction()
Comment

PREVIOUS NEXT
Code Example
Python :: free function in python 
Python :: cartpole dqn reward max is 200 
Python :: ORing two cv mat objects 
Python :: git ignore everything but python files 
Python :: napalm cli 
Python :: python ask for real values until negative value diplay highest and lowest 
Python :: first hitting time python 
Python :: python how to request query string korean encode 
Python :: how to convert string labels to numpy array 
Python :: falcon 900 price 
Python :: par e impar pygame 
Python :: cbv uk django 
Python :: recursively count string 
Python :: import all models 
Python :: python turn seconds into zulu time 
Python :: discord.py get channel object from id 
Python :: fibonacci function python 
Python :: how to move a specific row to last row in python 
Python :: xlabel font size python latex 
Python :: python invalid syntax for no reason 
Python :: hypercorn initiate 
Python :: matmul shorthand numpy 
Python :: djago get settings 
Python :: return Response converting to string drf 
Python :: pandas str contains only true 
Python :: windows use py instead of python 
Python :: pairplot legend position 
Python :: give the factorials of 6 in python 
Python :: pip install time python 
Python :: Math Module atan() Function in python 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =