removeImages
Remove images from image index
Description
removeImages(
removes the images from the imageIndex,imageIds)imageIndex object that correspond
to the imageIds input.
Examples
Create image set.
dataDir = fullfile(toolboxdir('vision'),'visiondata','imageSets','cups'); imds = imageDatastore(dataDir);
Index the image set.
imageIndex = indexImages(imds)
Creating an inverted image index using Bag-Of-Features. ------------------------------------------------------- Creating Bag-Of-Features. ------------------------- * Selecting feature point locations using the Detector method. * Extracting SURF features from the selected feature point locations. ** detectSURFFeatures is used to detect key points for feature extraction. * Extracting features from 6 images...done. Extracted 1708 features. * Keeping 80 percent of the strongest features from each category. * Balancing the number of features across all image categories to improve clustering. ** Image category 1 has the least number of strongest features: 1366. ** Using the strongest 1366 features from each of the other image categories. * Creating a 1366 word visual vocabulary. * Number of levels: 1 * Branching factor: 1366 * Number of clustering steps: 1 * [Step 1/1] Clustering vocabulary level 1. * Number of features : 1366 * Number of clusters : 1366 * Initializing cluster centers...100.00%. * Clustering...completed 1/100 iterations (~0.02 seconds/iteration)...converged in 1 iterations. * Finished creating Bag-Of-Features Encoding images using Bag-Of-Features. -------------------------------------- * Encoding 6 images...done. Finished creating the image index.
imageIndex =
invertedImageIndex with properties:
ImageLocation: {6×1 cell}
ImageWords: [6×1 vision.internal.visualWords]
WordFrequency: [0.1667 0.1667 0.1667 0.3333 0.1667 0.1667 0.1667 0.5000 0.3333 0.1667 0.3333 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3333 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 … ] (1×1366 double)
BagOfFeatures: [1×1 bagOfFeatures]
ImageID: [1 2 3 4 5 6]
MatchThreshold: 0.0100
WordFrequencyRange: [0.0100 0.9000]
imageIndex.ImageLocation
ans = 6×1 cell
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/bigMug.jpg' }
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/blueCup.jpg' }
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/handMade.jpg' }
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/holdingCup.jpg'}
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/plaid.jpg' }
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/plainWhite.jpg'}
Remove first and third image.
removeImages(imageIndex,[1 3]); imageIndex.ImageLocation
ans = 4×1 cell
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/blueCup.jpg' }
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/holdingCup.jpg'}
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/plaid.jpg' }
{'/mathworks/devel/bat/filer/batfs2566-0/Bdoc25b.2988451/build/runnable/matlab/toolbox/vision/visiondata/imageSets/cups/plainWhite.jpg'}
Input Arguments
Image search index, specified as an invertedImageIndex
object.
Image identifiers, specified as a vector of positive integers. The image
identifiers correspond to the identifiers in
imageIndex.ImageID, where ImageID
is a property of the invertedImageIndex
object.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2015a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)