Non-uniformity correction of infrared images by midway equalization
borders.cpp
Go to the documentation of this file.
00001 /*
00002 * Copyright 2012 IPOL Image Processing On Line http://www.ipol.im/
00003 *
00004 * This program is free software: you can redistribute it and/or modify
00005 * it under the terms of the GNU General Public License as published by
00006 * the Free Software Foundation, either version 3 of the License, or
00007 * (at your option) any later version.
00008 *
00009 * This program is distributed in the hope that it will be useful,
00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 * GNU General Public License for more details.
00013 *
00014 * You should have received a copy of the GNU General Public License
00015 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00018 
00019 
00020 
00021 
00034 #include "borders.h"
00035 
00036 void borders(float *Image,float *modified, int w1, int h1, int B)
00037 {
00038 
00039 
00040 
00045 
00046 
00047 
00048     for (int column=0;column<w1;column++)  //for columns in the middle
00049     {
00050         for (int line=0;line<h1;line++) //for all lines
00051         {
00052             modified[line*(w1+2*B)+B+column]=Image[line*w1+column];
00053 
00054         }
00055     }
00056 
00057 
00058 
00059 
00064 
00065 
00066 
00067     for (int column=-B;column<0;column++)  //for all columns on the left
00068     {
00069         for (int line=0;line<h1;line++)  //for all lines
00070         {
00071             modified[line*(w1+2*B)+B+column]=Image[line*w1+(-column)];
00072         }
00073     }
00074 
00075 
00080 
00081 
00082     for (int column=w1;column<w1+B;column++) //for all columns on the right
00083     {
00084         for (int line=0;line<h1;line++)  //for all lines
00085         {
00086             modified[line*(w1+2*B)+B+column]=Image[line*w1+(2*w1-column-1)];
00087         }
00088     }
00089 }
00090 
00091 
00092 
00093 
 All Files Functions Defines