X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=samples%2Fpython%2Fpyramid_segmentation.py;fp=samples%2Fpython%2Fpyramid_segmentation.py;h=0000000000000000000000000000000000000000;hb=e4c14cdbdf2fe805e79cd96ded236f57e7b89060;hp=c75af6fe0bc83801c8fa384b7dedcabc014030f2;hpb=454138ff8a20f6edb9b65a910101403d8b520643;p=opencv diff --git a/samples/python/pyramid_segmentation.py b/samples/python/pyramid_segmentation.py deleted file mode 100755 index c75af6f..0000000 --- a/samples/python/pyramid_segmentation.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/python -import sys -from opencv.cv import * -from opencv.highgui import * -image = [None, None] -image0 = None -image1 = None -threshold1 = 255 -threshold2 = 30 -l = level = 4; -block_size = 1000; -filter = CV_GAUSSIAN_5x5; -storage = None -min_comp = CvConnectedComp() - -def set_thresh1( val ): - global threshold1 - threshold1 = val - ON_SEGMENT() - -def set_thresh2( val ): - global threshold2 - threshold2 = val - ON_SEGMENT() - -def ON_SEGMENT(): - global storage - global min_comp - comp = cvPyrSegmentation(image0, image1, storage, level, threshold1+1, threshold2+1); - cvShowImage("Segmentation", image1); - -if __name__ == "__main__": - filename = "../c/fruits.jpg"; - if len(sys.argv) == 2: - filename = sys.argv[1] - image[0] = cvLoadImage( filename, 1) - if not image[0]: - print "Error opening %s" % filename - sys.exit(-1) - - cvNamedWindow("Source", 0); - cvShowImage("Source", image[0]); - cvNamedWindow("Segmentation", 0); - storage = cvCreateMemStorage ( block_size ); - image[0].width &= -(1<