a customized camera imaging pipeline for dermatological imaging · 2019. 7. 11. · canon's...

23
A Customized Camera Imaging Pipeline for Dermatological Imaging Hakki Can Karaimer 1 Iman Khodadad 2 Farnoud Kazemzadeh 2 Michael S. Brown 1 1 York University, Toronto 2 Elucid Labs 1 ISIC Skin Image Analysis Workshop @ CVPR 2019

Upload: others

Post on 11-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

A Customized Camera Imaging Pipeline for Dermatological Imaging

Hakki Can Karaimer1 Iman Khodadad2

Farnoud Kazemzadeh2 Michael S. Brown1

1York University, Toronto 2 Elucid Labs

1

ISIC Skin Image Analysis Workshop @ CVPR 2019

Page 2: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Talk's topic

A customize camera for dermatological analysis

2

Schematic drawing of the device Prototype

Machine vision camera

Macrolens

LED light ringBroadband visible light and

selected non-visible spectral bands

Device housing

19mm opening

Page 3: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Challenges

1. Machine vision camera vs. consumer camera

2. How to use the visible image with the narrow band spectral image?

3

Consumer camera

output

Output from

machine vision camera's APIEnhanced RGB image

using a spectral band

Page 4: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

In-camera processing pipeline

• There are a number of steps onboard a camera that convert the light falling on the camera’s sensor image (raw image) to the final R,G,B image output

• These steps are collectively called the “in-camera image processing pipeline”

4

Page 5: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019 5

2- Black light subtraction, linearization

[Values or 1D LUT]

1- Reading raw Image3- Lens correction

[2D Array(s)]

4- Demosaicing[Func]

7- Hue/Sat map [3D LUT]

8- Exposure curve [EV value or 1D LUT]

9- Color mani-pulation [3D LUT]

10- Tone curve application [1D LUT]

11- Final color-space conversion [Mat]

12- Gamma curve application [1D LUT]

5- Noise reduction [Func]

# # #

# # #

# # #

1 2 3 4 5 6

891011 712

ffGamma applied for visualization

Intermediate images for each stage

Sensor

Output

6- White-balancing &color space transform

to CIE XYZ [MATs]

# # #

# # #

# # #

#

#

#

In-camera processing pipeline

Page 6: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019 6

2- Black light subtraction, linearization

[Values or 1D LUT]

1- Reading raw Image3- Lens correction

[2D Array(s)]

4- Demosaicing[Func]

7- Hue/Sat map [3D LUT]

8- Exposure curve [EV value or 1D LUT]

9- Color mani-pulation [3D LUT]

10- Tone curve application [1D LUT]

11- Final color-space conversion [Mat]

12- Gamma curve application [1D LUT]

5- Noise reduction [Func]

# # #

# # #

# # #

1 2 3 4 5 6

891011 712

ffGamma applied for visualization

Intermediate images for each stage

Sensor

User

Color space transform

Photofinishing

6- White-balancing &color space transform

to CIE XYZ [MATs]

# # #

# # #

# # #

#

#

#

In-camera processing pipeline

Page 7: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Machine Vision vs. Consumer Camera Pipelines

• Why does a machine vision camera's image appear different from consumer camera?

7

Typical pipeline for machine vision cameras

RAW

Image

RAW

ImageDemosaicDemosaic

Black level offset,

normalization

GammaGammaPre-

processing

Pre-

processing

5321

White-

balance

White-

balance

4

(Optional)

OutputOutput

(Optional)

6

Page 8: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Machine Vision vs. Consumer Camera Pipelines

• Why does a machine vision camera's image appear different from consumer camera?

7

Typical pipeline for machine vision cameras

RAW

Image

RAW

ImageDemosaicDemosaic

Black level offset,

normalization

GammaGammaPre-

processing

Pre-

processing

5321

White-

balance

White-

balance

4

(Optional)

OutputOutput

(Optional)

Typical pipeline for consumer cameras

RAW

image

RAW

imageNoise

reduction

Noise

reduction

Color

transform

Color

transform

Black level offset,

normalization

White-

Balance

White-

BalanceJPEG

compression

JPEG compression

Photo

finishing

Photo

finishing

Tone-mapping,

sRGB gamma,

3D color LUT

Pre-

processing

Pre-

processing

1 2

DemosaicDemosaic

4 5 6 7 8 9

Flat-field

correction

Flat-field

correction

3

6

Page 9: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Customized imaging pipeline

• Our customized camera

8

7- Tone curve6- Photo-finishing

3D LUT

(OPTIONAL)

R

B

G

2- Black light

subtraction,

linearization

1- Sensor's raw

image

4- Lens

correction

[2D Array]

5- Color space

transform

(3x3, or 3x11)

# # #

# # #

# # #

⋅⋅⋅

⋅⋅⋅

R G R G R

G B G B G

R G R G R

G B G B G

R G R G R

3- Demosaicing

R R R R R

R B G B G

R G R G R

R B G B G

R G R G R

G G G G G

G B G B G

G G R G R

G B G B G

G G R G R

B B B B B

B B B B B

B B B B B

B B B B B

B B B B B

216

Black level

1.0

0.0

Classification

module

R G R G R

G B G B G

R G R G R

G B G B G

R G R G R

2- Black light

subtraction,

linearization

1- Sensor's raw

image

⋅⋅⋅

⋅⋅⋅

216

Black level

1.0

0.0

Pipeline for visible imagesPipeline for non-visible images

Visualization/

live preview

Enhanced non-spectralvisualization

Image fusion

Show Real

Image

Colorimetriclinear-sRGB

Photo-finished

sRGB output

Enhanced sRGB image

4- Lens

correction

3- Selection on

Bayer pattern

R R R R R

R B G B G

R G R G R

R B G B G

R G R G R

G G G G G

G B G B G

G G R G R

G B G B G

G G R G R

B B B B B

B B B B B

B B B B B

B B B B B

B B B B B

⋅⋅⋅⋅⋅⋅

⋅⋅⋅⋅⋅⋅

⋅⋅⋅⋅⋅⋅

1

00 1

Page 10: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

LED flat-field correction

• A flat-field correction for each LED

9

LED 1 LED 2 LED 3

LED 4 LED 5 LED 6

LED 7 LED 8 LED 9

Page 11: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

• Sensor needs to be colorimetrically calibrated

• Color space transform (CST) to map raw-RGB values to the CIE XYZ color space

10

In-camera processing pipeline

2- Black light

subtraction,

linearization

1- Sensor's raw

image

4- Lens

correction

[2D Array]

5- Color space

transform

(3x3, or 3x11)

# # #

# # #

# # #

⋅⋅⋅

⋅⋅⋅

R G R G R

G B G B G

R G R G R

G B G B G

R G R G R

3- Demosaicing

R R R R R

R B G B G

R G R G R

R B G B G

R G R G R

G G G G G

G B G B G

G G R G R

G B G B G

G G R G R

B B B B B

B B B B B

B B B B B

B B B B B

B B B B B

216

Black level

1.0

0.0

Classification

module

ColorimetricXYZ

Page 12: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

• Errors with and without sensor calibration

11

Mean angular error: 2.66°Mean angular error: 2.80°Mean angular error: 22.23°Mean angular error: 7.44°

Visualization of patchesOff-the-shelf

machine vision camera WB CST3×3 CST3×11

Mean angular error: 2.70°Mean angular error: 2.75°Mean angular error: 22.04°Mean angular error: 9.97°

CC

SC

°

CC: Macbeth color checker chart

SC: Skin colors from the Munsell Book of Color

In-camera processing pipeline

Page 13: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Photo-finishing

• Photo-finishing to make the images look visually-pleasing

12

7- Tone curve6- Photo-finishing

3D LUT

(OPTIONAL)

R

B

G

2- Black light

subtraction,

linearization

1- Sensor's raw

image

4- Lens

correction

[2D Array]

5- Color space

transform

(3x3, or 3x11)

# # #

# # #

# # #

⋅⋅⋅

⋅⋅⋅

R G R G R

G B G B G

R G R G R

G B G B G

R G R G R

3- Demosaicing

R R R R R

R B G B G

R G R G R

R B G B G

R G R G R

G G G G G

G B G B G

G G R G R

G B G B G

G G R G R

B B B B B

B B B B B

B B B B B

B B B B B

B B B B B

216

Black level

1.0

0.0

1

00 1

Page 14: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Photo-finishing

• Photo-finishing to make the images look visually-pleasing

• We can mimic different consumer cameras

13

A B C D E F

Raw-RGB + gamma Linear-sRGB (B) Photo finished w/Adobe tone-curve

(B) Photo finished w/Nikon's Vivid mode

(B) Photo finished w/Canon's Portrait

mode

(B) Photo finished w/Olympus's Natural

mode

Page 15: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Non-visible spectral images

14

• Our customized camera

7- Tone curve6- Photo-finishing

3D LUT(OPTIONAL)

R

B

G

2- Black light

subtraction,

linearization

1- Sensor's raw

image

4- Lens

correction

[2D Array]

5- Color space

transform

(3x3, or 3x11)

# # #

# # #

# # #

⋅⋅⋅

⋅⋅⋅

R G R G R

G B G B G

R G R G R

G B G B G

R G R G R

3- Demosaicing

R R R R R

R B G B G

R G R G R

R B G B G

R G R G R

G G G G G

G B G B G

G G R G R

G B G B G

G G R G R

B B B B B

B B B B B

B B B B B

B B B B B

B B B B B

216

Black level

1.0

0.0

Classification

module

R G R G R

G B G B G

R G R G R

G B G B G

R G R G R

2- Black light

subtraction,

linearization

1- Sensor's raw

image

⋅⋅⋅

⋅⋅⋅

216

Black level

1.0

0.0

Pipeline for visible imagesPipeline for non-visible images

Visualization/

live preview

Enhanced non-spectralvisualization

Show Real

Image

Colorimetriclinear-sRGB

Photo-finished

sRGB output

Enhanced sRGB image

4- Lens

correction

3- Selection on

Bayer pattern

R R R R R

R B G B G

R G R G R

R B G B G

R G R G R

G G G G G

G B G B G

G G R G R

G B G B G

G G R G R

B B B B B

B B B B B

B B B B B

B B B B B

B B B B B

⋅⋅⋅⋅⋅⋅

⋅⋅⋅⋅⋅⋅

⋅⋅⋅⋅⋅⋅

1

00 1

Page 16: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Non-visible spectral images

• Next: Enhancement using narrow band spectral images

14

7- Tone curve6- Photo-finishing

3D LUT(OPTIONAL)

R

B

G

2- Black light

subtraction,

linearization

1- Sensor's raw

image

4- Lens

correction

[2D Array]

5- Color space

transform

(3x3, or 3x11)

# # #

# # #

# # #

⋅⋅⋅

⋅⋅⋅

R G R G R

G B G B G

R G R G R

G B G B G

R G R G R

3- Demosaicing

R R R R R

R B G B G

R G R G R

R B G B G

R G R G R

G G G G G

G B G B G

G G R G R

G B G B G

G G R G R

B B B B B

B B B B B

B B B B B

B B B B B

B B B B B

216

Black level

1.0

0.0

Classification

module

R G R G R

G B G B G

R G R G R

G B G B G

R G R G R

2- Black light

subtraction,

linearization

1- Sensor's raw

image

⋅⋅⋅

⋅⋅⋅

216

Black level

1.0

0.0

Pipeline for visible imagesPipeline for non-visible images

Visualization/

live preview

Enhanced non-spectralvisualization

Show Real

Image

Colorimetriclinear-sRGB

Photo-finished

sRGB output

Enhanced sRGB image

4- Lens

correction

3- Selection on

Bayer pattern

R R R R R

R B G B G

R G R G R

R B G B G

R G R G R

G G G G G

G B G B G

G G R G R

G B G B G

G G R G R

B B B B B

B B B B B

B B B B B

B B B B B

B B B B B

⋅⋅⋅⋅⋅⋅

⋅⋅⋅⋅⋅⋅

⋅⋅⋅⋅⋅⋅

1

00 1

Page 17: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Non-visible spectral images

• Narrow band spectral images

15

Band 1 Band 2 Band 3 Band 4 Band 5Visible image Band 6 Band 7 Band 8

Page 18: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

[1] Clement Fredembach, Nathalie Barbuscia, and Sabine Süsstrunk. Combining Visible and Near-Infrared Images for Realistic Skin Smoothing. In Color and Imaging Conference, 2009.[2] Mathieu Aubry, Sylvain Paris, Samuel W. Hasinoff, Jan Kautz, and Fredo Durand. Fast Local Laplacian Filters: Theory and Applications. In SIGGRAPH, 2014.[3] Michel Misiti, Yves Misiti, Georges Oppenheim, and Jean-Michel Poggi. Wavelets and Their Applications. Newport Beach, CA: Wiley-ISTE.

Spectral data fusion

• Three methods:• Modified bilateral filtering [1]

• Modified local Laplacian filter [2]

• Wavelet-based fusion [3]

16

Photo-finished image A narrow band spectral image The result of the fusion

Page 19: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Examples of data fusion

Modified bilateral filter method [1] Wavelet-based image fusion [3]

Band 1 Band 2 Band 3 Band 4 Band 5Visible image Band 6 Band 7 Band 8

Modified local Laplacian filter method [2]

Page 20: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Feedback from clinicians

• Is there a preference between the methods and the different spectral bands?

• Among the three methods used to perform spectral image fusion, do you have a preferred method?

• Is there a particular spectral image that you feel provides the most information?

• Do you feel this type of fusion is useful for you in a clinical setting (i.e., would it help you make a more informed decision)?

18

Page 21: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Clinician feedback

• The most preferred: • Wavelet-based method

• Spectral band 8 (NIR - 1100 nm)

• Comments from our participants include:“Yes, I think that the fusion is very helpful” “I could see the pattern of each lesion much

better (reticular, dots, borders).”

• A dermatologist who was neutral commented:“Only in certain cases.”

19

Still an area of active research. Still an area of active research.

Page 22: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Conclusion

• Presented a customize camera pipeline for dermatological imaging• Modified machine-vision camera

• Based on understanding of consumer camera pipelines

• Useful for the design of similar devices

• Spectral data fusion • Older methods shouldn’t be ruled out

• Open problem, room for more research

20

Page 23: A Customized Camera Imaging Pipeline for Dermatological Imaging · 2019. 7. 11. · Canon's Portrait mode (B) Photo finished w/ Olympus's Natural mode. ISIC Skin Image Analysis Workshop

ISIC Skin Image Analysis Workshop @ CVPR 2019

Thank you!

21