This is the sample program that can see the decode result of barcode data on Watson IoT.

Dependencies:   AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GlobalHistogramBinarizer.h Source File

GlobalHistogramBinarizer.h

00001 // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
00002 #ifndef __GLOBALHISTOGRAMBINARIZER_H__
00003 #define __GLOBALHISTOGRAMBINARIZER_H__
00004 /*
00005  *  GlobalHistogramBinarizer.h
00006  *  zxing
00007  *
00008  *  Copyright 2010 ZXing authors All rights reserved.
00009  *
00010  * Licensed under the Apache License, Version 2.0 (the "License");
00011  * you may not use this file except in compliance with the License.
00012  * You may obtain a copy of the License at
00013  *
00014  *      http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing, software
00017  * distributed under the License is distributed on an "AS IS" BASIS,
00018  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00019  * See the License for the specific language governing permissions and
00020  * limitations under the License.
00021  */
00022 
00023 #include <zxing/Binarizer.h>
00024 #include <zxing/common/BitArray.h>
00025 #include <zxing/common/BitMatrix.h>
00026 #include <zxing/common/Array.h>
00027 
00028 namespace zxing {
00029     
00030 class GlobalHistogramBinarizer : public Binarizer {
00031 private:
00032   ArrayRef<char> luminances;
00033   ArrayRef<int> buckets;
00034 public:
00035   GlobalHistogramBinarizer(Ref<LuminanceSource> source);
00036   virtual ~GlobalHistogramBinarizer();
00037         
00038   virtual Ref<BitArray> getBlackRow(int y, Ref<BitArray> row);
00039   virtual Ref<BitMatrix> getBlackMatrix();
00040   static int estimateBlackPoint(ArrayRef<int> const& buckets);
00041   Ref<Binarizer> createBinarizer(Ref<LuminanceSource> source);
00042 private:
00043   void initArrays(int luminanceSize);
00044 };
00045 
00046 }
00047     
00048 #endif /* GLOBALHISTOGRAMBINARIZER_H_ */