resource efficient real-time processing of contrast

22
Resource Efficient Real-Time Processing of Contrast Limited Adaptive Histogram Equalization Burak Ünal, Ali Akoglu Reconfigurable Computing Lab Department of Electrical and Computer Engineering The University of Arizona 1

Upload: others

Post on 11-Apr-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Resource Efficient Real-Time Processing of Contrast

Resource Efficient Real-Time Processing of Contrast

Limited Adaptive Histogram Equalization

Burak Ünal, Ali Akoglu

Reconfigurable Computing Lab

Department of Electrical and Computer Engineering

The University of Arizona

1

Page 2: Resource Efficient Real-Time Processing of Contrast

Outline

• Motivation

• Histogram Equalization– General Histogram Equalization

– Adaptive Histogram Equalization

– Contrast Limited Adaptive Histogram Equalization

• Related Works

• State-of-the-art Implementation

• Contextual CLAHE – Histogram Generation

– Histogram Distribution and CDF

– Interpolation Technique

• Testbed

• Results

• Conclusion and Future Work

2

Page 3: Resource Efficient Real-Time Processing of Contrast

Motivation

• Contact Sensing

– Burdensome

– Labor-intensive

– Destructive

• Non-contact Sensing

– Structural challenge

– Sunlight variety

– Poor image quality

How can we enhance the image quality ?

Page 4: Resource Efficient Real-Time Processing of Contrast

Histogram Equalization

Input Image Image Histogram (a) Histogram Equalization (HE)

4

Page 5: Resource Efficient Real-Time Processing of Contrast

Adaptive Histogram Equalization

Input Image (b) Adaptive HE (AHE) (c) Contrast Limited AHE (CLAHE)

Page 6: Resource Efficient Real-Time Processing of Contrast

Adaptive Histogram Equalization

Input Image (b) Adaptive HE (AHE) (c) Contrast Limited AHE (CLAHE)

Page 7: Resource Efficient Real-Time Processing of Contrast

Related Works

FPGA Based Implementations

HE

General HE Specified HE

AHE

Partially Overlapped

Fully Overlapped

CLAHE

HE Specified HE Specified HE 2 AHE CLAHE

- 720 × 480

- 122 fps

- Missing

local details

- 128 × 128

- 25 fps

- For specific

task

- 2.5Mpixels

- 25 fps

- For specific

task

- 640 ×480

- 263.8 fps

- 128 block

RAMs

- 640x480

- 537.9 fps

- Extremely

memory

depended (192

BRAM)

7

Page 8: Resource Efficient Real-Time Processing of Contrast

Existing CLAHE Implementation

8

Page 9: Resource Efficient Real-Time Processing of Contrast

Existing CLAHE Implementation

Pros:

– Real-time implementation

– 537.9fps

– The speed of algorithm is

independent from image size

Cons:

– Requires 192x18K BRAM

– Larger image size needs 320

BRAM (1920x1080)

– Consume large amount of

logic resource

9

Page 10: Resource Efficient Real-Time Processing of Contrast

Contextual CLAHE256 x 13 x 8 = 26.624 KB

4 row = 106.496 KB

256 x 9 x 640 = 184.320 KB (HB)

256 x 9 x 257 = 70.016K KB (THB)

Combine tiles via interpolation.10

Page 11: Resource Efficient Real-Time Processing of Contrast

Histogram Generation

11

ℎ 𝑘 =

𝑘=0

255

1, 𝐼 𝑖 = 𝑘0 𝑜𝑡ℎ𝑒𝑟

1

8

Histogram BRAM

Pixel

Value

Dout

Din

Address

BufferAdder

Comparator Excess

Counter

9

β

1/0

Exceed Bin

Counter

9

12

8

Bu

ffer

capacity

bins

excess

pixels

8

intensity

K × K Image

N-1

β

Page 12: Resource Efficient Real-Time Processing of Contrast

Histogram Distribution & CDF

12

β

α

intensity

N-1

β

N-1intensity

β

α

N-1intensity

β

α

N-1intensity

(a) histogram cut (b) iteration 1 ( c) iteration 2 (d) iteration n

𝐶𝐷𝐹 = 𝑚𝑥,𝑦 𝑛 =

𝑘=0

𝑛

ℎ 𝑘 ×1

𝑀× 𝑁 2

(e) CDF

Page 13: Resource Efficient Real-Time Processing of Contrast

Interpolation Technique

z t

w

s

UR

BL BR

UL

𝐼𝑛𝑒𝑤=𝑠

𝑠 + 𝑤

𝑡

𝑧 + 𝑡𝑚𝑈𝐿 𝑛 +

𝑧

𝑧 + 𝑡𝑚𝑈𝑅 𝑛 +

𝑤

𝑠 + 𝑤

𝑡

𝑧 + 𝑡𝑚𝐵𝐿 𝑛 +

𝑧

𝑧 + 𝑡𝑚𝐵𝑅 𝑛 (3)

13

Page 14: Resource Efficient Real-Time Processing of Contrast

Contextual CLAHE

14

Page 15: Resource Efficient Real-Time Processing of Contrast

HE for Color Image

15

Mapping

Function

Buffer

RGB to YUV

converter

Y

UV

YU

V t

o R

GB

co

nv

ert

er

Frame

Buffer

24Input

Stream

24 Output

Stream

8

88

FPGA

Y

U

V

8

Histogram

distribution &

CDF unit

12

8

.....

2

8

.....

1

Histogram

generation &

cutoff

Y stands for the luma (the brightness).

U and V are the chrominance (color) components.

Page 16: Resource Efficient Real-Time Processing of Contrast

Testbed

16

Page 17: Resource Efficient Real-Time Processing of Contrast

Histogram Equalization Results

(a) Original Image (b) Enhanced Image

17

Page 18: Resource Efficient Real-Time Processing of Contrast

Histogram Equalization Results

(a) FPGA (b) Matlab

18

Page 19: Resource Efficient Real-Time Processing of Contrast

Histogram Equalization Results

FPGA and Matlab based output comparison

with 0.39% difference error rate =

1

25019

Page 20: Resource Efficient Real-Time Processing of Contrast

Histogram Equalization Results

512 x 512 640 x 480 1280 x 720 1920 x 1080

Critical Path Delay 8.475 ns 9.186 ns 12.061 ns 14.479 ns

Maximum Operational Frequency 117.99 MHZ 108.86 MHz 82.91 MHz 69.06 MHz

Performance 450.111 fps 354.36 fps 89.96 fps 33.30 fps

Frame Size

Logic Resource CCLAHE CLAHE

Number of Slice Registers 440 246

Number of Slice LUTs 4766 32123

Number of fully used LUT-FF pairs 284 222

Number of Block RAM/FIFO 16 192

Operatinal Frequency 108.86 MHz 209.6 MHz

Performance 354.36 fps 537.9 fps

20

Page 21: Resource Efficient Real-Time Processing of Contrast

Conclusion and Future Work

• Real-time processing of CLAHE.

• First implementation of interpolation based Contextual CLAHE.

• Introduced a method for real time implementation of Contextual CLAHE to solve memory dependency issue.

• Modified the flow of algorithm for FPGA implementation. – Histogram generation method is restructured to reduce block RAM usage.

– Histogram redistribution technique is proposed to implement iterative redistribution algorithm in hardware.

• Alternative interpolation calculation method is proposed to the computation complexity.

• Histogram equalization architecture will be parallelized to increase its performance for larger image size.

• Investigate different transfer function for calculating CDF.

• Contrast-sensitive transfer function.

21

Page 22: Resource Efficient Real-Time Processing of Contrast

Q & A

22