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
58extern "C" {
59#endif
60
61#ifdef __APPLE__
62# define AR_IMAGEPROC_USE_VIMAGE 1
63#endif
64
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};
81
82#ifdef __cplusplus
83}
84#endif
85
86#include <ARX/AR/ar.h>
87
88#ifdef __cplusplus
89extern "C" {
90#endif
91
105ARImageProcInfo *arImageProcInit(const int xsize, const int ysize);
106
116
125int arImageProcLumaHist(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr);
126
144unsigned char *arImageProcGetHistImage(ARImageProcInfo *ipi);
145
152int arImageProcLumaHistAndCDF(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr);
153
160int arImageProcLumaHistAndCDFAndPercentile(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, const float percentile, unsigned char *value_p);
161
168int arImageProcLumaHistAndCDFAndMedian(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, unsigned char *value_p);
169
178int arImageProcLumaHistAndOtsu(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, unsigned char *value_p);
179
189int arImageProcLumaHistAndBoxFilterWithBias(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr, const int boxSize, const int bias);
190
197int arImageProcLumaHistAndCDFAndLevels(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr);
198
199#ifdef __cplusplus
200}
201#endif
202
203#endif // !AR_IMAGEPROC_H
artoolkitX core routines.
unsigned char ARUint8
Definition: ar.h:92
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
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
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
void arImageProcFinal(ARImageProcInfo *ipi)
Finish image processing and free memory.
Definition: arImageProc.c:59
int arImageProcLumaHist(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr)
Calculate luminance histogram.
Definition: arImageProc.c:69
ARImageProcInfo * arImageProcInit(const int xsize, const int ysize)
Initialise image processing.
Definition: arImageProc.c:45
int arImageProcLumaHistAndCDFAndLevels(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr)
Calculate image histogram, cumulative density function, and minimum and maximum luminance values.
Definition: arImageProc.c:254
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
unsigned char * arImageProcGetHistImage(ARImageProcInfo *ipi)
Get luminance histogram as an image.
Definition: arImageProc.c:89
int arImageProcLumaHistAndCDF(ARImageProcInfo *ipi, const ARUint8 *__restrict dataPtr)
Calculate image histogram and cumulative density function.
Definition: arImageProc.c:110
Structure holding settings for an instance of the image-processing pipeline.
Definition: arImageProc.h:68
unsigned long histBins[256]
Luminance histogram.
Definition: arImageProc.h:72
unsigned char *__restrict image2
Extra buffer, allocated as required.
Definition: arImageProc.h:69
int imageY
Height of image buffer.
Definition: arImageProc.h:71
int imageX
Width of image buffer.
Definition: arImageProc.h:70
unsigned char min
Minimum luminance.
Definition: arImageProc.h:74
unsigned char max
Maximum luminance.
Definition: arImageProc.h:75
unsigned long cdfBins[256]
Luminance cumulative density function.
Definition: arImageProc.h:73