Kaynağa Gözat

minor changes for documentation and output variables

Alexander Freytag 12 yıl önce
ebeveyn
işleme
360a51f081
2 değiştirilmiş dosya ile 16 ekleme ve 16 silme
  1. 1 1
      segmentFelzenszwalb.cpp
  2. 15 15
      segmentFelzenszwalb.m

+ 1 - 1
segmentFelzenszwalb.cpp

@@ -23,7 +23,7 @@ void mexFunction(int nOutput, mxArray *pOutput[], /* Output variables */
     return;
   }
   
-  if (nOutput > 1) {
+  if (nOutput > 2) {
     mexErrMsgTxt ( "Too many output arguments.");
     return;
   }

+ 15 - 15
segmentFelzenszwalb.m

@@ -1,26 +1,26 @@
-% function segImg = segmentFelzenszwalb(imgInput, sigma, k, minSize, destination, verbose)
+% function [ segImg, noRegions ]= segmentFelzenszwalb(imgInput, sigma, k, minSize, computeColorOutput, destination, verbose)
 %
-% BRIEF: segmentFelzenszwalb Run the region segmentation algorithm of Felzenszwalb
-% and Huttonlocher
-%   V = segmentFelzenszwalb(X, N) 
+% BRIEF: segmentFelzenszwalb Run the region segmentation algorithm of Felzenszwalb and Huttonlocher
 %
 %   The function accepts the following options:
 %   INPUT: 
-%        imgInput         --   (string or 3d-matrix)
-%        sigma            --   (optional, scalar) bandwidth of Gaussian kernel to
-%        smooth the image, default: 0.5
-%        k                --   (optional, scalar) influences the threshold accept a
-%        boundary between regions (larger k -> larger regions), default:
-%        500
-%        minSize          --   (optional, scalar), minimum component size (enforced by post-processing stage), default: 20
-%        destination      --   (optional, string) 
-%        verbose          --   (optional, bool) 
+%        imgInput           --   (string or 3d-matrix over uint8 )
+%        sigma              --   bandwidth of Gaussian kernel to smooth the image (optional, scalar, default: 0.5) 
+%        k                  --   influences the threshold accept a boundary between regions, larger k -> larger regions,(optional, scalar, default: 500)
+%        minSize            --   minimum component size enforced by post-processing stage (optional, scalar, default: 20)
+%        computeColorOutput --   compute colored segm output (rgb) or region indicees (gray)? (optional, logical, default: false) 
+%        destination        --   filename where the image shell be stored (optional, string) 
+%        verbose            --   print additional information (optional, logical, default: false) 
+%
 %   OUTPUT: 
+%        segImg             --   segmentation result, either colored or with region indicees (optional, 3d-matrix or 2d-matrix over uint8)
+%        noRegions          --   total number of regions (optional, uint8)
 %
 %
-%   Example::
+%   Example:
+%        segResult = segmentFelzenszwalb(imgOrig);
+%        segResult = segmentFelzenszwalb(imgOrig,0.5, 200, 20, true, 0 , true);
 %
-%   Note::
 
 
 % Authors: Alexander Freytag