No BSD License  

Highlights from
FireWire Vision Tools

  • filterYUVimage(yuv, rgbIn...filter supplied YUV image according to the specified ranges and return
  • isalphanum(instr)
  • rgb2yuv(src)
  • test(varargin) test program to continiously acquire pictures from the camera
  • test(varargin) test program to continiously capture pictures from the camera and process
  • test(varargin) test program to continiously capture pictures from the camera and process
  • test(varargin) test program to continiously capture pictures from the camera and process
  • test(varargin) test program to continiously capture stereoscopic pictures from the
  • test(varargin) test program to continiously capture stereoscopic pictures from the
  • test(varargin) test program for 'imgProc', colour file: 'testcolors.txt'
  • test(varargin) test program for 'imgProcSilent', colour file: 'testcolors.txt'
  • test(varargin) test program for 'imgProcSilent', colour file: 'testcolors.txt'
  • test(varargin) test program to continiously capture stereoscopic pictures from the
  • test(varargin) test program to continiously capture pictures from the camera
  • test(varargin) test program for 'imgProc', colour file: 'testcolors.txt'
  • test(varargin) test program for 'imgProc', colour file: 'testcolors.txt'
  • test(varargin) test program to continiously capture stereoscopic pictures from the
  • test(varargin) test program to continiously capture stereoscopic pictures from the
  • test(varargin) test program to continiously capture pictures from the camera and process
  • test(varargin) test program to continiously capture pictures from the camera and process
  • test(varargin) test program to continiously capture pictures from the camera and
  • test(varargin) test program to continiously capture pictures from the camera and process
  • test(varargin) test program to continiously capture stereoscopic pictures from the
  • test(varargin) test program to continiously capture pictures from the camera and
  • test(varargin) test program to continiously capture pictures from the camera
  • test(varargin) test program to continiously acquire pictures from the camera
  • trainCameraGUI(varargin)TRAINCAMERAGUI M-file for trainCameraGUI.fig
  • yuv2rgb(src)
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • cc.mdetermine driver installation -- assumed to be in folder _CMU1394
  • trainCamera.mtraining program... acquires RGB/YUYV image data from a the camera and extracts the colour information of
  • trainCameraStereo.mtraining program... acquires RGB/YUYV image data from a the cameras (stereoscopic vision)
  • trainStill.mtraining program... reads RGB/YUV image data from a mat-file and extracts the colour information of
  • CameraCoordinates
  • CameraCoordinates
  • test_short.avi
  • View all files
image thumbnail

FireWire Vision Tools

by

 

23 May 2008 (Updated )

A simple MATLAB interface to "FireWire Digital Cameras" and the Color Machine Vision algorithms "CMV

test(varargin)
% test program for 'imgProc', colour file: 'testcolors.txt'

function	test(varargin)

% Ensure that colour definition file exists
colour_def = 'testcolors.txt';          % don't modify this filename (hard coded in imgProc.dll)  --  FW-05-03
cdef = dir(colour_def);
if(isempty(cdef))
   error(['The required colour definition file ' colour_def ' could not be found\n']);
else

   % determine the number of colours to be scanned for
   h = fopen(colour_def);
   nCDef = 0;
   while(~feof(h))
       myline = fgetl(h);

       if(strcmpi(myline, '[thresholds]'))
           break;
       end

       if(strcmpi(myline, '[colors]'))
           nCDef = 0;
       elseif(~strcmp(myline, ''))
           nCDef = nCDef + 1;
           disp(['(' num2str(nCDef) ') : ' myline]);
           %pause
       end
   end
   fclose(h);

end


% check inputs of function 'test'
if(isempty(varargin))

    % check if we're running with live images or not
    try
        % try to capture a frame...
        rgb = capImage(0);
        scan4col = [1:nCDef];
    catch
        % no camera - run of a prerecorded avi movie
        fname = 'testimages/testimageYUYVrgb.mat';
        disp(['No image file specified; using default ' fname]);
        eval(['load ' fname]);
        scan4col = [1:nCDef];
    end
elseif(nargin == 2)	% two input arguments -> file name and colour vector
    fname = varargin{1};
    eval(['load ' fname]);
    scan4col = varargin{2};
else
    fname = varargin{1};		% one input argument -> file name
    eval(['load ' fname]);
    scan4col = [1:nCDef];
end


% process frame...
out = imgProc(rgb, colour_def, scan4col);
nvr = [out(:).nRegions];        % number of valid regions per colour

if(any(nvr))    				% any valid regions at all?
    hold on;
    
    for(j = 1:length(nvr))
        kk = out(j).nRegions;
        col = out(j).Colour;
        while(kk)
            cx = out(j).Regions(1, kk);		% centroid
            cy = out(j).Regions(2, kk);
            x1 = out(j).Regions(3, kk);		% boundary box
            y1 = out(j).Regions(4, kk);
            x2 = out(j).Regions(5, kk);
            y2 = out(j).Regions(6, kk);
            ll = plot([x1 x2 x2 x1 x1], [y1 y1 y2 y2 y1]);
            set(ll, 'Color', [1 1 1] - col);
            ll = plot(cx, cy, 'x');
            set(ll, 'Color', [1 1 1] - col);
            kk = kk - 1;
        end
    end
    
    hold off
end
axis ij;

Contact us