フィルターのクリア

How to get the gradient of a pixel in an image?

8 ビュー (過去 30 日間)
Fego Etese
Fego Etese 2020 年 4 月 23 日
コメント済み: Fego Etese 2020 年 4 月 26 日
I am doing block processing on a fingeprint image and I will like to get the gradient of all the pixels in their x and y components separately using a sobel filter. I am doing this block by block.
I saw the function imgradient() but after reading the documentation it seems to be getting the gradient for the whole image that is passed to it, which in my case will be the block, except i understood wrongly, and if i did please help me out or is there any function i can use to get the gradient of just one pixel in the image block.

採用された回答

Image Analyst
Image Analyst 2020 年 4 月 23 日
imgradient() gets the gradient at every pixel, for every pixel in the image. The gradient cannot be computed from a single pixel because you need neighboring pixels to determine the slope and direction. Let's say you had one single pixel and it's value is 50. So what is it's gradient? It does not have a gradient because it has no neighbors and thus no slope from there to anywhere else.
If you want, you can call imgradient() on a whole image, or on a sub-image (block). It does not make sense to get the gradient of just one pixel, like I said. You get the gradient for a bunch of pixels and every pixels will have a gradient value associated with it that was determined by looking at neighboring pixels.
  8 件のコメント
Fego Etese
Fego Etese 2020 年 4 月 26 日
Fego Etese
Fego Etese 2020 年 4 月 26 日
I tried reading the coede you sent but i didnt understand it. Please check out this question.
Thanks

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by