def METHOD_NAME(self):
    self.image_show_lock.acquire()
    image_to_be_shown_updated = self.image_to_be_shown_updated
    image_to_be_shown = self.image_to_be_shown
    self.image_show_lock.release()
    image = image_to_be_shown
    payload = {'image': '', 'shape': ''}
    if not image_to_be_shown_updated:
        return payload
    shape = image.shape
    frame = cv2.imencode('.JPEG', image)[1]
    encoded_image = base64.b64encode(frame)
    payload['image'] = encoded_image.decode('utf-8')
    payload['shape'] = shape
    self.image_show_lock.acquire()
    self.image_to_be_shown_updated = False
    self.image_show_lock.release()
    return payload