Research Article

Proving Reliability of Image Processing Techniques in Digital Forensics Applications

Listing 15

Run-length of 1’s.
Fixpoint runlenblack (img: image) (l: list nat): list nat:=
match img, l with
|nil, 0:tlʺ ⇒ rev tlʺ
|nil, _ ⇒ rev l
|Br,c,black:tlʹ, nil ⇒ runlenblack tlʹ (1:nil)
|Br,c,black:tlʹ, h:tlʺ ⇒ runlenblack tlʹ (S h:tlʺ)
|Br,c,white:tlʹ, 0:tlʺ ⇒ runlenblack tlʹ l
|Br,c,white:tlʹ, _⇒ runlenblack tlʹ (0:l)
end.