You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: svm_hog_ocr_digits_demo.m
    path of file: ./repos/mexopencv/samples
    
    the code of the file until where you have to start completion: %% OCR of hand-written digits using HoG and SVM
%
% In this tutorial, we will build an SVM classifer to recognize
%
    
function img = deskew(img)
    % deskew image using its second order moments
    sz = 20;
    m = cv.moments(img);
    if abs(m.mu02) > 0.2  % 0.01
        skew = m.mu11 / m.mu02;
        M = [1 skew -0.5*sz*skew; 0 1 0];
        img = cv.warpAffine(img, M, 'DSize',[sz sz], 'WarpInverse',true);
    end