Matlab recommended toolbox for Image processing and Computer Vision

MATLAB 2012a Student Version
Add-on products that extend MATLAB and Simulink:
– Control System Toolbox
– Image Processing Toolbox
– Optimization Toolbox
– DSP System Toolbox
– Signal Processing Toolbox
– Simulink Control Design
– Statistics Toolbox
– Symbolic Math Toolbox

Additional purchase for Computer Vision System Toolbox.
I recommend this toolbox to ease your work on Computer Vision!
Sample source code:
Detect SURF Interest Points in a Grayscale Image

%Detect interest points in a grayscale, image and mark their locations.
I = imread('c:/images/cameraman.tif');
points = detectSURFFeatures(I);
imshow(I); hold on;

Use SURF Features to Find Corresponding Points

%Read the two images.
I1 = imread('cameraman.tif');
I2 = imresize(imrotate(I1,-20), 1.2);

%Find the SURF features.
points1 = detectSURFFeatures(I1);
points2 = detectSURFFeatures(I2);

%Extract the features.
[f1, vpts1] = extractFeatures(I1, points1);
[f2, vpts2] = extractFeatures(I2, points2);

%Retrieve the locations of matched points. SURF feature vectors are already normalized
index_pairs = matchFeatures(f1, f2, 'Prenormalized' false) ;
matched_pts1 = vpts1(index_pairs(:, 1));
matched_pts2 = vpts2(index_pairs(:, 2));

%Show the matching points. There are still several outliers present in the data, but you can see the effects of rotation and scaling on the display of matched features.
figure; showMatchedFeatures(I1,I2,matched_pts1,matched_pts2);
legend('matched points 1','matched points 2');

Combine MSER Region Detector with SURF Descriptors

%Extract and display SURF descriptors at locations identified by MSER detector.
%Read image.
I = imread('cameraman.tif');

%Detect MSER features.
regionsObj = detectMSERFeatures(I);

%Extract and display SURF descriptors.
[features, validPtsObj] = extractFeatures(I, regionsObj);
imshow(I); hold on;

Mix FAST Corner Detector with SURF Descriptors

%Using corner detection, create a SURF points object and then extract SURF descriptors.
%Load an image.
I = imread('cameraman.tif');

%Construct corner detector System object.
hcornerdet = vision.CornerDetector('Method', 'Local intensity comparison (Rosten & Drummond)'); 

%Invoke the object on image, I.
ptsArray = step(hcornerdet, I);

%Transform the array of [x y] coordinates into a SURFPoints object.
ptsObj = SURFPoints; % start with an empty object
ptsObj = ptsObj.append(ptsArray, 'Scale', 2);

%Extract SURF descriptors and visualize the first 5 descriptors.
[features, validPtsObj] = extractFeatures(I, ptsObj);
imshow(I); hold on;

Detect Corners in an Input Image (using FAST corner detection)

%Detect corners in an input image using the FAST algorithm.
%Read the input image.
I = im2single(imread('circuit.tif'));

%Select FAST algorithm by Rosten & Drummond.
cornerDetector = vision.CornerDetector('Method','Local intensity comparison (Rosten & Drummond)');

%Find corners
pts = step(cornerDetector, I);

%Create the markers. The color data range must match the data range of the input image. The color format for the marker is [red, green, blue].
color = [1 0 0];
drawMarkers = vision.MarkerInserter('Shape', 'Circle', 'BorderColor', 'Custom', 'CustomBorderColor', color);

%Convert the grayscale input image I to an RGB image J before inserting color markers.
J = repmat(I,[1 1 3]);

%Display the image with markers
J = step(drawMarkers, J, pts);
imshow(J); title ('Corners detected in a grayscale image'); 



4 responses to this post.

  1. Posted by Zainor on April 6, 2013 at 2:01 pm


    Can u try this..

    index_pairs1 = matchFeatures(f1, f2, ‘Prenormalized’ false) ;
    index_pairs2 = matchFeatures(f2, f1, ‘Prenormalized’ false) ;

    why length(index_pairs1) not equal to length(index_pairs2)?


  2. Posted by Akmal Rahmat on November 4, 2014 at 12:29 pm

    bagaimana hendak bertanyakan soalan kepada kamu ? boleh saya dapatkan email saudara ? pertanyaan berkenaan image processing.


  3. haah, nak tanya juga. macam mana ya?


  4. Posted by Arun on January 6, 2016 at 6:35 am

    >> I = imread(‘lenna.jpg’);
    points = detectSURFFeatures(I);
    imshow(I); hold on;

    Error using detectSURFFeatures
    Expected input number 1, I, to be two-dimensional.
    Error in detectSURFFeatures>parseInputs (line 82)
    validateattributes(I,{‘logical’, ‘uint8’, ‘int16’, ‘uint16’, …
    Error in detectSURFFeatures (line 71)
    [Iu8 params] = parseInputs(I,varargin{:});

    I am using R2013a Licensed Version. Why it is so?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: