image processing
play

Image Processing CS 110 Medical Images The image cannot - PowerPoint PPT Presentation

Image Processing CS 110 Medical Images The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file


  1. Image ¡Processing ¡ CS ¡110 ¡

  2. Medical ¡Images ¡ The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. Dig3al ¡Image ¡Processing, ¡Spring ¡2006 ¡ 2 ¡

  3. Image ¡Processing ¡in ¡Manufacturing ¡ Dig3al ¡Image ¡Processing, ¡Spring ¡2006 ¡ 3 ¡

  4. What ¡can ¡you ¡do ¡with ¡Image ¡Processing? ¡ ¡ Inspect, ¡Measure, ¡and ¡Count ¡using ¡Photos ¡and ¡Video ¡ h@p://www.youtube.com/watch?v=KsTtNWVhpgI ¡ ¡ Image ¡Processing ¡So<ware ¡ h@p://www.youtube.com/watch?v=1WJp9mGnWSM ¡ ¡

  5. Thresholding ¡for ¡Image ¡Segmenta3on ¡ • Pixels ¡below ¡a ¡cutoff ¡value ¡are ¡set ¡to ¡black ¡ • Pixels ¡above ¡a ¡cutoff ¡value ¡are ¡set ¡to ¡white ¡

  6. Image Enhancement - Color and intensity adjustment - Histogram equalization Kun Huang, Ohio State / Digital Image Processing using Matlab, By R.C.Gonzalez, R.E.Woods, and S.L.Eddins

  7. Implemen3ng ¡a ¡Color ¡Histogram ¡in ¡Processing ¡ // ¡Histogram ¡ ¡ // ¡Arrays ¡to ¡hold ¡histogram ¡values ¡ ¡ ¡// ¡Find ¡max ¡value ¡ ¡ ¡// ¡Lines ¡ int[] ¡aa ¡= ¡new ¡int[256]; ¡ ¡ ¡float ¡max ¡= ¡0.0; ¡ ¡ ¡float ¡h; ¡ int[] ¡ra ¡= ¡new ¡int[256]; ¡ ¡ ¡for ¡(int ¡i=0; ¡i<256; ¡i++) ¡{ ¡ ¡ ¡for ¡(int ¡i=0; ¡i<256; ¡i++) ¡{ ¡ int[] ¡ga ¡= ¡new ¡int[256]; ¡ ¡ ¡ ¡ ¡if ¡(ra[i] ¡> ¡max) ¡max ¡= ¡ra[i]; ¡ ¡ ¡ ¡ ¡// ¡all ¡ int[] ¡ba ¡= ¡new ¡int[256]; ¡ ¡ ¡ ¡ ¡if ¡(ga[i] ¡> ¡max) ¡max ¡= ¡ga[i]; ¡ ¡ ¡ ¡ ¡stroke(0); ¡ ¡ ¡ ¡ ¡ ¡if ¡(ba[i] ¡> ¡max) ¡max ¡= ¡ba[i]; ¡ ¡ ¡ ¡ ¡h ¡= ¡map(aa[i], ¡0, ¡max, ¡0, ¡255); ¡ PImage ¡img; ¡ ¡ ¡ ¡ ¡if ¡(aa[i] ¡> ¡max) ¡max ¡= ¡aa[i]; ¡ ¡ ¡ ¡ ¡line(i, ¡255, ¡i, ¡255-­‑h); ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡ ¡ ¡ void ¡setup() ¡{ ¡ ¡ ¡ ¡ ¡ ¡// ¡red ¡ ¡ ¡size(516, ¡516); ¡ ¡// ¡Draw ¡scaled ¡histogram ¡ ¡ ¡ ¡ ¡stroke(255,0,0); ¡ ¡ ¡img ¡= ¡loadImage("kodim02.png"); ¡ ¡ ¡ ¡ ¡background(255); ¡ ¡ ¡ ¡ ¡h ¡= ¡map(ra[i], ¡0, ¡max, ¡0, ¡255); ¡ ¡ ¡img.loadPixels(); ¡ ¡ ¡noFill(); ¡ ¡ ¡ ¡ ¡line(257+i, ¡255, ¡257+i, ¡255-­‑h); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Sum ¡up ¡all ¡pixel ¡values ¡ ¡ ¡ ¡// ¡Borders ¡ ¡ ¡ ¡ ¡// ¡green ¡ ¡ ¡for ¡(int ¡i=0; ¡i<img.pixels.length; ¡i++) ¡{ ¡ ¡ ¡stroke(0); ¡ ¡ ¡ ¡ ¡stroke(0,255,0); ¡ ¡ ¡ ¡ ¡float ¡r ¡= ¡red(img.pixels[i]); ¡ ¡ ¡rect(0, ¡0, ¡256, ¡256); ¡ ¡ ¡ ¡ ¡h ¡= ¡map(ga[i], ¡0, ¡max, ¡0, ¡255); ¡ ¡ ¡ ¡ ¡float ¡g ¡= ¡green(img.pixels[i]); ¡ ¡ ¡stroke(255,0,0); ¡ ¡ ¡ ¡ ¡line(i+1, ¡514, ¡i+1, ¡514-­‑h); ¡ ¡ ¡ ¡ ¡float ¡b ¡= ¡blue(img.pixels[i]); ¡ ¡ ¡rect(257, ¡0, ¡256, ¡256); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡stroke(0,255,0); ¡ ¡ ¡ ¡ ¡// ¡blue ¡ ¡ ¡ ¡ ¡// ¡Increment ¡histogram ¡item ¡amounts ¡ ¡ ¡rect(0, ¡257, ¡256, ¡256); ¡ ¡ ¡ ¡ ¡stroke(0,0,255); ¡ ¡ ¡ ¡ ¡ra[ ¡int(r) ¡]++; ¡ ¡ ¡stroke(0,0,255); ¡ ¡ ¡ ¡ ¡h ¡= ¡map(ba[i], ¡0, ¡max, ¡0, ¡255); ¡ ¡ ¡ ¡ ¡ga[ ¡int(g) ¡]++; ¡ ¡ ¡rect(257, ¡257, ¡256, ¡256); ¡ ¡ ¡ ¡ ¡line(257+i, ¡514, ¡257+i, ¡514-­‑h); ¡ ¡ ¡ ¡ ¡ba[ ¡int(b) ¡]++; ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡ ¡aa[ ¡int((r+g+b)/3.0) ¡]++; ¡ } ¡ ¡ ¡} ¡

  8. Feature Extraction - Region detection – morphology manipulation - Dilate and Erode - Open - Erode à dilate - Small objects are removed - Close - Dilate à Erode - Holes are closed - Skeleton and perimeter Kun Huang, Ohio State / Digital Image Processing using Matlab, By R.C.Gonzalez, R.E.Woods, and S.L.Eddins

  9. Erode ¡+ ¡Dilate ¡to ¡Despeckle ¡ Erode ¡ Dilate ¡

  10. Spa3al ¡Filtering ¡ Input ¡Image ¡ Output ¡Image ¡ w 1 w 2 w 3 A B C w 4 w 5 w 6 D E F E' w 7 w 8 w 7 G H I Spa3al ¡ Kernel ¡Filter ¡ E' ¡= ¡w 1 A+w 2 B+w 3 C+w 4 D+w 5 E+w 6 F+w 7 G+w 8 H+w 7 I ¡

  11. Image Enhancement - Denoise - Averaging 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 - Median filter 20 5 43 78 3 22 115 189 200 43 ¡ Kun Huang, Ohio State / Digital Image Processing using Matlab, By R.C.Gonzalez, R.E.Woods, and S.L.Eddins

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend