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: correct_bbox.m
    path of file: ./repos/OpenFace/matlab_version/face_detection/mtcnn
    
    the code of the file until where you have to start completion: function [ total_bboxes, to_keep ] = correct_bbox( total_bboxes, corrections, add1, rectangulate, round, type )

    
function [ total_bboxes, to_keep ] = correct_bbox( total_bboxes, corrections, add1, rectangulate, round, type )
%CORRECT_BBOX Summary of this function goes here
%   Detailed explanation goes here

    % Non maximum supression accross bounding boxes
    to_keep = non_maximum_supression(total_bboxes, 0.7, type);
    total_bboxes = total_bboxes(to_keep, :);
    corrections = corrections(to_keep, :);
    % Perform correction based on regression values
    bbw = total_bboxes(:,3) - total_bboxes(:,1);
    bbh = total_bboxes(:,4) - total_bboxes(:,2);
    
    % TODO is this needed?
    if(add1)
        bbw = bbw + 1;
        bbh = bbh + 1;
    end