2D Cellular Automata with an Image Processing Application

militaryzoologistΤεχνίτη Νοημοσύνη και Ρομποτική

1 Δεκ 2013 (πριν από 3 χρόνια και 9 μήνες)

114 εμφανίσεις

Vol. Xxxx (xxx) ACTA PHYSICA POLONICA A No. Xxx

Proceedings of the 3nd International Congress APMAS2013, April 24_28, 2013, Antalya, Turkey

2D

Cellular Automata w
ith a
n Image Pro
cessing Application

S. UGUZ
a
, U. SAHIN
b
, I. SIAP
c

AND H. AKIN
d

a
Department of Mathematics, Arts and Science Faculty, Harran University, Sanliurfa, 63120, Turkey

b
Multi Agent Biorobotic Laboratory, Rochester Institute of Technology, Rochester
-
NY USA

c
Depart
ment of Mathematics, Yildiz Technical University, 34210, Istanbul
-
Turkey

d
Department of Mathematics, Education Faculty, Zirve University, 27260, Gaziantep, Turkey


Abstract:

This paper investigates

the theor
etical aspects of two dimensional linear cellular

automata
with image

applications
.
We consider geometrical and visual aspects of patterns generated by
cellular automata
evolution. The present

work focuses
on the theory of two dimensional linear
cellular automata
with respect to uniform periodic and adia
batic

boundary
cellular
automata
(2D PB and AB) conditions. Multiple copies of any arbitrary image correspond to
cellular automata
find
so many

applications in real life situation e.g. textile design, DNA genetics research, etc.


Keywords:
Cellular automat
a, Self replicating patterns, Image Processing.

PACS:

02.10.Yn
;

07.05.Kf
;

02.10.Ox
.

1.

Introduction

Cellular

automata
(CAs

for

brevi
t
y)

i
n
tr
o
duced

b
y

Ulam and
v
on

Neumann [14]

in

the
early

1950’s
,

h
a
v
e
b
een
systematically

studied
b
y

Hedlund from

purely
mathematical

p
oi
n
t

of

view.
One
dimensional

CA
has

b
een
investigated

to
large
extend. H
ow
e
v
er,

little
interest

has

b
een

gi
v
en

to

t
w
o

dimensional
cel l ul ar

automata

(2DCA).
v
on

Neu
mann
[
14]

sh
ow
ed

that

a

cellular

automaton

can

b
e

uni
v
ersal.

D
ue

to

its complexi
t
y
,
v o n

Neumann
r ul e s

w
ere

ne
v
er
impleme
n
ted

on

a

computer.
In

the

b
eginning

of the

eig
h
ties, Stephen

W
olfram

[15]

has studied

i
n

m
u
c
h detail a

family

of

simple
one
-
dimensional
(
1D)
CA

rul
es

and

sh
ow
ed
that

e
v
en

these
simplest
r ul es

are capable of

e
m
ulating
c o mp l e x

behavior
.
Some
basic

and
precise

mathematical

m
o
dels

using

matrix

algebra

o
v
er

the
binary

field

whi
c
h

c
haracterize

the

b
eh
a
vior

of

2D

nearest neig
h
b
orh
o
o
d linear

CA

with

n
ull

and

p
eri
o
dic

b
oundary

conditions h
a
v
e

seen

in
the

literature

[7,

8].

CA
has

recei
v
ed
remarkable

atte
n
tion

in

the
last

few

decades [1,

2,

8].
Due to
its

structure

CA

has
given

the
op
p
ortuni
t
y

to

m
o
del

and
understand

ma
n
y
b
eh
a
viors

in

nature

easier.

Most

of

the

w
ork

for

CA

is

done
for

one

dimensional

case. The

set
of

pa
p
ers

[4,

8]

deal
s

with

the
b
eh
a
vior

of

the

uniform
2D
CA

o
v
er

binary

fields.

In

this

pa
p
er,

w
e

study

the

theory of 2
-
dimensional uniform

p
eri
o
dic

and

adiabatic
b
oundary

CA

(2D

PCA,
A
CA)
of

the

all

linear rules

(e.g.

v
on

Neumann, M
o
ore

neig
h
b
orh
oo
d and
the
others) and
applications

of

image

pr
o
cessing

for

self

replicating

patterns

(see

Figs.

1
-
8
)
.
We

prese
n
t

some

illustrati
v
e

examples

and

fi
gures

to

explain
the

meth
o
d
in

details.

Using

the

rule

matrices
obtained

in

this

w
ork,

the

prese
n
t

pa
p
er

co
n
tributes

further
to

the

algebraic
structure

of

these
CA

and

relates its

applications

studied
b
y

differe
n
t

authors

previously

(i.e. [5,
15]).

The

li
near

co
m
bination
of

the

neig
h
b
oring
cells

on

whi
c
h

ea
c
h

cell

v
alue

is

de
p
ende
n
t

is

called

the

rule

n
u
m
b
er of

the

2D

CA

o
v
er
the

field

Z
2
.
Regarding

the

neig
h
b
orh
oo
d

of

the

extreme cells,

there exist

four

differe
n
t

approa
c
hes.




A

n
ull

b
oundary

(NB)

CA

is

the

one

whi
c
h

the

extreme

cells

are

connected

to

0
-
state.




A

p
eri
o
dic

b
oundary

(PB
)
CA

is

the

one

whi
c
h

the

extreme
cells

are

adjace
n
t

to

ea
c
h

other.




A

adiabatic

b
oundary

(AB)

CA

is

duplicating

the

v
alue

of

the

cell

in

an

extra
virtual

nei ghbor
.

2.

Rule

Matrices

w
ith Primary Rules

1
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
,
0 0 0 0 0 0
0 0 0 0 0 1
0 0 0 0 0 0
T
 
 
 
 
 

 
 
 
 
 
 
2
0 0 0 0 0 0
1 0 0 0 0 0
0 1 0 0 0 0
,
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
T
 
 
 
 
 

 
 
 
 
 
 

Lemm
a

1. [7]

The

r
ep
r
esentation

of

the

next

state

of

a
l
l

primary
rules

(1
,

2
,

4
,

8
,

16
,

32
,

64
,

128

and

256)
under

the

nu
l
l

b
oundary

c
ondition
can

b
e

given

by

using

the

auxili
ary
matrices

T
1

and

T
2
defin
e
d

a
b
ove

in
the

fo
l
lowing

way:

R
u
l
e

1
N

:

[
X
t
+1

]

=

[
X
t

]

R
u
l
e

2
N

:

[
X
t
+1

]

=

[
X
t

][
T
2

]

R
u
l
e

4
N

:

[
X
t
+1

]

=

[
T
1

][
X
t

][
T
2

]

R
u
l
e

8
N

:

[
X
t
+1

]

=

[
T
1

][
X
t

]


R
u
l
e

16
N

:

[
X
t
+1

]

=

[
T
1

][
X
t

][
T
1

]

R
u
l
e

32
N

:

[
X
t
+1

]

=

[
X
t

][
T
1

]

R
u
l
e

64
N

:

[
X
t
+1

]

=

[
T
2

][
X
t

][
T
1

]

R
u
l
e

128
N

:

[
X
t
+1

]

=

[
T
2

][
X
t

]

R
u
l
e

256
N

:

[
X
t
+1

]

=

[
T
2

][
X
t

][
T
2

]
.

Rule

matrices

under

p
eri
o
dic
b
oundary

1
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
,
0 0 0 0 0 0
0 0 0 0 0 1
1 0 0 0 0 0
p
T
 
 
 
 
 

 
 
 
 
 
 
2
0 0 0 0 0 1
1 0 0 0 0 0
0 1 0 0 0 0
,
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
p
T
 
 
 
 
 

 
 
 
 
 
 

Theorem

2.
(
Peri
o
dic
case
)

The
Matrix

for

any

p
eri
o
dic

b
oundary

CA

rule

(PB)

c
an

b
e

r
ep
r
esent
e
d
as


( ),
p p p
p p p
p p p
PB mn mn
p p p
p p p
p p p
A B O O O D
C A B O O O
O C A B O O O
T
O O O C A B O
O O O C A B
E O O O C A

 
 
 
 
 

 
 
 
 
 
 

whe
r
e

A
p

,

B
p

,

C
p

,

D
p

,

E
p
a
r
e

one

of

the

fo
l
lowing

matri
c
es of

the

o
r
der

of

n

×

n

0
,

I

,

T
1
p
,

T
2
p
,

I

+

T
1
p
,

I

+

T
2
p
,

T
1
p

+

T
2
p

and

I

+

T
1
p
+

T
2
p
.


Lemma

3.
The
next

state

of

a
l
l

primary
rules

(1,

2,

4,

8,

16,

32,

64,

128,

256)

of

2D

p
eri
o
dic

c
e
l
lular
automaton
ov e r

Z
2

c
an

b
e

r
ep
r
esent
e
d
as

fo
l
lows:

R
u
l
e
1
P

:

[
X
t
+1

]

=

[
X
t

]

R
u
l
e
2
P

:

[
X
t
+1

]

=

[
X
t

][
T
2
p

]

R
u
l
e
4
P

:

[
X
t
+1

]

=

[
T
1
p

][
X
t

][
T
2
p

]

R
u
l
e
8
P

:

[
X
t
+1

]

=

[
T
1
p

][
X
t

]

R
u
l
e
16
P

:

[
X
t
+1

]

=

[
T
1
p

][
X
t

][
T
1
p

]

R
u
l
e
32
P

:

[
X
t
+1

]

=

[
X
t

][
T
1
p

]

R
u
l
e
64
P

:

[
X
t
+1

]

=

[
T
2
p

][
X
t

][
T
1
p

]

R
u
l
e
128
P

:

[
X
t
+1

]

=

[
T
2
p

][
X
t

]

R
u
l
e
256
P

:

[
X
t
+1

]

=

[
T
2
p

][
X
t

][
T
2
p
]
.

Rule

matrices



under

adiabatic

b
oundary

1
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
,
0 0 0 0 0 0
0 0 0 0 0 1
0 0 0 0 0 1
a
T
 
 
 
 
 

 
 
 
 
 
 
2
1 0 0 0 0 0
1 0 0 0 0 0
0 1 0 0 0 0
,
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
a
T
 
 
 
 
 

 
 
 
 
 
 

The

auxiliary
ma
trices

T
1
a
and

T
2
a
for

the

adiabatic

b
oundary

case

are

defined

as

foll
o
ws;

hence

w
e

get

the

foll
o
wing

general

rule

matrix

result
for

the

adiabatic

case

as

a

theorem.

Theorem

4.

(
A
dia
b
atic

c
ase)

The
rule

matrix
f or

any

adia
b
atic

b
oundary

CA
rule

(AB)

c
an

b
e

r
ep
r
e
sent
e
d
as

( ),
a a
a a a
a a a
AB mn mn
a a a
a a a
a a
A B O O O O
C A B O O O
O C A B O O O
T
O O O C A B O
O O O C A B
O O O O C A

 
 
 
 
 

 
 
 
 
 
 

whe
r
e

A
a

,

B
a

,

C
a

a
r
e

one

of

the

fo
l
lowing

matri
c
es of

the

o
r
der

of

n

×

n:

0
,

I

,

T
1
a

,

T
2
a

,

I

+

T
1
a

,

I

+

T
2
a
,
T
1
a

+

T
2
a

and

I

+

T
1
a

+

T
2
a

.


Lemma

5.

The
next

state

of

a
l
l

primary rules

(1,

2,

4,

8,

16,

32,

64,

128,

256)

of

2D

adia
b
atic

c
e
l
lular
automaton
wi t h

Z
2

c
an

b
e

r
ep
r
esent
e
d as

fo
l
lows:

R
u
l
e
1
AB

:

[
X
t
+1
]

=

[
X
t

]
,

R
u
l
e
2
AB

:

[
X
t
+1

]

=

[
X
t

][
T
1
a

]
t
,
R
u
l
e
4
AB

:

[
X
t
+1

]

=

[
T
1
a

][
X
t

][
T
1
a

]
t



R
u
l
e
8
AB

:

[
X
t
+1
]

=

[
T
1
a

][
X
t

]
,
R
u
l
e
16
AB

:

[
X
t
+1

]

=

[
T
1
a

][
X
t

][
T
2
a

]
t
,
R
u
l
e
32
AB

:

[
X
t
+1

]

=

[
X
t

][
T
2
a

]
t

R
u
l
e
64
AB
:

[
X
t
+1
]

=

[
T
2
a

][
X
t

][
T
2
a

]
t
,
R
u
l
e
128
AB

:

[
X
t
+1

]

=

[
T
2
a

][
X
t

]
,

R
u
l
e
256
AB
:

[
X
t
+1

]

=

[
T
2
a

][
X
t

][
T
1
a

]
t



3.

Application o
f

Im
a
ge Processing

Self

replicating
pat t er n

generation
i s

one

of

the
most

i
n
teresting

topic

and
research

area

in

nonlinear
science. A

motif
is

considered
as

a

basic

sub
-
pattern.

P
attern

ge
neration is

the

pr
o
cess

of

transforming
copies

of

the

motif

a
b
out

the

arr
a
y

(1D),

plane

(2D)

or

space

(3D)

in

order

to

create

the

whole

re
p
eating
pattern

with

no

ov
erlaps

and blank

[14,

15].
These
patterns

h
a
v
e some

mathematical

pro
p
erties
wh i c h

ma
k
e

gene
rating
al gor i t hm

p
ossible.

A

cellular

automaton

is

a

g
o
o
d

candidate

algorithmic

approa
c
h

used
for

pattern

generation.


Figure

1.

An

application

of

Rule

8

wit

n
ull

(NB),

p
eri
o
dic

(PB)
and
adiabatic

(AB)

b
oundary

res
p
ecti
v
ely
after
32

iterations

of

the

firs
t

image.


Figure

2.

An

application

of

Rule

65

after
32

iterations

of

the

first

image.


Figure

3.

An

application

of

Rule

82

after

32

iterations

of

the

first

image.


Figure

4.

Application

of

Rule

112

after

32

iterations

of

the

first

image.

Creating

algo
rithmic

approa
c
h

for

generating
self

replicating
patt erns

of

digital

images

(motif

as

in

first
image)

is

im
p
orta
n
t

and

sometimes
difficult

task.

Mea
n
while

ma
n
y

resear
c
hers
face

with

ma
n
y

c
hallenges
in

building

and

de
v
eloping

tiling

algorithms
such

as

pr
o
v
iding
simple

and

applicable
algorithm

to

descri
b
e
high

complex

patterns

m
o
del.

Gr
o
wth
from

simple

motif

in

2D

CAs

can

pr
o
duce
self

replicating
pat t er ns

with

complicated
boundar i es

(
n
ull,
p
eri
o
dic,

adiabatic

and

reflexi
v
e),

c
haracterized

b
y

a

v
arie
t
y
of

gr
o
wth
dimensions. The

approa
c
h

gi
v
en

here

leads

to

an

accurate

algorithm

for

generating
di f f er ent

patterns.

In
this

pa
p
er we

use

the

CAs

with

all

the

nearest
neighborhoods

to

generate
self

replicate
patterns

of

digital
images.

F
or

applying

2D

n
ull,

p
eri
o
dic

and

adiabatic
CA

linear

rules

in

image

pr
o
cessing,

w
e

ta
k
e

a

binary
matrix
o f

size

(100

×

100)

due
to

computational

limitations.

W
e

map

ea
c
h
element

of

the

matrix

to

a
unique

pixel

on

the

screen

(writing

new

M
A
TLAB
codes
)

and
we

color

a

pixel

white

for 0
,
black

for

1 for

the
matrix

el e ment s
.

Then

w
e

ta
k
e
another
i ma ge

(as

a

motif
)

whose

size

is

less

than (30

×

30)

fo
r
whi
c
h

patterns

are

to

b
e

generated

and

put

it

in

the

ce
n
ter

of

the

binary

matrix.

This

is

the

w
a
y
,

h
o
w

the
image

is

dr
a
wn
within

an

area

of

(100

×

100)

pixels. It

is

obser
v
ed

from

the

figures

that

the

self

replicating
patterns

can

b
e

generated

only

when

n
u
m
b
er
of

re
p
etition

is

2
n

where

(n=4).

A

neig
h
b
orh
o
o
d
funct i on

that

s
p
ecifies

whi
c
h

of

the

cells

adjace
n
t

cells

affects

its

state
al so

determ
ines
h
o
w

ma
n
y
copi es

will

b
e

obtained

from

the

self
-
replicating
p r o c e s s
.
In the
t wo

dimensional
a nd

eight

neig
h
b
orh
o
o
ds

case,

this

should

b
e

at most

eig
h
t

copies

of

the

original

image

itself. This

situation

brings


Figure

5.

An

application

of

Rule

189

af
ter

16

iterations

of

the

first

image


Figure

6.
Application

of

Rule

201

after
16

iterations

of

the

first

image.



Figure

7.
Application

of

Rule

261

after
32

iterations

of

the

first

image.



Figure

8.

Application

of

Rule

345

after 16

iterations

of

the

f
irst

image


also

some

the

limitation

ov
er

the

matrix

size

of the

images

to

b
e

replicated.

The

matrix
size

of the

original
images

should

l
ow
er

30

p
erce
n
t

of

the

displ
a
y

matrix in

all

directions.

If

the

first

image exceeds 30

p
erce
n
tage

of

the length of

r
o
w

or
column

of

the
displ
a
y
mat r i x
,

self
replication
pat t er n

when

the

iteration

n
u
m
b
er
t

rea
c
hes

to

16

d
o
es

not

o
ccur.
Also

b
eh
a
viors

for

differe
n
t
b
oundaries

pr
o
duce
differe
n
t

sha
p
es when

t

=
16. Hence

w
e

h
a
v
e

a

classification device

and
tables
up

to
self

r
eplicating
pat t er n

n
u
m
b
er
and

for

the

case

seed

image

less

than
30

p
erce
n
tage

of

the

displ
a
y
matrix

(see

Figs.

1
-
8), these

will

b
e

prese
n
ted

in

the

next
studies
.

4.

Conclusion

In

this pa
p
er

w
e

discuss
the theory

2
-
dimensional, uniform
p
eri
o
dic

and

adiabatic

b
oundary

CAs

of linear rules

and
applications

of

image

pr
o
cessing. It is

seen

that

CAs

theory can

b
e

applied
successfully
in

self

replicating
patterns

of

image

pr
o
cessing.

The

some

c
haracterization

and

applications

on

a

2D

finite
CA

b
y

using
matrix

a l g e b r a

built
on

Z
3
are planned

to

next

studies.

H
o
w
e
v
er

after making use

of

the
matrix

represe
n
tation

of 2D

CA,

it

will

b
e

pr
o
vided an

algorithm

to

obtain the

n
u
m
b
er
of

Garden of
Eden
configurations for

the

2D

CA

defined

b
y

some

rules.

Acknowledgements:

This work

is supported by "The Scientific and Technological Research Council of Turkey" (TÜB
İTAK)
(Project Number: 110T713).

References

[1]

Akın
H
.
,
On

the

di r ect i onal

e
n
tro
p
y

of

Z
2
actions

generated

b
y
additive

cellular

automata,

Appl.
Math.

Computation

170

(1)

(2005)
339
-
346.

DOI:
10.1016/j.amc.2004.11.032

[2]

Akın H., Siap

I.,

On
cellular

automata

ov
er Galois

rings,
Infor
.

Pr
o
ces
.

Letters,

103

(1)

(2007)

24
-
27.

DOI:
10.1016/j.ipl.2007.02.002

[3]

Akın H.,

Siap

I., Uguz

S.,

Structure

of

2
-
dimensional

hexagonal

cellular

automata
,
AIP
Conf
.

Pr
o
ceed
.
,
V
olume

1309,

(2010)

p.

16
-
26.

DOI:
10.1063/1.3525111

[4]

Chatto
p
d
h
ya
y
P
.,

Choud
h
ury

P
.

P
.,

Dihidar

K.,

Characteriz
ation

of

a

particular

h
ybrid

transformation

of

t
w
o
-
dimensional
cellular

automata,

Comput.

Mat
h.

App.

38,

(1999),

p.

207
-
216

DOI:
10.1016/S0898
-
1221(99)00227
-
8

[5]

Choud
h
ur
y
,

P
.
P
.,

Sah
o
o, S.,

Hassan,

S.

S.,
Basu,

S.,

Ghosh,

D.,

Kar,

D.,
Ghosh,

Ab.,

Ghosh,

Av.,
Ghosh

A.K.,

Classifi
cation

of

cellular

automata

rules

based

on

their

pro
p
erties,

I
n
t.

J.

o
f

Comp.

Cogn.
8,
(2010), p.

50
-
54.

[6]

Chou

H.H., Reggia
J.

A.,

Emergence

of

self
-
replicating

structures

in

a

cellular

automata

space,

P
h
ysica

D:

110,

(1997),
252
-
276.

doi.org/10.101
6/S0167
-
2789(97)00132
-
2

[7]

Choud
h
ury

P
.

P
.,

N
ay
ak

B.

K.,

Sah
o
o

S.,

Rath

S.

P
.,

Theory

and

a
p p l i c a t i o n s

of

t
w
o
dimensional,

null
-
b
oundar
y
,
nine
-
neig
h
b
orh
oo
d,

cellular

automata

linear

rules
,
Tech. Report

No.

ASD/2005/4,

13

M
a
y
2005
,
arXiv:0804.2346
.

[8]

Dihidar

K
.,
Choud
h
ury

P
.

P
.,

Matrix

algebraic

for
m
ulae

concerning

some

exceptional

rules

of

t
w
o

dimensional

cellular
automata,

Inf.

Sci.

165

(2004)
91
-
101.

doi.org/10.1016/j.ins.2003.09.024

[9]

Gr
a
vner J.,

Gliner

G.,
P
elfrey

M.
,
Replication

in

one
-
dimensional

cellular

automata,

P
h
ysica

D:

240,

(18),

(2011),
1460
-
1474.

doi.org/10.1016/j.physd.2011.06.015

[10]

Siap

I.,

Akın H.,

Uguz

S.,

Structure

and

re
v
ersibili
t
y

of

2D

hexagonal

cellular

automata,

Comput
.

Math
.

Applications,

62, (2011
)
4161
-
4169.

DOI:
10.1016/j.camwa.2011.09.066

[11]

Siap

I., Akın H.

and
Sah

F.,
Characterization

of

t
w
o

dimensional

cellular

automata

ov
er
ter
nary

fields,

J
.

of

the

F
rank
.

Inst
.
,

348

(2011),

1258
-
1275.

DOI:
10.1016/j.jfranklin.2010.02.002

[12]

Siap I.,

Akın

H.

and Sah F.,

Garden

of

Eden

configurations

for

2
-
D

cellular

automaton

with

rule 2460N,
Infor
.

Sciences,

180

18

(2010)
3562
-
3571.

DOI:
10.1016
/j.jfranklin.2010.02.002

[13]

Uguz

S.,

Akın

H.,
Siap

I.,

Re
v
ersibili
t
y

algorithms

for

3
-
state

hexagonal

cellular

automata

with
p
eri
o
dic

boundaries
,
I
n
tern
.
J
.

Bifur
.

and
Chaos
,

23
, (2013)


1350101
-
1
-
15,
DOI: 10.1142/S0218127413501010

[14]

v
on
Neumann

J.,

The
theory

of

self
-
repr
o
ducing

automata, (Edited

b
y
A.

W.

Burks),

Univ. of

Illinois

Press,

Urbana,

(1966).

[15]

W
olfram

S.,

Rev. M
o
d.

P
h
ys.

55
(
3) (19
83)
601
-
644.
doi/10.1103/RevModPhys.55.601
.