COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple...

25
COMPUTER VISION LAB LAB 1 Gemma Rotger Felipe Lumbreras Spring 2017

Transcript of COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple...

Page 1: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

COMPUTER VISION

LAB

LAB 1

Gemma Rotger – Felipe Lumbreras

Spring 2017

Page 2: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROJECT GOALS

• Learn a statistical simple approach to background segmentation.

• Learn how to work with images sequences in Matlab and Octave.

• Use Matlab and/or Octave to perform a Traffic Application.

Deliverable deadline: Th. Mar. 9th. 23:00h

Page 3: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab
Page 4: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab
Page 5: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – SPEED LIMITS IN YOUR

COUNTRY

GOAL: COMPUTE THE CARS’S VELOCITY AND CHECK IF IT IS UNDER THE LIMITS OF LEGAL

Page 6: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROJECT MATERIALS

• Code• lab1.m • compute_statistics.m• simple_subtraction.m• gaussian_subtraction.m• morphology.m• report.docx

• Source Images • Highway sequence

http://changedetection.net/Datasets > 2014 Dataset > Baseline > Highway

Download it before the lab!

Page 7: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

STEP 1

DETECT CARS

LAB 1

CODE PART

Page 8: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

CAR 1

CAR 2

Page 9: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

Co

mp

lete

Dat

a

LAB 1 – PROBLEM 1

Load the dataset and split it in two sets train and test (+1).

TRAIN

TEST

FRAMES

670 to 950

FRAMES

670 to 810

FRAMES

811 to 950

Page 10: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 2

Compute the mean and the standard deviation of every

image pixel along the train sequence. (+1).

I want the solution to work in a matrix form. I don’t want to see any loop in the code of

this exercise! If you do that, your mark will be a 0.

Page 11: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 2

Compute the mean and the standard deviation of every

image pixel along the train sequence. (+1).

MEAN

BACKGROUND

STD

VARIATION

Page 12: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 3

For every single image in the test sequence, segment the

foreground by subtracting the background (+1.5)

Take into account that images

can be in different ranges:0 – 255 / 0 – 1

Page 13: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 3

For every single image in the test sequence, segment the

foreground by subtracting the background (+1.5)

If you obtain a reversed segmentation

remember how to transform to the negative image from lab 0

Page 14: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 3

For every single image in the test sequence, segment the

foreground by subtracting the background (+1.5)

There is a lot of noise. Why?

Page 15: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 4

For every single image in the test sequence, segment the

foreground by using a Gaussian model (+2)

You can use a Gaussian mode as this one or use you own but you

have to argument it if is required on the class.

In this case alpha and beta are constants that you need to define.

Please play with this values and fill a table that you can find in the code.

Page 16: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 4

For every single image in the test sequence, segment the

foreground by using a Gaussian model (+2)

We can model the Gaussian noise and then remove it!

Simple Subtraction (Gaussian) Noise Gaussian Subtraction

Page 17: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 5

Apply some morphology techniques to improve the results. (+1)

Gaussian Subtraction + Morphology

Page 18: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – PROBLEM 6

Show your results in a video. (+0.5)

Page 19: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – OPTIONAL TASK

Freestyle. Try top improve your results with any

technique you like (+1)

© Zalman Lent

Page 20: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

STEP 2

COMPUTE VELOCITY

LAB 1

MINI REPORT

Page 21: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

LAB 1 – REPORT + CLASS

DISCUSSION

Make your own research and write down the steps you would follow in order to compute the velocity of cars and check if their velocity is in the limits of legal. It includes report + class discussion (no code) (+3)

CAR 1

Page 22: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

EVALUATION

1. Code (+8)

2. Report (+3)

The evaluation will depend on the code, the report and the discussion.

Deadline: Th. Mar. 9th. 23:00h.

Page 23: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

DELIVERABLES CERBERO

What you have to deliver:

1. Code:Lab1.m

2. Report1. Report.pdf

Zip it all together and name it GROUP##Lab1.zip

(remember that zip is zip not rar nor tar)

IMPORTANT! 1 deliverable per group

Page 24: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

DELIVERABLES CERBERO

What NOT to deliver

1. The image sources

2. The evaluation code provided

3. The generated video

Deadline: Th. Mar. 9th. 23:00h. (Cerbero)

Page 25: COMPUTER VISION LAB 1 - Statement… · LAB 1 –PROJECT GOALS •Learn a statistical simple approach to background segmentation. •Learn how to work with images sequences in Matlab

DEAR CLASS

IF YOU HAVE ANY QUESTIONDON’T HESITATE TO CONTACT ME

[email protected]: [CVLab]