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 to continiously capture stereoscopic pictures from the 
% first 2 cameras on the bus
%
% try..
% >> test
%
% ... or
%
% >> test(2, 100, 100, 50, 200)

function test(varargin)

supportedModes = { ...
	'YUV444 (160x120, 30 fps)', ...
	'YUV422 (320x240, 30 fps)', ...
	'YUV411 (640x480, 30 fps)', ...
	'YUV422 (640x480, 15 fps)', ...
	'RGB8 (640x480, 15 fps)', ...
	'Y8 (640x480, 30 fps)', ...
	'Y16 (640x480, 15 fps)' ...
    };

fname1 = 'colors1.txt';    % default filename
fname2 = 'colors2.txt';    % default filename
scan4col = [];             % all colours

if(isempty(varargin))
    disp('Image type not specified - using YUV as the default');
    mode = 2;			% default mode: YUV411 (640x320, 30 fps)
    myWidth  = -1;      % default width (max)
    myHeight = -1;      % default height (max)
    myOrigX  = -1;      % default origin-x (0)
    myOrigY  = -1;      % default origin-y (0)
elseif(nargin == 1 && isnumeric(varargin{1}))
    mode = varargin{1};
    myWidth  = -1;      % default width (max)
    myHeight = -1;      % default height (max)
    myOrigX  = -1;      % default origin-x (0)
    myOrigY  = -1;      % default origin-y (0)
elseif(nargin == 3 && isnumeric(varargin{1}) && isnumeric(varargin{2}) && isnumeric(varargin{3}))
    mode = varargin{1};
    myWidth  = varargin{2};
    myHeight = varargin{3};
    myOrigX  = -1;      % default origin-x (0)
    myOrigY  = -1;      % default origin-y (0)
elseif(nargin == 5 && isnumeric(varargin{1}) && isnumeric(varargin{2}) && isnumeric(varargin{3}) ...
                                             && isnumeric(varargin{4}) && isnumeric(varargin{5}))
    mode = varargin{1};
    myWidth  = varargin{2};
    myHeight = varargin{3};
    myOrigX  = varargin{4};
    myOrigY  = varargin{5};
end

if(mode == -1)
    
    % switch camera off
    capProcStereo2(-1);
    
else

    % ensure we can exit from the while(1) loop gracefully...
    steroOut = figure;
    set(gcf, 'Position', [20 100 950 400]);
    set(gcf, 'MenuBar', 'none');
    set(gcf, 'Name', 'Stereoscopic Vision');

    subplot(1,2,1)
    title('first camera')
    axis image
    subplot(1,2,2)
    title('second camera')
    axis image

    evalin('base', 'run = 1;');
    set(steroOut, 'CloseRequestFcn', 'evalin(''base'', ''run = 0;'');');

    run = 1;
    while(run)
        
        try
            % verbosity: on (4th call-up parameter)
            [out1, out2, im1, im2] = capProcStereo2(mode, fname1, fname2, scan4col, 1, myWidth, myHeight, myOrigX, myOrigY);

            % camera 1 -------------------------------------------------
            subplot(1,2,1)
            image(im1);
            title('camera #1 -- Close figure window to exit (e.g. ALT+F4)')
            axis image
            drawnow

            if(~isempty(out1))				% no regions detected
                hold on;

                nCol = length(out1);		% number of colours with valid regions
                for(j = 1:nCol)
                    kk = out1(j).nRegions;
                    col = out1(j).Colour;
                    while(kk)
                        cx = out1(j).Regions(1,kk);		% centroid
                        cy = out1(j).Regions(2,kk);
                        x1 = out1(j).Regions(3,kk);		% boundary box
                        y1 = out1(j).Regions(4,kk);
                        x2 = out1(j).Regions(5,kk);
                        y2 = out1(j).Regions(6,kk);
                        % disp(['x1 = ' num2str(x1) ', x2 = ' num2str(x2) ', y1 = ' num2str(y1) ', y2 = ' num2str(y2)])
                        patch([x1 x2 x2 x1], [y1 y1 y2 y2], col);
                        plot(cx,cy,'w*');
                        kk = kk - 1;
                    end
                end

                hold off
            end

            % camera 2 -------------------------------------------------
            subplot(1,2,2)
            image(im2);
            title('camera #2 -- Close figure window to exit (e.g. ALT+F4)')
            axis image
            drawnow

            if(~isempty(out2))				% no regions detected
                hold on;

                nCol = length(out2);		% number of colours with valid regions
                for(j = 1:nCol)
                    kk = out2(j).nRegions;
                    col = out2(j).Colour;
                    while(kk)
                        cx = out2(j).Regions(1,kk);		% centroid
                        cy = out2(j).Regions(2,kk);
                        x1 = out2(j).Regions(3,kk);		% boundary box
                        y1 = out2(j).Regions(4,kk);
                        x2 = out2(j).Regions(5,kk);
                        y2 = out2(j).Regions(6,kk);
                        % disp(['x1 = ' num2str(x1) ', x2 = ' num2str(x2) ', y1 = ' num2str(y1) ', y2 = ' num2str(y2)])
                        patch([x1 x2 x2 x1], [y1 y1 y2 y2], col);
                        plot(cx,cy,'w*');
                        kk = kk - 1;
                    end
                end

                hold off
            end
        catch
            % catch driver errors (e.g. unsupported modes)
            set(gcf, 'CloseRequestFcn', 'closereq');
            close all
            rethrow(lasterror)
        end

        % fetch 'run' from 'base' WS
        run = evalin('base', 'run');
        
    end

end

% switch camera off...
capProcStereo2(-1);
set(steroOut, 'CloseRequestFcn', 'closereq');
close all

Contact us