| ARX 1.0 The next-generation open source augmented reality toolkit.

Loading...
Searching...
No Matches
arImageProc.h
Go to the documentation of this file.
1/*
2 * arImageProc.h
3 * artoolkitX
4 *
5 * This file is part of artoolkitX.
6 *
7 * artoolkitX is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * artoolkitX is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * As a special exception, the copyright holders of this library give you
21 * permission to link this library with independent modules to produce an
22 * executable, regardless of the license terms of these independent modules, and to
23 * copy and distribute the resulting executable under terms of your choice,
24 * provided that you also meet, for each linked independent module, the terms and
25 * conditions of the license of that module. An independent module is a module
26 * which is neither derived from nor based on this library. If you modify this
27 * library, you may extend this exception to your version of the library, but you
28 * are not obligated to do so. If you do not wish to do so, delete this exception
29 * statement from your version.
30 *
31 * Copyright 2018 Realmax, Inc.
32 * Copyright 2015-2016 Daqri, LLC.
33 * Copyright 2010-2015 ARToolworks, Inc.
34 *
35 * Author(s): Philip Lamb
36 *
37 */
38
45#ifndef AR_IMAGEPROC_H
46#define AR_IMAGEPROC_H
47
48#ifndef TRUE
49# define TRUE 1
50#endif
51#ifndef FALSE
52# define FALSE 0
53#endif
54
55#include <ARX/AR/config.h>
56
57#ifdef __cplusplus
58 extern "C" {
59#endif
60
61#ifdef __APPLE__
62# define AR_IMAGEPROC_USE_VIMAGE 1
63#endif
64
68 struct _ARImageProcInfo {
69 unsigned char *__restrict image2;
70 int imageX;
71 int imageY;
72 unsigned long histBins[256];
73 unsigned long cdfBins[256];
74 unsigned char min;
75 unsigned char max;
76#if AR_IMAGEPROC_USE_VIMAGE
77 void *tempBuffer;
78#endif
79};
80 typedef struct _ARImageProcInfo ARImageProcInfo;
81
82#ifdef __cplusplus
83}
84#endif
85
86#include <ARX/AR/ar.h>
87
88#ifdef __cplusplus
89 extern "C" {
90#endif
91
105 ARImageProcInfo *arImageProcInit(const int xsize, const int ysize);
106
115 void arImageProcFinal(ARImageProcInfo *ipi);
116
125 int arImageProcLumaHist(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr);
126
144 unsigned char *arImageProcGetHistImage(ARImageProcInfo *ipi);
145
152 int arImageProcLumaHistAndCDF(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr);
153
160 int arImageProcLumaHistAndCDFAndPercentile(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, const float percentile, unsigned char *value_p);
161
168 int arImageProcLumaHistAndCDFAndMedian(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, unsigned char *value_p);
169
178 int arImageProcLumaHistAndOtsu(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, unsigned char *value_p);
179
189 int arImageProcLumaHistAndBoxFilterWithBias(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, const int boxSize, const int bias);
190
197 int arImageProcLumaHistAndCDFAndLevels(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr);
198
199#ifdef __cplusplus
200}
201#endif
202
203#endif // !AR_IMAGEPROC_H
ar.h
artoolkitX core routines.
ARUint8
unsigned char ARUint8
Definition: ar.h:92
arImageProcLumaHistAndCDFAndPercentile
int arImageProcLumaHistAndCDFAndPercentile(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, const float percentile, unsigned char *value_p)
Calculate image histogram, cumulative density function, and luminance value at a given histogram perc...
Definition: arImageProc.c:128
arImageProcLumaHistAndCDFAndMedian
int arImageProcLumaHistAndCDFAndMedian(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, unsigned char *value_p)
Calculate image histogram, cumulative density function, and median luminance value.
Definition: arImageProc.c:148
arImageProcLumaHistAndOtsu
int arImageProcLumaHistAndOtsu(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, unsigned char *value_p)
Calculate image histogram, and binarize image using Otsu's method for foreground/background separatio...
Definition: arImageProc.c:153
arImageProcFinal
void arImageProcFinal(ARImageProcInfo *ipi)
Finish image processing and free memory.
Definition: arImageProc.c:59
arImageProcLumaHist
int arImageProcLumaHist(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr)
Calculate luminance histogram.
Definition: arImageProc.c:69
arImageProcInit
ARImageProcInfo * arImageProcInit(const int xsize, const int ysize)
Initialise image processing.
Definition: arImageProc.c:45
arImageProcLumaHistAndCDFAndLevels
int arImageProcLumaHistAndCDFAndLevels(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr)
Calculate image histogram, cumulative density function, and minimum and maximum luminance values.
Definition: arImageProc.c:254
arImageProcLumaHistAndBoxFilterWithBias
int arImageProcLumaHistAndBoxFilterWithBias(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, const int boxSize, const int bias)
Calculate image histogram, and box filter image.
Definition: arImageProc.c:202
arImageProcGetHistImage
unsigned char * arImageProcGetHistImage(ARImageProcInfo *ipi)
Get luminance histogram as an image.
Definition: arImageProc.c:89
arImageProcLumaHistAndCDF
int arImageProcLumaHistAndCDF(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr)
Calculate image histogram and cumulative density function.
Definition: arImageProc.c:110
_ARImageProcInfo
Structure holding settings for an instance of the image-processing pipeline.
Definition: arImageProc.h:68
_ARImageProcInfo::histBins
unsigned long histBins[256]
Luminance histogram.
Definition: arImageProc.h:72
_ARImageProcInfo::image2
unsigned char *__restrict image2
Extra buffer, allocated as required.
Definition: arImageProc.h:69
_ARImageProcInfo::imageY
int imageY
Height of image buffer.
Definition: arImageProc.h:71
_ARImageProcInfo::imageX
int imageX
Width of image buffer.
Definition: arImageProc.h:70
_ARImageProcInfo::min
unsigned char min
Minimum luminance.
Definition: arImageProc.h:74
_ARImageProcInfo::max
unsigned char max
Maximum luminance.
Definition: arImageProc.h:75
_ARImageProcInfo::cdfBins
unsigned long cdfBins[256]
Luminance cumulative density function.
Definition: arImageProc.h:73