src/qvipp/qvipp.h

Go to the documentation of this file.
00001 /*
00002  *      Copyright (C) 2007. PARP Research Group.
00003  *      <http://perception.inf.um.es>
00004  *      University of Murcia, Spain.
00005  *
00006  *      This file is part of the QVision library.
00007  *
00008  *      QVision is free software: you can redistribute it and/or modify
00009  *      it under the terms of the GNU Lesser General Public License as
00010  *      published by the Free Software Foundation, version 3 of the License.
00011  *
00012  *      QVision is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU Lesser General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU Lesser General Public
00018  *      License along with QVision. If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00024 
00025 #ifndef QVIPP_H
00026 #define QVIPP_H
00027 
00028 #include <qvcore/qvimage.h>
00029 #include <QMap>
00030 
00091 namespace qvipp
00092 {
00099 void Copy(const QVImage<uChar, 1> &src, QVImage<uChar, 1> &dest);
00100 
00103 void Copy(const QVImage<sShort, 1> &src, QVImage<sShort, 1> &dest);
00104 
00107 void Copy(const QVImage<sFloat, 1> &src, QVImage<sFloat, 1> &dest);
00108 
00111 void Copy(const QVImage<uChar, 3> &src, QVImage<uChar, 3> &dest);
00112 
00115 void Copy(const QVImage<sShort, 3> &src, QVImage<sShort, 3> &dest);
00116 
00119 void Copy(const QVImage<sFloat, 3> &src, QVImage<sFloat, 3> &dest);
00120 
00128 void Copy(const QVImage<uChar, 1> &src, QVImage<uChar, 3> &dest);
00129 
00132 void Copy(const QVImage<sShort, 1> &src, QVImage<sShort, 3> &dest);
00133 
00136 void Copy(const QVImage<sFloat, 1> &src, QVImage<sFloat, 3> &dest);
00137 
00146 void Copy(const QVImage<uChar, 3> &src, QVImage<uChar, 1> &dest, uChar channel);
00147 
00150 void Copy(const QVImage<sShort, 3> &src, QVImage<sShort, 1> &dest, uChar channel);
00151 
00154 void Copy(const QVImage<sFloat, 3> &src, QVImage<sFloat, 1> &dest, uChar channel);
00155 
00172 void Compare(const QVImage<uChar> &src1, const QVImage<uChar> &src2, QVImage<uChar> &dest, IppCmpOp ippCmpOp = ippCmpEq);
00173 
00176 void Compare(const QVImage<sShort> &src1, const QVImage<sShort> &src2, QVImage<uChar> &dest, IppCmpOp ippCmpOp = ippCmpEq);
00177 
00180 void Compare(const QVImage<sFloat> &src1, const QVImage<sFloat> &src2, QVImage<uChar> &dest, IppCmpOp ippCmpOp = ippCmpEq);
00181 
00184 void Compare(const QVImage<uChar,3> &src1, const QVImage<uChar,3> &src2, QVImage<uChar> &dest, IppCmpOp ippCmpOp = ippCmpEq);
00185 
00188 void Compare(const QVImage<sShort,3> &src1, const QVImage<sShort,3> &src2, QVImage<uChar> &dest, IppCmpOp ippCmpOp = ippCmpEq);
00189 
00192 void Compare(const QVImage<sFloat,3> &src1, const QVImage<sFloat,3> &src2, QVImage<uChar> &dest, IppCmpOp ippCmpOp = ippCmpEq);
00193 
00212 void CompareC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant, IppCmpOp ippCmpOp = ippCmpEq);
00213 
00216 void CompareC(const QVImage<sFloat> &src, QVImage<uChar> &dest, sFloat constant, IppCmpOp ippCmpOp = ippCmpEq);
00217 
00225 void Convert(const QVImage<uChar, 1> &src, QVImage<sShort, 1> &dest);
00226 
00229 void Convert(const QVImage<uChar, 1> &src, QVImage<sFloat, 1> &dest);
00230 
00233 void Convert(const QVImage<sShort, 1> &src, QVImage<uChar, 1> &dest);
00234 
00237 void Convert(const QVImage<sShort, 1> &src, QVImage<sFloat, 1> &dest);
00238 
00241 void Convert(const QVImage<uChar, 3> &src, QVImage<sShort, 3> &dest);
00242 
00245 void Convert(const QVImage<uChar, 3> &src, QVImage<sFloat, 3> &dest);
00246 
00249 void Convert(const QVImage<sShort, 3> &src, QVImage<uChar, 3> &dest);
00250 
00253 void Convert(const QVImage<sShort, 3> &src, QVImage<sFloat, 3> &dest);
00254 
00267 void Convert(const QVImage<sFloat, 1> &src, QVImage<uChar, 1> &dest, IppRoundMode roundMode = ippRndNear);
00268 
00271 void Convert(const QVImage<sFloat, 1> &src, QVImage<sShort, 1> &dest, IppRoundMode roundMode = ippRndNear);
00272 
00275 void Convert(const QVImage<sFloat, 3> &src, QVImage<uChar, 3> &dest, IppRoundMode roundMode = ippRndNear);
00276 
00279 void Convert(const QVImage<sFloat, 3> &src, QVImage<sShort, 3> &dest, IppRoundMode roundMode = ippRndNear);
00280 
00291 void RGBToGray(const QVImage<uChar, 3> &src, QVImage<uChar, 1> &dest);
00292 
00295 void RGBToGray(const QVImage<sShort, 3> &src, QVImage<sShort, 1> &dest);
00296 
00299 void RGBToGray(const QVImage<sFloat, 3> &src, QVImage<sFloat, 1> &dest);
00300 
00318 void Threshold(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant, IppCmpOp ippCmpOp = ippCmpEq);
00319 
00322 void Threshold(const QVImage<sShort> &src, QVImage<sShort> &dest, sShort constant, IppCmpOp ippCmpOp = ippCmpEq);
00323 
00326 void Threshold(const QVImage<sFloat> &src, QVImage<sFloat> &dest, sFloat constant, IppCmpOp ippCmpOp = ippCmpEq);
00327 
00334 void Set(QVImage<uChar> &img, uChar constant);
00335 
00338 void Set(QVImage<sShort> &img, sShort constant);
00339 
00342 void Set(QVImage<sFloat> &img, sFloat constant);
00343 
00353 void Set(QVImage<uChar, 3> &img, uChar red, uChar green, uChar blue);
00354 
00357 void Set(QVImage<sShort, 3> &img, sShort red, sShort green, sShort blue);
00358 
00361 void Set(QVImage<sFloat, 3> &img, sFloat red, sFloat green, sFloat blue);
00362 
00367 void Abs(const QVImage<sShort> &src, QVImage<sShort> &dest);
00368 
00371 void Abs(const QVImage<sFloat> &src, QVImage<sFloat> &dest);
00372 
00373 // boolean
00378 void Not(const QVImage<uChar> &src, QVImage<uChar> &dest);
00379 
00382 void Not(const QVImage<uChar,3> &src, QVImage<uChar,3> &dest);
00383 
00389 void OrC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant);
00390 
00396 void AndC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant);
00397 
00403 void XorC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant);
00404 
00410 void LShiftC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant);
00411 
00412 /*/// @brief Shifts bits in pixel values to the left.
00414 void LShiftC(const QVImage<uShort> &src, QVImage<uShort> &dest, uChar constant);*/
00415 
00421 void RShiftC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant);
00422 
00423 /*/// @brief Computes the exponential of pixel values in a image.
00428 void ExpC(const QVImage<sShort> &src, QVImage<sShort> &dest, uChar constant);*/
00429 
00430 
00431 /*/// @brief Shifts bits in pixel values to the left.
00433 void RShiftC(const QVImage<uShort> &src, QVImage<uShort> &dest, uChar constant);*/
00434 
00435 // aritmetic
00450 void Add(const QVImage<uChar> &src1, const QVImage<uChar> &src2, QVImage<uChar> &dest, int scale = 1);
00451 
00454 void Add(const QVImage<uChar,3> &src1, const QVImage<uChar,3> &src2, QVImage<uChar,3> &dest, int scale = 1);
00455 
00458 void Add(const QVImage<sShort> &src1, const QVImage<sShort> &src2, QVImage<sShort> &dest, int scale = 1);
00459 
00462 void Add(const QVImage<sShort,3> &src1, const QVImage<sShort,3> &src2, QVImage<sShort,3> &dest, int scale = 1);
00463 
00466 void Add(const QVImage<sFloat> &src1, const QVImage<sFloat> &src2, QVImage<sFloat> &dest);
00467 
00470 void Add(const QVImage<sFloat,3> &src1, const QVImage<sFloat,3> &src2, QVImage<sFloat,3> &dest);
00471 
00486 void Sub(const QVImage<uChar> &src1, const QVImage<uChar> &src2,QVImage<uChar> &dest, int scale = 1);
00487 
00490 void Sub(const QVImage<uChar,3> &src1, const QVImage<uChar,3> &src2,QVImage<uChar,3> &dest, int scale = 1);
00491 
00494 void Sub(const QVImage<sShort> &src1, const QVImage<sShort> &src2,QVImage<sShort> &dest, int scale = 1);
00495 
00498 void Sub(const QVImage<sShort,3> &src1, const QVImage<sShort,3> &src2,QVImage<sShort,3> &dest, int scale = 1);
00499 
00502 void Sub(const QVImage<sFloat> &src1, const QVImage<sFloat> &src2,QVImage<sFloat> &dest);
00503 
00506 void Sub(const QVImage<sFloat,3> &src1, const QVImage<sFloat,3> &src2,QVImage<sFloat,3> &dest);
00507 
00522 void Mul(const QVImage<uChar> &src1, const QVImage<uChar> &src2,QVImage<uChar> &dest, int scale = 1);
00523 
00526 void Mul(const QVImage<uChar,3> &src1, const QVImage<uChar,3> &src2,QVImage<uChar,3> &dest, int scale = 1);
00527 
00530 void Mul(const QVImage<sShort> &src1, const QVImage<sShort> &src2,QVImage<sShort> &dest, int scale = 1);
00531 
00534 void Mul(const QVImage<sShort,3> &src1, const QVImage<sShort,3> &src2,QVImage<sShort,3> &dest, int scale = 1);
00535 
00538 void Mul(const QVImage<sFloat> &src1, const QVImage<sFloat> &src2,QVImage<sFloat> &dest);
00539 
00542 void Mul(const QVImage<sFloat,3> &src1, const QVImage<sFloat,3> &src2,QVImage<sFloat,3> &dest);
00543 
00558 void Div(const QVImage<uChar> &src1, const QVImage<uChar> &src2,QVImage<uChar> &dest, int scale = 1);
00559 
00562 void Div(const QVImage<uChar,3> &src1, const QVImage<uChar,3> &src2,QVImage<uChar,3> &dest, int scale = 1);
00563 
00566 void Div(const QVImage<sShort> &src1, const QVImage<sShort> &src2,QVImage<sShort> &dest, int scale = 1);
00567 
00570 void Div(const QVImage<sShort,3> &src1, const QVImage<sShort,3> &src2,QVImage<sShort,3> &dest, int scale = 1);
00571 
00574 void Div(const QVImage<sFloat> &src1, const QVImage<sFloat> &src2,QVImage<sFloat> &dest);
00575 
00578 void Div(const QVImage<sFloat,3> &src1, const QVImage<sFloat,3> &src2,QVImage<sFloat,3> &dest);
00579 
00591 void MulScale(const QVImage<uChar> &src1, const QVImage<uChar> &src2, QVImage<uChar> &dest);
00592 
00595 void MulScale(const QVImage<uChar,3> &src1, const QVImage<uChar,3> &src2, QVImage<uChar,3> &dest);
00596 
00605 void AbsDiff(const QVImage<uChar> &src1, const QVImage<uChar> &src2,QVImage<uChar> &dest);
00606 
00609 void AbsDiff(const QVImage<sFloat> &src1, const QVImage<sFloat> &src2,QVImage<sFloat> &dest);
00610 
00611 // constant aritmetic
00626 void MulC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant, int scale = 1);
00627 
00630 void MulC(const QVImage<sShort> &src, QVImage<sShort> &dest, sShort constant, int scale = 1);
00631 
00634 void MulC(const QVImage<sFloat> &src, QVImage<sFloat> &dest, sFloat constant);
00635 
00650 void AddC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant, int scale = 1);
00651 
00654 void AddC(const QVImage<sShort> &src, QVImage<sShort> &dest, sShort constant, int scale = 1);
00655 
00658 void AddC(const QVImage<sFloat> &src, QVImage<sFloat> &dest, sFloat constant);
00659 
00675 void SubC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant, int scale = 1);
00676 
00679 void SubC(const QVImage<sShort> &src, QVImage<sShort> &dest, sShort constant, int scale = 1);
00680 
00683 void SubC(const QVImage<sFloat> &src, QVImage<sFloat> &dest, sFloat constant);
00684 
00700 void DivC(const QVImage<uChar> &src, QVImage<uChar> &dest, uChar constant, int scale = 1);
00701 
00704 void DivC(const QVImage<sShort> &src, QVImage<sShort> &dest, sShort constant, int scale = 1);
00705 
00708 void DivC(const QVImage<sFloat> &src, QVImage<sFloat> &dest, sFloat constant);
00709 
00710 // statistics
00715 void Sum(const QVImage<uChar> &src, sDouble & value);
00716 
00719 void Sum(const QVImage<sShort> &src, sDouble & value);
00720 
00727 void Sum(const QVImage<uChar,3> &src, sDouble & r, sDouble & g, sDouble & b);
00728 
00731 void Sum(const QVImage<sShort,3> &src, sDouble & r, sDouble & g, sDouble & b);
00732 
00737 void Mean(const QVImage<uChar> &src, sDouble & value);
00738 
00741 void Mean(const QVImage<sShort> &src, sDouble & value);
00742 
00749 void Mean(const QVImage<uChar,3> &src, sDouble & r, sDouble & g, sDouble & b);
00750 
00753 void Mean(const QVImage<sShort,3> &src, sDouble & r, sDouble & g, sDouble & b);
00754 
00759 void Max(const QVImage<uChar> &src, uChar & value);
00760 
00763 void Max(const QVImage<sShort> &src, sShort & value);
00764 
00767 void Max(const QVImage<sFloat> &src, sFloat & value);
00768 
00775 void Max(const QVImage<uChar,3> &src, uChar & r, uChar & g, uChar & b);
00776 
00779 void Max(const QVImage<sShort,3> &src, sShort &r, sShort &g, sShort &b);
00780 
00785 void Min(const QVImage<uChar> &src, uChar & value);
00786 
00789 void Min(const QVImage<sShort> &src, sShort & value);
00790 
00793 void Min(const QVImage<sFloat> &src, sFloat & value);
00794 
00801 void Min(const QVImage<uChar,3> &src, uChar & r, uChar & g, uChar & b);
00802 
00805 void Min(const QVImage<sShort,3> &src, sShort &r, sShort &g, sShort &b);
00806 
00807 // Filters
00819 void FilterMax(const QVImage<uChar> &src, QVImage<uChar> &dest, uInt colMaskSize, uInt rowMaskSize);
00820 
00823 void FilterMax(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt colMaskSize, uInt rowMaskSize);
00824 
00836 void FilterMin(const QVImage<uChar> &src, QVImage<uChar> &dest, uInt colMaskSize, uInt rowMaskSize);
00837 
00840 void FilterMin(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt colMaskSize, uInt rowMaskSize);
00841 
00853 void FilterBox(const QVImage<uChar> &src, QVImage<uChar> &dest, uInt colMaskRadius, uInt rowMaskRadius);
00854 
00857 void FilterBox(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt colMaskRadius, uInt rowMaskRadius);
00858 
00880 void FilterGauss(const QVImage<uChar> &src, QVImage<uChar> &dest, uInt maskSize = 3);
00881 
00884 void FilterGauss(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt maskSize = 3);
00885 
00902 void FilterHipass(const QVImage<uChar> &src, QVImage<uChar> &dest, uInt maskSize = 3);
00903 
00906 void FilterHipass(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt maskSize = 3);
00907 
00916 void FilterLowpass(const QVImage<uChar> &src, QVImage<uChar> &dest, uInt maskSize = 3);
00917 
00920 void FilterLowpass(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt maskSize = 3);
00921 
00933 void FilterSharpen(const QVImage<uChar> &src, QVImage<uChar> &dest);
00934 
00937 void FilterSharpen(const QVImage<sFloat> &src, QVImage<sFloat> &dest);
00938 
00949 void FilterSobelHoriz(const QVImage<uChar> &src, QVImage<uChar> &dest);
00950 
00953 void FilterSobelHoriz(const QVImage<sShort> &src, QVImage<sShort> &dest);
00954 
00957 void FilterSobelHoriz(const QVImage<sFloat> &src, QVImage<sFloat> &dest);
00958 
00969 void FilterSobelVert(const QVImage<uChar> &src, QVImage<uChar> &dest);
00970 
00973 void FilterSobelVert(const QVImage<sShort> &src, QVImage<sShort> &dest);
00974 
00977 void FilterSobelVert(const QVImage<sFloat> &src, QVImage<sFloat> &dest);
00978 
00998 void FilterSobelHorizMask(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt maskSize = 3);
00999 
01017 void FilterSobelVertMask(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt maskSize = 3);
01018 
01032 void FilterSobelHorizBorder(const QVImage<uChar> &src, QVImage<sShort> &dest, QVImage<uChar> &buffer, uInt maskSize = 3);
01033 
01047 void FilterSobelNegVertBorder(const QVImage<uChar> &src, QVImage<sShort> &dest, QVImage<uChar> &buffer, uInt maskSize = 3);
01048 
01060 void FilterMedian(const QVImage<uChar> &src, QVImage<uChar> &dest, uInt colMaskRadius = 3, uInt rowMaskRadius = 3);
01061 
01064 void FilterMedian(const QVImage<sShort> &src, QVImage<sShort> &dest, uInt colMaskRadius = 3, uInt rowMaskRadius = 3);
01065 
01081 void Resize(const QVImage<uChar> &src, QVImage<uChar> &dest, int interpolation = IPPI_INTER_LINEAR);
01082 
01085 void Resize(const QVImage<sFloat> &src, QVImage<sFloat> &dest, int interpolation = IPPI_INTER_LINEAR);
01086 
01095 void CannyGetSize(const QVGenericImage &src, QVImage<uChar> &buffer);
01096 
01106 void FilterSobelHorizGetBufferSize(const QVGenericImage &src, QVImage<uChar> &buffer, uInt maskSize = 3);
01107 
01117 void FilterSobelNegVertGetBufferSize(const QVGenericImage &src, QVImage<uChar> &buffer, uInt maskSize = 3);
01118 
01129 void MinEigenValGetBufferSize( const QVGenericImage &src, QVImage<uChar> &buffer, uInt apertureSize = 5, uInt avgWindow = 5);
01130 
01139 void FloodFillGetSize(const QVGenericImage &src, QVImage<uChar> &buffer);
01140 
01178 void Canny(QVImage<sShort> &dX, QVImage<sShort> &dY, QVImage<uChar> &dest,
01179                 QVImage<uChar> &buffer, double low = 50.0, double high = 150.0);
01180 
01183 void Canny(QVImage<sFloat> &dX, QVImage<sFloat> &dY, QVImage<uChar> &dest,
01184                 QVImage<uChar> &buffer, double low = 50.0, double high = 150.0);
01185 
01208 void MinEigenVal(const QVImage<uChar> &src, QVImage<sFloat> &dest, QVImage<uChar> &buffer,
01209         uInt apertureSize = 3, uInt avgWindow = 5, IppiKernelType kernel = ippKernelSobel);
01210 
01219 void FastMarchingGetBufferSize(const QVGenericImage &image, QVImage<uChar> &buffer);
01220 
01234 void FastMarching(const QVImage<uChar> &mask, QVImage<sFloat> &distances, int radius, QVImage<uChar> &buffer);
01235 
01278 void Inpaint(const QVImage<uChar> &src, const QVImage<uChar> &mask, const QVImage<sFloat> &distances,
01279                 QVImage<uChar> &dest, int radius = 4,  IppiInpaintFlag flag = IPP_INPAINT_TELEA);
01280 
01283 void Inpaint(const QVImage<uChar,3> &src, const QVImage<uChar> &mask, const QVImage<sFloat> &distances,
01284                 QVImage<uChar,3> &dest, int radius = 4,  IppiInpaintFlag flag = IPP_INPAINT_TELEA);
01285 
01297 QMap<sInt, int> HistogramRange(const QVImage<uChar, 1> &src, QList<uChar> values);
01298 
01306 QVector<int> HistogramRange(const QVImage<uChar, 1> &src);
01307 
01328 void FloodFillRange(QVImage<uChar> &img, QVImage<uChar> &buffer,
01329         uInt seedX, uInt seedY, uChar newVal, uChar minDelta, uChar maxDelta);
01330 
01355 void FilterGaussBorder(const QVImage<sFloat, 1> &src, QVImage<sFloat, 1> &dest, QVImage<uChar> &buffer, sInt kernelSize, sFloat sigma, IppiBorderType borderType = ippBorderConst, sFloat borderValue = 0.0);
01356 
01367 void FilterGaussGetBufferSize(const QVGenericImage &image, QVImage<uChar> &buffer, uInt kernelSize);
01368 
01388 void FindPeaks3x3(const QVImage<sInt, 1> &img, QVImage<uChar> &buffer, QList<QPoint> &points, sInt threshold, IppiNorm norm, uInt border, uInt maxPeakCount);
01389 
01392 void FindPeaks3x3(const QVImage<sFloat, 1> &img, QVImage<uChar> &buffer, QList<QPoint> &points, sFloat threshold, IppiNorm norm, uInt border, uInt maxPeakCount);
01393 
01394 
01404 void FindPeaks3x3GetBufferSize(const QVImage<sInt,1> &image, QVImage<uChar> &buffer);
01405 
01409 void FindPeaks3x3GetBufferSize(const QVImage<sFloat,1> &image, QVImage<uChar> &buffer);
01410 
01426 void FilterLaplace(const QVImage<uChar> &src, QVImage<uChar> &dest, uInt maskSize = 3);
01427 
01430 void FilterLaplace(const QVImage<sShort> &src, QVImage<sShort> &dest, uInt maskSize = 3);
01431 
01434 void FilterLaplace(const QVImage<sFloat> &src, QVImage<sFloat> &dest, uInt maskSize = 3);
01435 
01436 }
01437 #endif

Generated on Wed Jan 16 18:41:29 2008 for QVision by  doxygen 1.5.3