Be-code: Information Embedding for Logo Images
Kazuha Yamada

Yasuna Yamashita

Masahiro Toyoura

University of Yamanashi
4-3-11 Takeda, Kofu,Yamanashi
400-8511, JAPAN

University of Yamanashi
4-3-11 Takeda, Kofu,
Yamanashi
400-8511, JAPAN

University of Yamanashi
4-3-11 Takeda, Kofu,
Yamanashi
400-8511, JAPANXiaoyang Mao

Satoshi Takatsu

Chihiro Sugawara

University of Yamanashi
4-3-11 Takeda, Kofu,
Yamanashi
400-8511, JAPANCRESCO Co., Ltd.
2-15-1 Konan, Minato-ku,
Tokyo
108-6026, JAPAN

University of Yamanashi
4-3-11 Takeda, Kofu,
Yamanashi
400-8511, JAPANABSTRACT
2D image codes are widely used for inputting information
to mobile devices with cameras. QR code is a typical example of such codes. Conventional image codes do not havesemantics in images themselves. Such codes may spoil thequality of design when attached on commercial products.
We propose a novel code, Be-code, for embedding data intologo images. Be-code is generated from a logo image bymodifying some of the edge pixels according to the bits tobe embedded, but avoiding causing obvious change to theappearance of the original logo image. Algorithm for extracting information from the camera captured Be-code isalso presented. The original logo image is not required indecoding. In experiments, embedded data could be decoded
at a high success rate.

Categories and Subject Descriptors
I.3.3 [Picture/Image Generation]: [Display algorithms];
I.4.1 [Digitization and Image Capture]: [Scanning]

General Terms
TheoryKeywords
Image code, data embedding, ﬂippability score, homography

1. INTRODUCTION
2D image codes such as QR code [6] and MicrosoftTag [3] arewidely used as an eﬀective way to bridge real world and digital world. With the popularization of camera installed mobile devices, we can ﬁnd these codes everywhere, from product packages, advertising circular to airline tickets. People

use them to connect their customers from the oﬄine marketing materials to online information, entertainment, andinteractive experiences. However, these conventional codes
do not have semantics in images themselves. Most of them
are simply 2D bar codes and hence may spoil the design
when being attached to commercial products.
In this paper, we propose a new 2D code called Be-code(Binary emblem code). Be-code is generated from a logo
image. The appearance of the original logo remains in thegenerated Be-code. Since a logo is the symbol of a brandidentity, enabling an easy link from a logo image to the online information would beneﬁt both consumers and suppliers in various applications. However, the design of Be-code
faces two challenges: First, most logos are abstracted symbols and there is little information redundancy can be used
for embedding information, whereas noticeable changes tothe original image would ruin the brand identity. Second, weshould allow easy decoding with mobile device under various
capturing conditions. Again for avoiding ruining the design,
we cannot place markers into logos, which makes it diﬃcult
to estimate locally adapted parameters for reconstruction
the original image from a captured one. We solve the ﬁrst
problem by extending the data hiding technology proposedby Wu et al. [11]. Wu et al.’s method embeds data into
binary images through ﬂipping particular pixels at boundaries. We propose a new technique to partially preserve theantialiasing eﬀect at those boundaries. To approach the second issue, we have developed a new technique to estimate
the homography between the captured image and the original coordinates using four least noticeable markers placedout of the logo. Experimental results show that Be-code
could be decoded at a high success rate with mobile devices
under casual capturing conditions.
The remainder of the paper is organized as follows: after a
brieﬂy review of related works in Section 2, section 3 gives
the overview of Be-code and its encoding/decoding procedure. Section 4 introduces the details of the proposed algorithms. Section 5 describes the results of experiments andSection 6 concludes the paper.

2. RELATED WORKS
QR code [6] represents data in black and white pattern.
Many existing work have been done to improve the designof QR code. Design QR [5] and QR-JAM [4] reserve somearea in QR code for including a small color image by making use of the redundancy of the code. ColorCode [2] andMicrosoftTag [3] use color patterns instead of the black andwhite pattern. Although those enhanced codes are visuallymore pleasing than the original QR code, they all suﬀer fromthe lacking of design ﬂexibility, since they are basically 2Dbar codes. FPcode [10] and CLIC2C [1] uses water marking technology to embed information into images. However,these techniques embed information by altering the intensity or color of original images and hence are not suitable
for many logo images, which are abstract symbols with nolocally change of color or intensity.
Miyake et al. [7] proposed a technique for encoding data
into an illustration by attaching a bold line to the contourof the illustration. Data are encoded as 1D color patternin bold line. However, the attached bold line may ruin thedesign of the logo in most cases. Pramila et al. developed
a method for embedding information into a binary image
by adding a solid rectangle frame to the image [9]. Theirmethod assumes a ﬁxed size for the image, which inherently
restricts its usefulness in real applications.
Our technology is built upon the existing binary image watermarking technique proposed by Wu et al. [11]. They
introduced the notion of ﬂippable pixels which are the pixels that can be inverted (ﬂipped) without noticeable corruption of original image, together with a method for computing the ﬂippability score by considering the smoothness
and connectivity of binary images. Although Zubarev etal. [12] improved the embedding capacity and the time efﬁciency for ﬁnding the ﬂappable pixels by employing thewet paper coding technology, we chose [11] for avoiding noticeable corruption of original images as well. While mostwatermarking techniques assume the decoding from digital
images, Be-code is mainly used for linking the real world
to online. Therefore, our major contribution is the new encoding/decoding methods allowing the extraction of information from the images captured with mobile devices undercasual capturing conditions.

3. OVERVIEW OF BE-CODE
3.1 Configuration
The structure of Be-code is shown in Figure 1. The logo isplaced in an emblem area with data embedded in its contour.
A direction marker and four frame markers are placed outof the emblem area. The direction marker indicates the lefttop of the Be-code. The frame markers are used for deﬁning
the boundary of the Be-code, as well as for estimating homography required in reconstruct the original image fromthe camera captured one. Margins are inserted for separating the logo from markers and for separating Be-code fromthe other contents.

3.2 Framework of Encoding/Decoding
The overall procedure of Be-code generation and decoding
is shown in Figure 2. A bit string is embedded into a logo
image and the frame markers are attached. Printed Be-code

Figure 1: Structure of Be-code.
is captured by a camera of mobile device. A homography isestimated based on the position of frame markers. The Becode in the original coordinates is reconstructed with thehomography matrix. The bit string is decoded from thereconstructed Be-code.
Generating
0110010 …

Print

Embed

Bit string

Logo image
Decoding

Be-codeDecodeDistribution
Reconstruct

Capture0110010 …

Bit string
Undistorted
Be-codeDistorted
image

Figure 2: Overall procedure for generating and decoding of Be-code.
Reed-Solomon coding is applied to the embedded data. A
small number of errors can be corrected when capturing theBe-code. Reed-Solomon coding also helps to validate thedecoding.

4. REALIZATION OF BE-CODE
4.1 Reconstruction from Captured Image
To reconstruct the original Be-code from a captured image,
we use the frame markers. A homography between captured
image and the original coordinates is estimated with the relative positions of frame markers in the captured image. One
problem is that the size of the original image is unknown.
We solve the problem by using a two-step mapping algorithm with the given condition that the size of frame markers is m × m pixels. At the ﬁrst step, we use the fact that
Be-code is a rectangle to compute a preliminary homography. If we assume the size of the original Be-code be w′ × h′ ,the positions of four frame markers in the captured image
give a homography. Reconstructed Be-code has correct ratio of marker size to Be-code size in both width and height,
though the correctness of the sizes themselves is not guaranteed. With the condition that the size of frame markers ism × m pixels, the correct width w and height h of Be-code
can be calculated with the following equations:w=h =m w′ /m′x′m h /m′y(1)(2)

Here, m′x and m′y are the width and height of the maker inthe preliminary reconstructed image. With the correct sizeof the original Be-code ready, the second step reconstructs
each pixel of the original Be-code with the homography.

4.2 Data embedding with flippability score
Since most logos are abstract symbols and have little redundancy in colors and intensity, we embed the data to the contour of the symbol by extending the ﬂippability score based
binary image data hiding technique proposed by Wu et al.
[11]. As shown in Figure 3, a binary image is segmented into
3 × 3 blocks and a ﬂippability score is calculated for eachblock. The ﬂippability score gives a quantitative measure
to how unnoticeable the change is when the center pixel ofthe block is ﬂipped (please refer to [11] for the details of
ﬂippability score calculation). A bit string is embedded into
the binary image by ﬂipping the center pixel of the blockwith a ﬂippability score higher than 0.5. That is, to embed
a “0”, we change the center pixel to black, and to embed a“1”. we ﬂip the center pixel to white. The most plausible
property of the ﬂippability score is that a block with a scoreabove 0.5 will retain its score to be above 0.5 after its center pixel is ﬂipped. This property enables us to extract theembedded data from the reconstructed Be-code by ﬁndingout the blocks with a score above 0.5, without referring tothe original image.

values due to anti-aliasing. It is important to preserve thosegrayscale values for keeping the visual quality of the logo.
We achieve this by performing the binarization on the ﬂy
only for calculating the ﬂippability score and for extracting
the embedded bits while leaving the grayscale values unchanged in the Be-code. However, the grayscale values of
the captured Be-code can be largely aﬀected by the illumination condition. To assure a successful binarization, weadd (or subtract) an oﬀset to (or from) the gray level of thepixels which should be converted to white (or black) withthe binarization, to keep a safety margin between them.
As shown in Fig 5, from the original grayscale image, thebinarization threshold gth is calculated with Otsu’s method[8]. The pixels with a gray level near gth may ﬂip theirvalues when the captured image is binarized. To avoid theﬂipping, we push the pixels toward the black and white end
with the oﬀsets bth = gth −c gth and wth = gth +c(255−gth ),respectively, in the following way:
1. if bth < v < gth , v = bth .
2. if gth ≤ v < wth , v = wth .
3. if else, v is not changed.
Here, c (0 < c < 1) is a user given constant for trading thevisual quality with the robustness of decoding. A smaller cremains the original grayscale more, and a larger c makes
decoding robust even when the illumination changes.
Figures 6(a) and 6(c) are an example of binary Be-code, andFigures 6(b) and 6(d) are the Be-code generated with theproposed method. We can see that the anti-aliasing eﬀects
are partially preserved in the Be-code of Figure 6(b) and6(d).
gthFigure 3: Examples of ﬂippablility scores of 3 × 3blocks.
Wu et al’s original method segments an image into nonoverlapping 3 × 3 blocks. We segment an image into blocks
with one pixel line overlapped as shown in Figure 4. While
the original method takes 1/9 pixels of the whole image as
the candidate for ﬂipping, our proposed segmentation canmake use of 1/4 pixels of the whole image, and hence has alarger embedding capacity than the original method.
nth Blockn+1th Block: Originalgrayscale
0Centerpixel

gthwth: Grayscale forbinarization

0255

Figure 5: Conversion of grayscale considering binarization.

nth Block n+1th Block5.
Centerpixel255
bthCenter Centerpixelpixel

Without overlapping With overlappingFigure 4: Increasing the embedding capacity byoverlapping blocks.

4.3 Preserving of Anti-Aliasing
Although a logo image usually has ﬂat color or intensity, thepixels at the boundary of the symbol usually have grayscale

EXPERIMENT

We have conducted experiments to investigate the capacityof embedding, the success rate of decoding and the visualquality of Be-code for a variety of logo images. In the experiment, Be-code is captured and decoded with Xperia(SO01B) made by Sony Ericsson as shown in Figure 7.
Figure 8 shows several examples of generated Be-codes together with the amounts of embedded data. The size of eachoriginal image is 110×80 pixels. Logos with relative complex
shape, such as (a) and (c), have larger embedding capacity.
The logo with diagonal lines, such as (b), also has a large capacity. By overlapping blocks for selecting ﬂippable pixels,
we succeeded in increase the capacity of embedding.

(a) Be-code with binary
values.

(b) Be-code with grayscalevalues.

(a) Monkey(b) Letter(c) Snow

58 bits

56 bits

45 bits

145 bits

113 bits

86 bits

OriginalimagesBe-code(c=1)(c) Zoom-up image of (a).

(d) Zoom-up image of (b).

Figure 6: Preserving anti-aliasing in Be-code.

Be-code(c=1/2)

Be-code(c=1/3)(a) Experimental environment.

(b) An example ofcaptured images.

Figure 7: Experimental environment for capturing
Be-codes.

Nonoverlapping
Overlapping

Figure 8: Be-codes and their embedding capacity.
Figure 8 also shows the results obtained by varying the parameter c for controlling the tradeoﬀ between anti-aliasing
eﬀect and robustness. A smaller c retains the original grayscale
more. A subject captured each Be-code 100 times under ausual illumination condition of our laboratory. The successpercentage of decoding are shown in Table 1. Be-codes withc = 1/2 has a success rate closing to 100% for all images.

Table 1: Success rate of decoding Be-codes with c =1/3 and c = 1/2, 1.
cMonkeyLetterSnow

1/3
34.0 %
91.0 %
51.0 %

1/2
98.0 %
100.0 %
100.0 %

1
100.0 %
99.0 %
100.0 %

6. CONCLUSIONSWe proposed Be-code as a new technique for linking logo
images with online information. In experiments, embedded
data could be decoded at a high success rate.
As a future work, we need to conﬁrm the robustness of Becode when captured outdoors or under some special illumination environments. Currently our algorithm can only beapplied to grayscale logo images or the logo images consisting of a single color. Extension to logos with multiple colors
is another important future work.

7. REFERENCES[1] A. M. Alattar. Smart images using digimarc’s
watermarking technology. 3971(25):264–273, 2000.
[2] ColorCode, http://www.colorzip.com.

[3] Microsoft Tag, http://tag.microsoft.com/.
[4] M. Hagiwara. Decorated 2D codes. The Journal of theInstitute of Electronics, Information andCommunication Engineers, 94:341–343, 2011.
[5] Design QR, http://d-qr.net/.
[6] QRcode, http://www.qrcode.com/en/index.html.
[7] T. Miyake and S. Kuriyama. Data embedding bychanging brightness on shape contours. IEICE
TRANSACTIONS on Fundamentals of Electronics,Communications and Computer Sciences (JapaneseEdition), J93-A(2):73–81, 2010.
[8] N. Otsu. A threshold selection method from gray-level
histograms. IEEE Transactions on Systems, Man andCybernetics, 9(1):62–66, 1979.
[9] A. Pramila, A. Keskinarkaus, and T. Seppaenen.
Reading watermarks from printed binary images witha camera phone. 5703:227–240, 2009.
[10] G. Suzuki, N. Yamaguchi, S. Nakamura, andH. Chiba. Mobile interaction using steganographic
image on mobile display. In Proceedings of the 10thinternational conference on Human computerinteraction with mobile devices and services, pages
507–510, 2008.
[11] M. Wu and B. Liu. Data hiding in binary image forauthentication and annotation. IEEE Transactions onMultimedia, 6(4):528–538, 2004.
[12] M. Zubarev, V. I. Korzhik, and G. Morales-Luna. Wet
paper coding for watermarking of binary images.
CoRR abs/0808.2486, 2008.