""" I = Image.open('../../../data/a.jpg') I=numpy.array(I)/255. pylab.figure() pylab.imshow(I) print 'quickshift_0' ratio = 0.5 kernelsize = 2 maxdist = 10 seg=vlfeat.vl_quickseg(I,ratio,kernelsize,maxdist) pylab.figure() pylab.imshow(seg[0]) print 'quickshift_1' kernelsize = 2 maxdist = 20 seg=vlfeat.vl_quickseg(I,ratio,kernelsize,maxdist) pylab.figure() pylab.imshow(seg[0]) print 'quickshift_2' maxdist = 50 ndists = 10 seg=vlfeat.vl_quickvis(I,ratio,kernelsize,maxdist,ndists) pylab.figure() pylab.gray() pylab.imshow(seg[0]) #pylab.show()
import vlfeat as vl import cv2 import numpy as np ''' vl_quickvis(I, ratio, kernelsize, maxdist, maxcuts=None) Create an edge image from a Quickshift segmentation. IEDGE = VL_QUICKVIS(I, RATIO, KERNELSIZE, MAXDIST, MAXCUTS) creates an edge stability image from a Quickshift segmentation. RATIO controls the tradeoff between color consistency and spatial consistency (See VL_QUICKSEG) and KERNELSIZE controls the bandwidth of the density estimator (See VL_QUICKSEG, VL_QUICKSHIFT). MAXDIST is the maximum distance between neighbors which increase the density. ''' I = cv2.imread('/lena.png') ratio = .5 kernelsize = 10 maxdist = 10.0 vl.vl_quickvis(I, ratio, kernelsize, maxdist)
import vlfeat as vl import cv2 import numpy as np ''' vl_quickvis(I, ratio, kernelsize, maxdist, maxcuts=None) Create an edge image from a Quickshift segmentation. IEDGE = VL_QUICKVIS(I, RATIO, KERNELSIZE, MAXDIST, MAXCUTS) creates an edge stability image from a Quickshift segmentation. RATIO controls the tradeoff between color consistency and spatial consistency (See VL_QUICKSEG) and KERNELSIZE controls the bandwidth of the density estimator (See VL_QUICKSEG, VL_QUICKSHIFT). MAXDIST is the maximum distance between neighbors which increase the density. ''' I = cv2.imread('/lena.png') ratio = .5 kernelsize=10 maxdist=10.0 vl.vl_quickvis(I, ratio, kernelsize, maxdist)