def __init__(self, context):
"""
TestPlugin class to evaluate the image_recognition_msgs interfaces
:param context: QT context, aka parent
"""
super(TestPlugin, self).__init__(context)
# Widget setup
self.setObjectName('Test Plugin')
self._widget = QWidget()
context.add_widget(self._widget)
# Layout and attach to widget
layout = QVBoxLayout()
self._widget.setLayout(layout)
self._image_widget = ImageWidget(self._widget, self.image_roi_callback, clear_on_click=True)
layout.addWidget(self._image_widget)
# Input field
grid_layout = QGridLayout()
layout.addLayout(grid_layout)
self._info = QLineEdit()
self._info.setDisabled(True)
self._info.setText("Draw a rectangle on the screen to perform recognition of that ROI")
layout.addWidget(self._info)
# Bridge for opencv conversion
self.bridge = CvBridge()
# Set subscriber and service to None
self._sub = None
self._srv = None
评论列表
文章目录