www.gusucode.com > vision 源码程序 matlab案例代码 > vision/PartitionAnImageSetExample.m
%% Partition Image Set %% Create an image set. % Copyright 2015 The MathWorks, Inc. imgFolder = fullfile(matlabroot,'toolbox','vision','visiondata','stopSignImages'); imgSet = imageSet(imgFolder); %% Divide the set into two groups: one with five images and the other with the remainder of the images from imgSet. [setA1, setA2] = partition(imgSet,5); %% Randomly partition the set into three groups: one with 20% of the images, the second group with 30%, and the third group with 50%. [setB1, setB2, setB3] = partition(imgSet, [0.2, 0.3],'randomized');