Esempio n. 1
0
    def mouseEvents(self, event, x, y, flags, param):

        if event == cv2.EVENT_LBUTTONDOWN:
            self.refPT = [(x, y)]
            # self.addToHistPixelSet(self.hsvImage, [y, x])

        if event == cv2.EVENT_LBUTTONUP:

            self.refPT.append((x, y))

            self.classImageProcess.processColorsByCoordinates(self.refPT)

            colors = self.processColors(self.clonedProcessImage, self.refPT)

            self.redrawProcessImage(colors, self.clonedProcessImage)

            hist = searchBall.createHistByImage(self.hsvImage, self.mask)

            maskededImg, finalHist = searchBall.equalsHists(hist, self.imageForSearching)

            opening = searchBall.noiseFilter(maskededImg)

            closing = searchBall.closingFilter(opening)

            binary = searchBall.imageToBinary(closing)

            contour = searchBall.searchContoursBinary(binary, self.imageForSearching)

            searchBall.getCircleByContours(self.imageForSearching, contour)

            print contour
Esempio n. 2
0
    def searchContours(self, changingImage, imageForSearching):

        binary = searchBall.imageToBinary(changingImage)

        maxContour, imageWithContours = searchBall.searchContoursBinary(binary, imageForSearching)

        print maxContour


        return maxContour, imageWithContours