Due on 11/20 @ 3:00 PM: Project 4 (Report due on 11/20 in class)
Due on 11/06 @ 3:00 PM: Project 3 (Report due on 11/06 in class)
Due on 10/09 @ 3:00 PM: Project 2 (Report due on 10/14 in class)
Due on 09/18 @ 3:00 PM: Project 1
Lab assignment: Sign up Download lab description drafts: Lab 1, Lab 2, Lab 3
Due on 08/29: Project 0


Resources

Basic Image Processing Tutorial: http://homepages.inf.ed.ac.uk/rbf/HIPR2/hipr_top.htm

Sample Videos: videos

Get familiar with these image formats: http://paulbourke.net/dataformats/ppm/
http://en.wikipedia.org/wiki/Netpbm_format

Microscopy Images: grayscale, color.

Other color images.

Irfanview (windows) is a software suite to create, edit, compose, or convert bitmap images to ppm or pgm.

Image Magick (already installed on unix) is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. ImageMagick can also be used to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons and ellipses.

How to submit your assignment?

Zip all the program files, the original and processed image/video files, a script or a list of commands that execute all required functions. Name it "project#-A-B.zip" (ex: project0-Partner1LastName-Partner2LastName.zip), then upload the zip on canvas under the corresponding assignment name. If submitting C/UNIX, ensure that the project can be compiled using a make file or command that you provide. For Visual Studio, ensure that the solution can be built on VS 2013. Attach a readme file to show how to run your program and check the result.

Reports are due the same day as the code. You should hand it in to Dr. Goldgof in class.

*** Please note that the projects which can not be compiled will not be graded! ***

Sample report: 1, 2, 3



Projects

Use examples just for testing purposes. Your report should not include the images provided on this page, but different images and their outputs.



Project 4

Due on 11/20 @ 3:00 PM

Example code that uses fftw library

http://www.admindojo.com/discrete-fourier-transform-in-c-with-fftw/ another link on how to use FFTW - please attribute appropriately.

How to compile on grad using FFT libraries (example):
c++ -o outputROI main.cpp image.cpp ipTool.cpp ROI.cpp -lrfftw -lfftw -lm
-OR-
type "./compile.sh" into command line.
Then run "./exeme.sh" to run example (see inside this file for run commands).
Note, this code provides an example of both the forward and inverse transformations, but does not filter.
Please check www.fftw.org for more information.

Tutorial 1

Tutorial 2 (about FFTW codes, cpp file)
Hints for programming with FFT:

1. We know that FFT is nothing but a transformation. So what is a transformation? Mathematically we can say it is one matrix I multiplied by another one (or more) T. Here I is a input image. T is the core that does the transformation. And let's say S is the result we have after transformation.

2. Corresponding to a transformation, there is an inverse-transformation (if T is non-singular) which is another (or more) matrix. Let's say an inverse transformation for T is R, so by multiplying S with R, we can compute I.

3. In this assignment, what we have is the original image I.

4. We do not have T and R but FFTW provides us. What we want is S.

5. How to implement this then?

6. First, we need to represent the image I as a matrix:
fftw_real a[M][2*(N/2+1)]. or fftw_real a[M][N]. M and N are the dimensions.

7. Second, we need to get T and R from FFTW:
rfftwnd_plan p = rfftw2d_create_plan(M, N, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE | FFTW_IN_PLACE); (this is T).
rfftwnd_plan pinv = rfftw2d_create_plan(M, N, FFTW_COMPLEX_TO_REAL, FFTW_ESTIMATE); (this is S).

8. By calling a function from FFTW , we can obtain S from I and T:
A = (fftw_complex*) &a[0][0]; rfftwnd_one_real_to_complex(p, &a[0][0], NULL); (S will be stored in a).

9. Then by calling another function from FFTW, we can obtain I back from S and R:
rfftwnd_one_complex_to_real(pinv, &A[0][0], &b[0][0]); (I is stored in b).

10. Finally, clear the memory: rfftwnd_destroy_plan(p);
rfftwnd_destroy_plan(pinv);


(a)

(b)

(c)

(d)

(e)

(f)

(a) Original image
(b) Its Fourier Domain
(c) Original image
(d) Its Fourier Domain
(e) Original image
(f) Its Fourier Domain



(a)

(b)

(c)

(a) Original image with a black line inside image
(b) Applying low-pass filter to its Fourier domain
(c) Resulted image after the filter



(a)

(b)

(c)

(a) Original image
(b) Applying band-pass filter to its Fourier domain
(c) Resulted image after the filter



(a)

(b)

(c)

(a) Original image
(b) Applying band-stop filter to the Fourier domain of a ROI
(c) Resulted image after the filter


Project 3

Due on 11/06 @ 3:00 PM

You will need to add edge detection and color processing to your program from project 2.

Both new functions should operate within ROI and SOI.

Use the Sobel operator (3x3) to compute dx, dy, gradient amplitude and edge direction.
Threshold gradient amplitude and direction.
Generate image of gradient amplitude as intensity image.
Generate binary edge image of thresholded gradient amplitude.
Generate binary edge image of thresholded amplitude and direction.

Extra credit:
Apply edge detection to R,G,B channels independently.
Covert RGB to HSI.
Apply edge detection to I channel.

Perform Hough Transform on ROI's to find the circle inside it.
Choose some grayscale images which have a circle in it and perform the function on a ROI including the circle to find it.
You should highlight the circle which is found by your function in the output.
For that, you can change the grayscale image to color image (by setting R, G and B channels equal to the single gray channel) and highlight the circle inside the image in a color, like red (for which you can set B and G pixels values of where the circle is found to 0 and set its R value to 255).

Tutorial on Sobel Edge Detection (If you use any of this code, please attribute the source in your comments).






(a)

(b)

(c)

(d)

(a) Original image
(b) Edge detection using Sobel operator in different ROI's and then threshold at 20
(c) Edge detection using Sobel operator on the whole image then threshold at 50
(d) Edge detection using Sobel operator in different ROI's and then threshold at 100



(a)

(b)

(c)

(d)

(a) Original image
(b) Edge detection using Sobel operator on the whole image then threshold at 10
(c) Original image
(d) Edge detection using Sobel operator on the whole image then threshold at 20



(a)

(b)

(c)

(d)

(a) Original image
(b) Edge detection using Sobel operator
(c) Edge detection using Sobel operator - edges at 45 degree angle
(d) Edge detection using Sobel operator - edges at 135 degree angle



(a)

(b)

(c)

(d)

(a) Original image
(b) Detected ball using Hough Transform
(c) Original image
(d) Detected ball using Hough Transform

Project 2

Due on 10/09 @ 3:00 P.M.

Reports are due on 10/14. You should hand it in to Dr. Goldgof in class.

You will need to add these functionalities to your project:

  • Grey level histogram equalization on specific ROIs,
  • [1 extra credit] Doing a partial histogram clipping (all pixels below an intensity threshold are mapped to zero intensity) before grey level histogram equalization,
  • Color level histgram equalization, both in RGB and HSI (only I channel) models,
  • [2 extra credit] Color level histgram equalization also on H and S channel - experimenting with different channels combinations.

RGB-HSI color conversion (From the text by Gonzales and Woods).

Another link for RGB-HSI conversionn


(a)

(b)

(c)

(d)

(a) Original image
(b) Histogram of original image
(c) Histogram equalization
(d) Histogram of equalized image



(a)

(b)

(c)

(d)

(e)

(a) Original image
(b) Histogram equalization on R, G and B channels together
(c) Histogram equalization on H channel (and back to RGB to preview)
(d) Histogram equalization on S channel (and back to RGB to preview)
(e) Histogram equalization on I channel (and back to RGB to preview)



(a)

(b)

(c)

(d)

(e)

(f)

(a) Original image
(b) Histogram equalization on R, G and B channels together
(c) Histogram equalization on H and S channels (and back to RGB to preview)
(d) Histogram equalization on S and I channels (and back to RGB to preview)
(e) Histogram equalization on H, S and I channels (and back to RGB to preview)
(f) Histogram equalization on I channel (and back to RGB to preview)


Project 1

Due on 09/18 @ 3:00 P.M.

Your program needs to consider up to four ROI (Region Of Interest).
The name and parameters of the filters are:

"GrayThresholding" : 'your program' 'srcfile' 'target file' 'GrayThresh' 'ROI file' 'threshold(T)' // This is function from assignment 0

"VariableThresholding" : 'your program' 'srcfile' 'target file' 'GrayThresh' 'ROI file' 'S' 'winsize(WS)' 'threshold(T)'

"ColorThresholding" : 'your program' 'srcfile' 'target file' 'ColorThresh' 'ROI file' 'threshold(TC)' 'Red(CR)' 'Green(CG)' 'Blue(CB)'

"GSmoothing" : 'your program' 'srcfile' 'target file' 'GSmooth' 'ROI file' 'Sigma'

"EdgePreservingSmoothing" : 'your program' 'target file' 'srcfile' 'EdgeSmooth' 'ROI file' 'threshold(TSM)' 'winsize(WS)

To run the example "GrayThresholding" function included in the "proj1.zip", run:

./iptool baboon.pgm baboon_graythresh GrayThresh roi.txt 100
output:

Note: The parameters (threshold(T), winsize(WS), threshold(TC), threshold(TCM), Sigma, Red(CR), Green(CG), and Blue(CB)) can be different for each ROI. Be sure to check for boundary conditions (greater than 0, less than 255). You can put these parameters in the command line or in an ROI file (recommended). The ROI file is a list of ROI's with parameters that can be read in by your program.




(a)

(b)

(c)

(d)

(a) Original image
(b) Threshold with T = 90
(c) Variable threshold with S = 1, WS = 5 and T = 0
(d) Variable threshold with S = 1, WS = 13 and T = -10



(a)

(b)

(c)

(a) Original image
(b) Color threshold with C = (200, 10, 10) and TC = 100
(c) Color threshold with C = (150, 100, 100) and TC = 100


Project 0

Due 08/29 by 3:00 p.m. in main CS office. Please do not submit code with Project 0, but only report (sample code - compilable on grad server).

Objective: Implement "binarize function" and "scale function" to binarize and scale images (*.ppm and *.pgm).
For project 0, your program must take 4 arguments:
1. the input file name;
2. the output file name;
3. the name of the filter. Use "binarize" and "scale" for your filters;
4. the threshold value for binarize filter or the scaling factor for scale filter. Example output:


(a)

(b)

(c)

(a) original image
(b) ./iptool baboon.pgm baboon_add add 50
(c) ./iptool baboon.pgm baboon binarize 140


Lab Assignments

Digital Image Processing Lab

The objective consists of three labs (in ENB110) where for each lab you will collect data from various sensors. You can then process this data using the tools you have developed in class.

The labs will be organized as follows:

Lab 1 (Download draft):

Regular Camera / Kinect,

Lab 2 (Download draft):

Stereo Bumblebee / Range scanner , Lab 2a -3D printing (extra credit),

Lab 3 (Download draft):

Microscope Images.

You will be responsible for collecting your own data from each of these sensors. Each lab handout describes step in image acquisition and processing. Your report should include description of the lab as you have done it. You should also take the collected images/videos and process those using the code developed during on-going programming assignments and report the results. This should follow by the general conclusion about the lab and data collection.

Make sure to bring a thumbdrive or portable storage to save your files (4GB should be sufficient).

Collection for each lab should take approximately 30-45 minutes. Due to the large number of students in the class, it is important that you schedule a time ahead of time. You must form into groups of two, and select a time for each lab. You will need to pick a slot using the following schedule. You may only select at most 2 labs for each day and also, Lab 2 and Lab 3 must be done on separate days (The actual form will be given in the class):

Sep-30

Lab 1

Lab 1

Lab 2

Lab 3

2:45-3:30

A

B

C

D

3:30-4:15

E

F

A

G

4:15-5:00

G

H

E

I

5:00-5:45

I

J

F

C

5:45-6:00

Close up






Oct-02

Lab 1

Lab 1

Lab 2

Lab 3

2:45-3:30

C

D

B

A

3:30-4:15

K

G

E

4:15-5:00

H

F

5:00-5:45

I

J

5:45-6:00

Close up






Oct-07

Lab 1

Lab 1

Lab 2

Lab 3

2:45-3:30

K

B

3:30-4:15

D

K

4:15-5:00

5:00-5:45

J

H

5:45-6:00

Close up

This lab is reserved, and is only available by special permission:

Oct-09

Lab 1

Lab 1

Lab 2

Lab 3

2:45-3:30

3:30-4:15

4:15-5:00

5:00-5:45

5:45-6:00

Close up