## 1.

## Introduction

The grayscale frames interpolation problem is the process of creating intermediary grayscale frames between two given frames.^{1} The interpolated grayscale frame
$\left({X}_{i}\right)$
,
$0\u2a7di\u2a7dM$
,
$M\u2a7e2$
depends on the content of an input grayscale frame and an output grayscale frame. For
$i=0$
, the interpolated grayscale frame is equal to the input grayscale frame
${X}_{0}$
; for
$i=M$
, the interpolated grayscale frame is equal to the output grayscale frame
${X}_{M}$
.^{2}

The simplest method involves linear interpolation.^{3, 4} In Ref. 5, a dynamically elastic surface interpolation scheme was proposed. A hybrid approach that combined elastic interpolation, spline theory, and the surface consistency theorem was proposed to produce further improvement.^{6, 7} Grevera and Udupa^{8} and Herman ^{9} interpolated the distance and proposed shape-based methods by encoding the segmented image with distance codes. Guo developed a morphology-based interpolation method and successfully resolved the problems in objects with holes and large offsets.^{10} Lee proposed another morphology-based scheme that was simpler in computational complexity.^{11} Goshtasby selected feature points from successive frames to control the gray-level interpolation.^{12} In Ref. 13, feature points were used that were based on a fuzzy measure of the boundaries and medial axis transforms. In Ref. 14, a morphological skeleton interpolation was proposed in which interpolated sets were generated from a succession of skeletons derived from the matching of two neighboring set skeletons. Berier and Neely computed the interpolation with feature line-segment control.^{15} An example of object-based methods that used features is shape-based interpolation,^{16} which was extended by allowing registration between frames^{17} and using feature guidance.^{18} For grayscale images, mathematical morphology provides a well-founded theory.^{19}

The new interpolation grayscale frame method presented in this paper is based on the morphological $S$ transform (MST) and consists of partially changing, step by step using growing structuring elements (SEs) the morphological $S$ transforms of the foreground content of an input grayscale frame with the MSTs of the foreground content of an output grayscale frame. Better performance comes at the expense of not very great computational complexity.

This paper is organized as follows. Section 2 defines the grayscale MST. Section 3 presents the grayscale frames interpolation algorithm. Section 4 provides experimental results. The conclusions of this study are drawn in Sec. 5.

## 2.

## Morphological $S$ Transform (MST)

The MST of a grayscale image
$X$
can be calculated by means of morphological operations.^{19} For any SE
$B$
, we have

## 1

$$(n+1)B=nB\oplus B,\phantom{\rule{1em}{0ex}}n=0,1,2,\dots \phantom{\rule{0.3em}{0ex}}\text{and}\phantom{\rule{0.3em}{0ex}}0B=(0,0).$$The morphological $S(X,nB)$ transform of a grayscale image $X$ by SE $nB$ is given by

A grayscale image can be represented using the morphological formula

where $N$ is the maximum value defined by## 3.

## Interpolation Method

The new and improved grayscale frame interpolation method presented in this paper consists of partially changing, step by step using growing SEs $nB$ for $n=N,\dots ,1,0$ with $0B=(0,0)$ , the MST of the foreground content of a grayscale input frame with the MST of the foreground content of an output grayscale frame.

Based on the grayscale input frame ${X}_{0}$ and grayscale output frame ${X}_{M}$ , the foreground contents are defined as

## 5

$${X}_{0}^{f}={X}_{{0}^{.}}^{*}\mathrm{sign}\left(\mid {X}_{0}-{X}_{M}\mid \right)\phantom{\rule{0.3em}{0ex}}\text{and}\phantom{\rule{0.3em}{0ex}}{X}_{M}^{f}={X}_{{M}^{.}}^{*}\mathrm{sign}\left(\mid {X}_{0}-{X}_{M}\mid \right),$$## 6

$$\mathrm{sign}\left(\mid x\mid \right)=\{\begin{array}{ll}1,& \mathit{\text{if}}\phantom{\rule{0.3em}{0ex}}\mid x\mid \ne 0\\ 0,& \mathit{\text{if}}\phantom{\rule{0.3em}{0ex}}x=0\end{array}\phantom{\}}.$$The interpolated foreground content ${X}_{i}^{f}$ of grayscale interpolated frame ${X}_{i}$ , for $1\u2a7di\u2a7dN$ and $N\u2a7e2$ for $N=\mathrm{max}({N}_{0},{N}_{M})$ , obtained by using the morphological formula

## 7

$${X}_{i}^{f}({X}_{0}^{f},{X}_{M}^{f},B)=\dots (S[{X}_{0}^{f},(N-i)B]+\dots +\{S[{X}_{M}^{f},(N-1)B]+S({X}_{M}^{f},NB)\oplus B\}\oplus B)\oplus B\dots \oplus B\dots $$## 8

$${X}_{i}({X}_{0},{X}_{M},B)=[{X}_{0}-{X}_{{0}^{.}}^{*}\mathrm{sign}\left(\mid {X}_{0}-{X}_{M}\mid \right)]+{X}_{i}^{f}$$Using morphological formula 7, we can build a large number, $\mathrm{min}({N}_{0},{N}_{M})$ , of not necessarily different interpolated grayscale frames.

## 4.

## Experimental Results

We used the proposed algorithm for grayscale frame interpolation by constructing a frame using growing SEs and different $i$ values. We performed the experiments using grayscale images.

An example is presented in Fig. 1 . Test input and output grayscale frames are presented in Figs. 1 and 1, and the “missing” frame ${X}_{\mathrm{ref}}$ is in Fig. 1. This frame will be used as reference to compare our results. Our frames have dimensions [256, 256].

Using formula 5, we obtained the foreground contents for input and output frame ${X}_{0}^{f}$ and ${X}_{M}^{f}$ for input and output frame ${X}_{0}$ and ${X}_{M}$ [Figs. 2 and 2 ]. The background content for both the input and output frames (content the frames have in common), ${X}^{b}$ [Fig. 2], is given by

Using the morphological $S$ transform and crosses or squares as SE $B$ , we obtained ${N}_{0}^{c}=38$ , ${N}_{M}^{c}=38$ , and ${N}^{c}=38$ for the crosses and ${N}_{0}^{s}=30$ , ${N}_{M}^{s}=30$ , and ${N}^{s}=30$ for the squares. Interpolated foreground content ${X}_{i}^{f}$ , with $1\u2a7di\u2a7d38$ (for the crosses) and $1\u2a7di\u2a7d30$ (for the squares), was obtained using morphological formula 7. Finally, grayscale interpolated frame ${X}_{i}$ was given by formula 8. For the crosses, we built 34 interpolated grayscale frames, but only 21 were different. For the squares, we built 30 interpolated grayscale frames, but only 17 were different. Using a standard computer and an optimized C routine implementation, we obtained a grayscale interpolated frame at $40\phantom{\rule{0.3em}{0ex}}\mathrm{ms}$ . For $\text{size}\left({X}_{\mathrm{ref}}\right)=\left[AB\right]$ , we can define error function ${r}_{i}$ by

## 10

$${r}_{i}=\text{sum}\left(\text{sum}\left\{\mathrm{sign}\left[\mathrm{abs}({X}_{\mathrm{ref}}-{X}_{i})\right]\right\}\right)\u2215\left({A}^{*}B\right).$$Some error function results for the crosses $\left({r}_{i}^{c}\right)$ and squares $\left({r}_{i}^{s}\right)$ SEs are presented in Tables 1, 2 .

## Table 1

Error function ric .

i | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
---|---|---|---|---|---|---|---|---|---|

${r}_{i}^{c}$ (%) | 17.67 | 19.89 | 23.11 | 18.45 | 16.07 | 17.34 | 22.15 | 21.83 | 16.95 |

## Table 2

Error function ris .

i | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
---|---|---|---|---|---|---|---|---|---|

${r}_{i}^{s}$ (%) | 19.23 | 21.28 | 17.25 | 15.87 | 18.48 | 19.62 | 25.23 | 22.37 | 23.74 |

Interpolated frames using different SEs are presented in Figs. 3 and 4 .

After simulations using different SEs and different $i$ values, we observed that one of the interpolated frames offered by our method was similar to the original reference frame.

## 5.

## Conclusions

This paper has addressed the grayscale frames generalized interpolation by means of mathematical morphology.

After describing the algorithm, we provided experimental results that were very encouraging. We applied the proposed scheme to real-world data. For many situations, the proposed scheme was experimentally shown to successfully resolve complex interpolation problems. Some preprocessing could improve the results. The algorithm is fully morphological and can be applied quickly. This entire process is efficient without significant computational complexity. However, it is difficult to state rigorously that our method produces theoretically correct interpolated results for any frames.

## Acknowledgments

This research was founded by UEFISCSU, contract PII, IDEI, no. 100/2007, D.N. VIZIREANU.