150 likes | 280 Views
Gradient. 學生:黃菖裕 學號: r9506001 老師:張顧耀. Outline. Introduction Gradient Magnitude Gradient Magnitude With Smoothing Derivative Without Smoothing Coding Compare A ppendix Challenge Conclusion. 1. Introduction. Gradient filters: compute both the image of gradient vectors and
E N D
Gradient 學生:黃菖裕 學號:r9506001 老師:張顧耀
Outline • Introduction • Gradient Magnitude • Gradient Magnitude With Smoothing • Derivative Without Smoothing • Coding • Compare • Appendix • Challenge • Conclusion
1. Introduction Gradient filters: compute both the image of gradient vectors and the image of magnitudes of those vectors. Gradient magnitudes at each pixel are used to determine which pixels lie along edge boundaries gradient vector
2. Gradient Magnitude to help in the determination of object contours and the separation of homogeneous regions before after
3. Gradient Magnitude With Smoothing (σ) of the Gaussian: σ is the standard deviation of the distribution σ = 1 σ = 3 σ = 5
Smoothing used to `blur' images and remove detail and noise before after
4. Derivative Without Smoothing before after
5. Coding 5.1 Gradient Magnitude • itk::CastImageFilter • itk::GradientMagnitudeImageFilter • itk::RescaleIntensityImageFilter 5.2 Gradient Magnitude With Smoothing • itk::CastImageFilter • itk::GradientMagnitudeRecursiveGaussianImageFilter • Gaussianfilter->SetSigma( sigma ) • itk::RescaleIntensityImageFilter 5.3 Derivative Without Smoothing • itk::CastImageFilter • itk::DerivativeImageFilter • Derivativefilter->SetOrder(2) • Derivativefilter->SetDirection(2) • itk::RescaleIntensityImageFilter
6.Compare original canny edge binary threshold lighter Derivative Without Smoothing Gradient Magnitude Gradient Magnitude σ = 5
7. Appendix Laplacian of Gaussian before after
8. Challenge 8.1 GradientMagnitude Different: 1.save file • typedef unsigned charOutputPixelType; • typedef itk::GradientMagnitudeImageFilter<RealImageType, RealImageType > FilterType; • typedef itk::RescaleIntensityImageFilter<RealImageType, OutputImageType > RescaleFilter; • typedef itk::ImageFileWriter<OutputImageType> WriterType; • writer->SetInput(rescale->GetOutput()); 2.draw image • typedef signed short OutputPixelType; • typedef itk::GradientMagnitudeImageFilter<RealImageType, OutputImageType > FilterType; • pDoc->ptrDupImage->Graft(filter->GetOutput());
3.draw image • typedef signed short OutputPixelType; • typedef itk::GradientMagnitudeImageFilter<RealImageType, RealImageType > FilterType; • typedef itk::RescaleIntensityImageFilter<RealImageType, OutputImageType > RescaleFilter; • pDoc->ptrDupImage->Graft(rescale->GetOutput());
8.2 GradientMagnitude With Smoothing Save file Draw image σ = 1 σ = 3 σ = 5
8.3 Derivative Without Smoothing Draw image Save file
Conclusion • Lots of method can be used to handle approximate process so that how to choice tools is important • Wanting to understand the processing function of images, the better is to realize the back mathematical meaning