The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mpisearchMex.m

Go to the documentation of this file.
00001 % mpisearchMex
00002 % 
00003 % Call the C++-based face detector
00004 % [boxes, detects, n] = mpisearchMex(ci, img, max_num_detects, do_simplify, offset)
00005 %
00006 % If you want to pass in an aray of flags for windows you want checked,
00007 % and for values you want saved, call it with optional arguments:
00008 % [boxes, detects, n, index_array, output_values] = mpisearchMex(ci, img, get_detects, do_simplify, offset, index_array, output_values)%
00009 %
00010 % OUTPUTS
00011 %  boxes:       Face locations
00012 %  detects:     Actual patches of image that were detected
00013 %  n:           number of patches classified
00014 %  index_array: Array corresponding to windows that may or may not be checked
00015 %  output_values: Array holding output values of classifier for each window.
00016 %
00017 % INPUTS:
00018 %  ci:              classifier info sruct.  If it is 0, the built-in weights will be used
00019 %  img:             the image
00020 %  do_simplify:     whether or not to collapse overlapping boxes
00021 %  max_num_detects: maximum number of detected image patches to be returned
00022 %  box:             flag if you want actual boxes returned or not
00023 %  index_array:     Array corresponding to windows that may or may not be checked
00024 %  output_values:   Array holding output values of classifier for each window.
00025 %
00026 % NOTE: index_array and output_values MUST be the same variable, which
00027 % MUST have already been allocated using mp_makeindex.
00028 %
00029 %example 1: get face boxes
00030 %origimg = imread('../KDesktop/ah8.jpg');
00031 %img = rgb2gray(origimg);
00032 %img = double(img)./255;
00033 %[b,d,n] = mpisearchMex(0, img, 0, 1, 1);
00034 %boxed = origimg;
00035 %for i = 1:size(b,1)
00036 %boxed = drawBox(boxed, b(i,3), b(i,4), b(i,5), b(i,6), 'hit',0);
00037 %end
00038 %imshow(boxed)
00039 %
00040 %example 2: evaluate image, but don't get actual face boxes
00041 %
00042 %origimg = imread('../../KDesktop/ah8.jpg');
00043 %img = rgb2gray(origimg);
00044 %img = double(img)./255;
00045 %[ind, x, y, scstart, scfactor] = mp_makeindex(size(img,2),size(img,1), 24);
00046 %index_flags = ones(size(ind));
00047 %output_vals = zeros(size(ind));
00048 %[b, d, n, index_flags, output_vals] = mpisearchMex(0, img, 0, 1, 0, index_flags, output_vals);
00049 
00050 %
00051 %
00052 %   mpisearchMex.m
00053 %
00054 %   Created by Ian Fasel on Thu Apr 18 2002.
00055 %
00056 %   Copyright (c) 2002 Machine Perception Laboratory
00057 %   University of California San Diego.
00058 %
00059 % Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
00060 %
00061 %    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
00062 %    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
00063 %    3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
00064 %
00065 % THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Generated on Mon Nov 8 17:07:46 2004 for MPT by  doxygen 1.3.9.1