开发者

Plot gradient magnitudes of a colour image in matlab

开发者 https://www.devze.com 2023-01-20 09:23 出处:网络
I would like to plot gradient magnitudes of an color image in matlab. Precisely saying i want the gradient in my x-axis and the log of probability densit开发者_C百科y on my y axis. i would request if

I would like to plot gradient magnitudes of an color image in matlab. Precisely saying i want the gradient in my x-axis and the log of probability densit开发者_C百科y on my y axis. i would request if someone can help me out. Thanks


These are the steps you'll need to figure out (I'm not going to write code for you, because I haven't got Matlab at home, and because I'm lazy):

  1. Convert your image to grayscale.
  2. Determine a suitable finite-difference approximation to the gradient operator.
  3. Apply the finite-difference kernel using conv2.
  4. Take the abs of the result.
  5. Use hist to calculate a histogram.
  6. Plot the result, converting as appropriate with log, or semilogy.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号