GUI Examples #16:Explore counting and argument detection

January 30, 2010 by Matt Fig · Leave a Comment
Filed under: GUI, Tutorials 
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)
VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)

Pushing either of the pushbuttons causes the total number of pushes and the number of arguments passed to one of their callbacks to display.

function [] = GUI_16()
% Demonstrate how to keep track of the number of times an action is taken 
% and the number of arguments passed.  Here pressing both buttons
% calls the same function (pb2_call), but pushing button one calls pb2_call
% from it's own callback.  Thus the number of arguments received in
% pb2_call is different depending on how it is called.  Pushing either
% button prints to the command window both the total number of button
% pushes and the number of input arguments used in the latest call.
%
%
% Author:  Matt Fig
% Date:  7/15/2009
 
S.CNT = 0% This keeps track of how many times the buttons are pushed.
S.fh = figure('units','pixels',...
 'position',[500 500 200 50],...
 'menubar','none',...
 'numbertitle','off',...
 'name','GUI_16',...
 'resize','off');
S.pb(1) = uicontrol('style','push',...
 'units','pixels',...
 'position',[10 10 85 30],...
 'fontsize',14,...
 'string','PUSH_1');
S.pb(2) = uicontrol('style','push',...
 'units','pixels',...
 'position',[105 10 85 30],...
 'fonts',14,...
 'str','PUSH_2');
set(S.pb(:),{'callback'},{{@pb1_call,S};{@pb2_call,S}})  % Set callbacks.
 
 
function [] = pb1_call(varargin)
% Callback for the button labeled PUSH_1.
[h,S] = varargin{[1,3]}; % Extract the calling handle and structure.
pb2_call(h,S) % call the other button's callback.
 
 
function [] = pb2_call(varargin)
% Callback for PUSH_2, and the function that pb1_call calls.
N = numel(varargin);
Ns = num2str(N-1)% String representation used with fprintf
S = varargin{N}% Extract the structure.
S.CNT = S.CNT + 1% The call counter.
fprintf('\t\t%s%i\n','Call number: ',S.CNT)
fprintf('\t\t%s%i%s\n',['PUSH_',Ns,' called me with : '],N,' arguments.')
% Now we need to make sure that the new value of CNT is available.
set(S.pb(:),{'callback'},{{@pb1_call,S};{@pb2_call,S}})
VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

Popularity: 1% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Live
  • PDF
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • email
  • MySpace
  • RSS

Fast and Accurate Face Identification Using Overlapping DCT

January 28, 2010 by Luigi Rosa · Leave a Comment
Filed under: Image processing 
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)
VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)

.: Click here to download :.

In the JPEG image compression algorithm, the input image is divided into 8-by-8 or 16-by-16 blocks, and the two-dimensional DCT is computed for each block. The DCT coefficients are then quantized, coded, and transmitted. The JPEG receiver (or JPEG file reader) decodes the quantized DCT coefficients, computes the inverse two-dimensional DCT of each block, and then puts the blocks back together into a single image. For typical images, many of the DCT coefficients have values close to zero; these coefficients can be discarded without seriously affecting the quality of the reconstructed image. Such algorithm results particularly robust also for face identification. Moreover the 2D DCT operator can be applied to overlapping data.

The extracted feature vectors are used as input to a simple nearest neighbor algorithm. The k-nearest neighbor algorithm is amongst the simplest of all machine learning algorithms. An object is classified by a majority vote of its neighbors, with the object being assigned to the class most common amongst its k nearest neighbors. k is a positive integer, typically small. If k = 1, then the object is simply assigned to the class of its nearest neighbor. In binary (two class) classification problems, it is helpful to choose k to be an odd number as this avoids difficulties with tied votes. The same method can be used for regression, by simply assigning the property value for the object to be the average of the values of its k nearest neighbors. It can be useful to weight the contributions of the neighbors, so that the nearer neighbors contribute more to the average than the more distant ones. The neighbors are taken from a set of objects for which the correct classification (or, in the case of regression, the value of the property) is known. This can be thought of as the training set for the algorithm, though no explicit training step is required. In order to identify neighbors, the objects are represented by position vectors in a multidimensional feature space. It is usual to use the Euclidean distance, though other distance measures, such as the Manhattan distance could in principle be used instead. The k-nearest neighbor algorithm is sensitive to the local structure of the data.

The code has been tested with AT&T database achieving an excellent recognition rate of 99.20% (40 classes, 5 training images and 5 test images for each class, hence there are 200 training images and 200 test images in total randomly selected and no overlap exists between the training and test images).

Index Terms: Matlab, source, code, face recognition, face matching, face verification, dct, k-nearest neighbor algorithm, knn, discrete cosine transform.

Figure 1. Example of k-NN classification

A simple and effective source code for Face Recognition.

Demo code (protected P-files) available for performance evaluation. Matlab Image Processing Toolbox is required.

Release
Date
Major features
1.0

2007.10.20

We recommend to check the secure connection to PayPal, in order to avoid any fraud.
This donation has to be considered an encouragement to improve the code itself.

Face Recognition Based On Overlapping DCT – Click here for your donation. In order to obtain the source code you have to pay a little sum of money: 250 EUROS (less than 350 U.S. Dollars).
Once you have done this, please email us luigi.rosa@tiscali.it
As soon as possible (in a few days) you will receive our new release of Face Recognition Based On Overlapping DCT.

Alternatively, you can bestow using our banking coordinates:

Name :
Luigi Rosa
Address :
Via Centrale 35 67042 L’Aquila Italy
Bank name:
Poste Italiane
Bank address:
Viale Europa 190 00144 Roma Italy
IBAN (International Bank Account Number) :
IT-50-V-07601-03600-000058177916
BIC (Bank Identifier Code) :
BPPIITRRXXX

The authors have no relationship or partnership with The Mathworks. All the code provided is written in Matlab language (M-files and/or M-functions), with no dll or other protected parts of code (P-files or executables). The code was developed with Matlab Release 2006a. Matlab Image Processing Toolbox is required. The code provided has to be considered “as is” and it is without any kind of warranty. The authors deny any kind of warranty concerning the code as well as any kind of responsibility for problems and damages which may be caused by the use of the code itself including all parts of the source code.

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

Popularity: 1% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Live
  • PDF
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • email
  • MySpace
  • RSS

SaGA – Spatial and Geometric Analysis Toolbox

January 27, 2010 by Admin · Leave a Comment
Filed under: Geometry 
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)
VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)

Here is a directory to a useful toolbox from:

Kirill K. Pankratov

CMPO, EAPS, MIT

SaGA is a collection of MATLAB programs dealing with various aspects of geometrical modeling and spatial data analysis.

Before proceeding further you are invited to a short tour of the gallery of pictures easily produced with SaGA routines.

By the way here is the m-file sagawcm.m which produces the above header picture.

This is is the Readme file with brief information describing the SaGA package.

Here you can get straight to the SAGA directory where all the programs are stored.

To see a list of functions contained in the SaGA Toolbox go to the Contents file.

One can transfer the archives containing most of the SaGA toolbox from SAGA_Z directory.

The structure and function interdependence of the SaGA toolbox is detailed in the Flowchart.

See License file for registration information.

The Whatsnew file will contains information about updates and further development of the SaGA Toolbox.

And here one can find answers to some Frequently Asked Questions about SaGA.

pkirill@mit.edu
VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

Popularity: 1% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Live
  • PDF
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • email
  • MySpace
  • RSS

Next Page »