1 / 54

Introduction to Computer Vision Lecture 7

Introduction to Computer Vision Lecture 7. Dr. Roger S. Gaborski. In conjunction with IEEE Engineering in Medicine and Biology Society in Rochester Imaging in Drug Discovery and Development Raymond Gibson Senior Investigator Merck, Sharp and Dohme Research Laboratories

Download Presentation

Introduction to Computer Vision Lecture 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Computer VisionLecture 7 Dr. Roger S. Gaborski

  2. In conjunction with IEEE Engineering in Medicine and Biology Society in Rochester Imaging in Drug Discovery and Development Raymond Gibson Senior Investigator Merck, Sharp and Dohme Research Laboratories 4pm, Wednesday, Sept. 26, 2007 Auditorium of the Center for Imaging Science Building 76, RIT Positron emission tomography (PET) is a non-invasive imaging technique that provides means to obtain information on drug effects and/or behavior during development (i.e. radiotracer delivery, occupancy etc). Once the occupancy/kinetics of the successful first generation drug have been characterized via imaging, imaging can be used to demonstrate that a second generation drug exhibits occupancy and kinetics which are similar to or better than the primary drug. The presentation will focus primarily on the uses of PET in drug research and development in both small (rodent) and large animal (non-human primate) models and examine some of the principal issues that PET is being used to address in terms of developing novel drugs. Roger S. Gaborski

  3. Quiz on Thursday • Covers all material through Lecture 7 • The quiz is ‘closed book’ except you may create one page of notes to use during the quiz • You must create your own notes • Cannot copy from someone else or off web • Cannot copy lecture notes Roger S. Gaborski

  4. Edge Detection is Not Simple Roger S. Gaborski

  5. The derivative operation can be used to detect edgesHow can the derivative operator be approximated in a digital image?? Roger S. Gaborski

  6. RECALL: First Derivative Approximation • First Derivative in x direction: fx (x,y) = f(x,y) – f(x-1,y) Eq 1 = f(x+1,y) – f(x,y) Eq 2 • First Derivative in y direction: fy(x,y) = f(x,y) – f(x, y-1) Eq3 = f(x, y+1) = f(x,y) Eq4 Roger S. Gaborski

  7. First Derivative Approximation Roger S. Gaborski

  8. First Derivative Approximation EQ1 EQ2 Roger S. Gaborski

  9. First Derivative Approximation Eq4 Eq3 Roger S. Gaborski

  10. Profile of Edge - Analysis • Assume gray level input range [0,1] • Edge is located at ‘peak’ of first derivative • Cannot choose only one threshold value because range of first derivative depends on slope of gray level values • The edge is located where the second derivative goes through zero-independent of slope of gray level signal Roger S. Gaborski

  11. Profiles of an Ideal Edge Roger S. Gaborski

  12. MATLAB Examples • Approximation to derivative – difference of adjacent data values • data = [ .10 .14 .13 .12 .11 .10 .11 .34 .33 .32 .35 .10 .11 .12 .12 .12]; • diff operator: second- first data value (.14-.10) • diff(data) = 0.04 -0.01 -0.01 -0.01 -0.01 0.01 0.23 -0.01 -0.01 0.03 -0.25 0.01 0.01 0 0 diff operator is approximation to first derivative Roger S. Gaborski

  13. Estimate of Second Derivative • diff(diff( data)) • -0.05 0 0.0 0 0.02 0.22 -0.24 0 0.04 -0.28 0.26 0 -0.0100 0 Sign change (goes through zero) Roger S. Gaborski

  14. Simulated Data data diff(data) diff(diff(data)) Roger S. Gaborski

  15. How would you implement in a filter?Simple Example: • diff: second value – first value [ -1 +1 ] (could also use [+1 -1]) Roger S. Gaborski

  16. Actual Image Data Roger S. Gaborski

  17. Row 80 Roger S. Gaborski

  18. Roger S. Gaborski

  19. diff Operator Roger S. Gaborski

  20. Smooth Image First Roger S. Gaborski

  21. Roger S. Gaborski

  22. Simple First Derivative Approximation with Smoothing Difference x = Smoothing Roger S. Gaborski

  23. Rotate Filter Sensitive to edges at different orientations Roger S. Gaborski

  24. Sobel Filter • Consider unequal weights for smoothing operation x = Roger S. Gaborski

  25. Sobel Filter • Consider unequal weights for smoothing operation x = Roger S. Gaborski

  26. Line and Edge DetectionMATLAB Functions • Line vs. Edge • imfilter • corr • conv • conv2 • edge Roger S. Gaborski

  27. Simulated Edge Image >> i=zeros(300); >> i(149:151,:)=.5; >> i(:,149:151)=.5; >> figure, imshow(i) >> figure, plot(i(100,:)) >> axis([ 1 300 -1 1]) Roger S. Gaborski

  28. Lines w1 = 1 1 1 0 0 0 -1 -1 -1 >> i1corr = imfilter(double(i),w1,'corr'); • imfilter • Correlation • Same size result Roger S. Gaborski

  29. Lines w2 = 1 0 -1 1 0 -1 1 0 -1 >> i2corr = imfilter(double(i),w2,'corr'); • imfilter • Correlation • Same size result Roger S. Gaborski

  30. Lines w1 = 1 1 1 0 0 0 -1 -1 -1 >> i2conv = imfilter(double(i),w1,'conv'); • imfilter • Convolution • Same size result Roger S. Gaborski

  31. Lines w2 = 1 0 -1 1 0 -1 1 0 -1 >> i2conv = imfilter(double(i),w2,'conv'); • imfilter • Convolution • Same size result Roger S. Gaborski

  32. conv2 Function >> w1=[1 1 1;0 0 0; -1 -1 -1] w1 = 1 1 1 0 0 0 -1 -1 -1 >> i1 = conv2(double(i),w1); >> figure, imshow(i1, [ ]) >> max(i1(:)) ans = 1.5000 (image values are 0 and .5 Convolution operation 1x.5+1x.5+1x.5 = 1.5 Other operations are 0) Roger S. Gaborski

  33. conv2 Function >> w2=[1 1 1;0 0 0; -1 -1 -1]' w2 = 1 0 -1 1 0 -1 1 0 -1 >> i2 = conv2(double(i),w2); >> figure, imshow(i2, [ ]) Roger S. Gaborski

  34. Profile of i2 >> figure, plot(i2(100,:)) >> axis([ 1 300 -2 2]) Roger S. Gaborski

  35. Edge >> j = zeros(300); >> j(:,150:end)=.5; >> figure, imshow(j) 0 .5 Roger S. Gaborski

  36. Correlation >> w1 w1 = 1 1 1 0 0 0 -1 -1 -1 >> i1corr = imfilter(double(j),w1,'corr'); >> figure, imshow(i1corr,[ ]) Roger S. Gaborski

  37. Correlation >> w2 w2 = 1 0 -1 1 0 -1 1 0 -1 >> i2corr = imfilter(double(j),w2,'corr'); -1.5 Roger S. Gaborski

  38. Convolution >> w2 w2 = 1 0 -1 1 0 -1 1 0 -1 >> i2conv = imfilter(double(j),w2,'conv'); >> figure, imshow(i2conv,[ ]) 1.5 Roger S. Gaborski

  39. Roger S. Gaborski

  40. >> imP1=imread('Pineapple1.jpg'); >> figure, imshow(imP1) >> %Convert to Gray scale >> imP1gray = rgb2gray(imP1); >> figure, imshow(imP1gray) >>%Minimum and Maximum code values >> MAXcode = max(imP1gray(:)) MAXcode = 214 >> MINcode = min(imP1gray(:)) MINcode = 1 >>%Histogram Roger S. Gaborski

  41. Edges >> imP1=imread('Pineapple1.jpg'); >> figure, imshow(imP1) >> %Convert to Gray scale >> imP1gray = rgb2gray(imP1); >> figure, imshow(imP1gray) >> imP1grayNor = mat2gray(imP1gray, [ 0 255]); >> figure, hist(imP1grayNor(:)) Roger S. Gaborski

  42. Edges >> imP1=imread('Pineapple1.jpg'); >> figure, imshow(imP1) >> %Convert to Gray scale >> imP1gray = rgb2gray(imP1); >> figure, imshow(imP1gray) >> imP1grayNor = mat2gray(imP1gray, [ 0 255]); >> figure, hist(imP1grayNor(:)) >> >> w=[1 1 1;0 0 0; -1 -1 -1] w = 1 1 1 0 0 0 -1 -1 -1 >> imP1edge = conv2(double(imP1grayNor),w); >> figure, imshow(imP1edge, [ ]) Roger S. Gaborski

  43. >> figure, imshow(imP1edge,[ ]) >>figure, imshow(abs(imP1edge),[ ]) Roger S. Gaborski

  44. Edge Histogram Edge histogram Absolute Edge Histogram Roger S. Gaborski

  45. Edge Image Thresholds >> figure, imshow(abs(imP1edge)>1.0),title('Threshold 1.0') Roger S. Gaborski

  46. >> w=[1 1 1;0 0 0; -1 -1 -1]' w = 1 0 -1 1 0 -1 1 0 -1 >> imP1edge2 = conv2(double(imP1gray),w); >> figure, imshow(imP1edge2,[ ]) >> figure, imshow(abs(imP1edge2,[ ])) Roger S. Gaborski

  47. >> w=[1 1 1;0 0 0; -1 -1 -1] w = 1 1 1 0 0 0 -1 -1 -1 >> w=[1 1 1;0 0 0; -1 -1 -1]' w = 1 0 -1 1 0 -1 1 0 -1 Roger S. Gaborski

  48. MATLAB edge Function EDGE Find edges in intensity image. EDGE takes an intensity or a binary image I as its input, and returns a binary image BW of the same size as I, with 1's where the function finds edges in I and 0's elsewhere. EDGE supports six different edge-finding methods: The Sobel method finds edges using the Sobel approximation to the derivative. The Prewitt method finds edges using the Prewitt approximation to the derivative. The Roberts method finds edges using the Roberts approximation to the derivative. The Laplacian of Gaussian method finds edges by looking for zero crossings after filtering I with a Laplacian of Gaussian filter. The zero-cross method finds edges by looking for zero crossings after filtering I with a filter you specify. The Canny method finds edges by looking for local maxima of the gradient of I. The gradient is calculated using the derivative of a Gaussian filter. The method uses two thresholds, to detect strong and weak edges, and includes the weak edges in the output only if they are connected to strong edges. This method is therefore less likely than the others to be "fooled" by noise, and more likely to detect true weak edges. Roger S. Gaborski

  49. [BW,thresh,gv,gh] = edge(imP1grayNor,'prewitt'); >> [BW,thresh,gv,gh] = Edge(imP1grayNor,'prewitt'); >> figure, imshow(gv, [ ]), title(‘gv’) >> figure, imshow(gh, [ ]), title(‘gh’) >> figure, imshow(BW) >> thresh thresh = 0.0675 Roger S. Gaborski

  50. [BW,thresh,gv,gh] = edge(imP1grayNor,'sobel'); >> [BW,thresh,gv,gh] = edge(imP1grayNor,'sobel'); >> figure, imshow(gv,[ ]),title('gv') >> figure, imshow(gh,[ ]),title('gh') >> figure, imshow(BW),title('BW') >> thresh thresh = 0.0695 Roger S. Gaborski

More Related