def debugPreview(self, title="Debug"):
        """ Displays the region in a preview window.

        If the region is a Match, circles the target area. If the region is larger than half the
        primary screen in either dimension, scales it down to half size.
        """
        region = self
        haystack = self.getBitmap()
        if isinstance(region, Match):
            cv2.circle(
                haystack,
                (region.getTarget().x - self.x, region.getTarget().y - self.y),
                5,
                255)
        if haystack.shape[0] > (Screen(0).getBounds()[2]/2) or haystack.shape[1] > (Screen(0).getBounds()[3]/2):
            # Image is bigger than half the screen; scale it down
            haystack = cv2.resize(haystack, (0, 0), fx=0.5, fy=0.5)
        Image.fromarray(haystack).show()
def debugPreview ( self , title = "Debug" ) : region = self haystack = self . getBitmap ( ) if isinstance ( region , Match ) : cv2 . circle ( haystack , ( region . getTarget ( ) . x - self . x , region . getTarget ( ) . y - self . y ) , 5 , 255 ) if haystack . shape [ 0 ] > ( Screen ( 0 ) . getBounds ( ) [ 2 ] / 2 ) or haystack . shape [ 1 ] > ( Screen ( 0 ) . getBounds ( ) [ 3 ] / 2 ) : haystack = cv2 . resize ( haystack , ( 0 , 0 ) , fx = 0.5 , fy = 0.5 ) Image . fromarray ( haystack ) . show ( )
Displays the region in a preview window.

        If the region is a Match, circles the target area. If the region is larger than half the
        primary screen in either dimension, scales it down to half size.