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
 def filterImage(self, image):
     withoutNoiseImage = searchBall.noiseFilter(image)
     closedImage = searchBall.closingFilter(withoutNoiseImage)
     return closedImage