Imhist func not working for a user made matrix!!

I need to do a basic operation in a window of an image.I defined a matrix(as a given window.)now i want to find it's histogram..the value x and y ([x y]=imhist(matrix))are not what one would expect if it would have been an image.

3 件のコメント

Matt J
Matt J 2018 年 2 月 18 日
Maybe your expectations are wrong?
Pritisman Kar
Pritisman Kar 2018 年 2 月 19 日
No the thing is that it's binlocation are getting normalised but frequency of a bin location(which must be an integer)is being displayed as x.so only 0 and 1 binlocation is displayed.
Jan
Jan 2018 年 2 月 19 日
@Pritisman Kar: Please post the code, some example input data and explain your expectations. Currently your question is not clear.

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

回答 (2 件)

Abhishek Ballaney
Abhishek Ballaney 2018 年 2 月 20 日

0 投票

https://www.mathworks.in/help/images/ref/imhist.html
Walter Roberson
Walter Roberson 2018 年 2 月 20 日

0 投票

Your synthetic matrix has values greater than 1 but it is class double, because you did mathematical calculations on uint8 values in the range 0 to 255 that are not defined for uint8 so you had taken double() of your uint8 data. But you forgot that you need to uint8() back afterwards before image processing.

質問済み:

2018 年 2 月 18 日

回答済み:

2018 年 2 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by