Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice
zxing_lib/zxing/common/GlobalHistogramBinarizer.h@0:7d720671e6dc, 2016-11-10 (annotated)
- Committer:
- Osamu Nakamura
- Date:
- Thu Nov 10 20:04:48 2016 +0900
- Revision:
- 0:7d720671e6dc
Initial Commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Osamu Nakamura |
0:7d720671e6dc | 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- |
| Osamu Nakamura |
0:7d720671e6dc | 2 | #ifndef __GLOBALHISTOGRAMBINARIZER_H__ |
| Osamu Nakamura |
0:7d720671e6dc | 3 | #define __GLOBALHISTOGRAMBINARIZER_H__ |
| Osamu Nakamura |
0:7d720671e6dc | 4 | /* |
| Osamu Nakamura |
0:7d720671e6dc | 5 | * GlobalHistogramBinarizer.h |
| Osamu Nakamura |
0:7d720671e6dc | 6 | * zxing |
| Osamu Nakamura |
0:7d720671e6dc | 7 | * |
| Osamu Nakamura |
0:7d720671e6dc | 8 | * Copyright 2010 ZXing authors All rights reserved. |
| Osamu Nakamura |
0:7d720671e6dc | 9 | * |
| Osamu Nakamura |
0:7d720671e6dc | 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| Osamu Nakamura |
0:7d720671e6dc | 11 | * you may not use this file except in compliance with the License. |
| Osamu Nakamura |
0:7d720671e6dc | 12 | * You may obtain a copy of the License at |
| Osamu Nakamura |
0:7d720671e6dc | 13 | * |
| Osamu Nakamura |
0:7d720671e6dc | 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
| Osamu Nakamura |
0:7d720671e6dc | 15 | * |
| Osamu Nakamura |
0:7d720671e6dc | 16 | * Unless required by applicable law or agreed to in writing, software |
| Osamu Nakamura |
0:7d720671e6dc | 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
| Osamu Nakamura |
0:7d720671e6dc | 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| Osamu Nakamura |
0:7d720671e6dc | 19 | * See the License for the specific language governing permissions and |
| Osamu Nakamura |
0:7d720671e6dc | 20 | * limitations under the License. |
| Osamu Nakamura |
0:7d720671e6dc | 21 | */ |
| Osamu Nakamura |
0:7d720671e6dc | 22 | |
| Osamu Nakamura |
0:7d720671e6dc | 23 | #include <zxing/Binarizer.h> |
| Osamu Nakamura |
0:7d720671e6dc | 24 | #include <zxing/common/BitArray.h> |
| Osamu Nakamura |
0:7d720671e6dc | 25 | #include <zxing/common/BitMatrix.h> |
| Osamu Nakamura |
0:7d720671e6dc | 26 | #include <zxing/common/Array.h> |
| Osamu Nakamura |
0:7d720671e6dc | 27 | |
| Osamu Nakamura |
0:7d720671e6dc | 28 | namespace zxing { |
| Osamu Nakamura |
0:7d720671e6dc | 29 | |
| Osamu Nakamura |
0:7d720671e6dc | 30 | class GlobalHistogramBinarizer : public Binarizer { |
| Osamu Nakamura |
0:7d720671e6dc | 31 | private: |
| Osamu Nakamura |
0:7d720671e6dc | 32 | ArrayRef<char> luminances; |
| Osamu Nakamura |
0:7d720671e6dc | 33 | ArrayRef<int> buckets; |
| Osamu Nakamura |
0:7d720671e6dc | 34 | public: |
| Osamu Nakamura |
0:7d720671e6dc | 35 | GlobalHistogramBinarizer(Ref<LuminanceSource> source); |
| Osamu Nakamura |
0:7d720671e6dc | 36 | virtual ~GlobalHistogramBinarizer(); |
| Osamu Nakamura |
0:7d720671e6dc | 37 | |
| Osamu Nakamura |
0:7d720671e6dc | 38 | virtual Ref<BitArray> getBlackRow(int y, Ref<BitArray> row); |
| Osamu Nakamura |
0:7d720671e6dc | 39 | virtual Ref<BitMatrix> getBlackMatrix(); |
| Osamu Nakamura |
0:7d720671e6dc | 40 | static int estimateBlackPoint(ArrayRef<int> const& buckets); |
| Osamu Nakamura |
0:7d720671e6dc | 41 | Ref<Binarizer> createBinarizer(Ref<LuminanceSource> source); |
| Osamu Nakamura |
0:7d720671e6dc | 42 | private: |
| Osamu Nakamura |
0:7d720671e6dc | 43 | void initArrays(int luminanceSize); |
| Osamu Nakamura |
0:7d720671e6dc | 44 | }; |
| Osamu Nakamura |
0:7d720671e6dc | 45 | |
| Osamu Nakamura |
0:7d720671e6dc | 46 | } |
| Osamu Nakamura |
0:7d720671e6dc | 47 | |
| Osamu Nakamura |
0:7d720671e6dc | 48 | #endif /* GLOBALHISTOGRAMBINARIZER_H_ */ |