1

I developing QGIS module and I have a question, how to capture QgsMapCanvas window with OpenCV for shoving in different frame or different application?

Part of the code:

class MainWindow( QtWidgets.QMainWindow, Ui_MainWindow ):
    def __init__( self ):
        QtWidgets.QMainWindow.__init__( self )
        self.setupUi( self )

        self.setWindowTitle( "QGIS Demo" )

        # Create map ()
        self.canvas = QgsMapCanvas()
        self.canvas.setCanvasColor( QtGui.QColor( 200, 200, 255 ) )
        self.canvas.enableAntiAliasing( True )
        self.canvas.show()
menes
  • 1,421
  • 2
  • 7
  • 24
  • 1
    What does this code do in relation to the question? – nmtoken Nov 06 '19 at 17:29
  • This part of code response for showing map window – Spatialghost Nov 06 '19 at 17:40
  • Can you add what OpenCV needs in the input? We may know how QGIS works, so we can't help you more about OpenCV. Does a picture work? https://qgis.org/api/classQgsMapCanvas.html#a70bdf0387ea56e87d643b6a36c1e8610 because you have your QgsMapCanvas. – etrimaille Nov 06 '19 at 18:11
  • OpenCV will have data from map view window, in my case raster data for interactive processing and show processed picture in other frame. As pattern i use https://gis.stackexchange.com/questions/141516/adding-legend-to-canvas-in-standalone-pyqgis-application – Spatialghost Nov 06 '19 at 18:47

0 Answers0