First time here? Check out the FAQ!

Ask Your Question
1

Is it possible for calcHist to return a hist with NaN

asked Jul 20 '13

zhihua gravatar image

updated Jul 21 '13

Hi, everyone

I am currently using calcHist function to do some feature extraction processing. But I encounter a problem that the hist which is returned by calcHist may contains NaN value. I'm wondering if this situation is normal for calcHist function? And why this happens?

Zhihua

Preview: (hide)

Comments

1

could you (edit and) show some code ?

berak gravatar imageberak (Jul 21 '13)edit

I have the same problem when I try to calculate a histogram over an image with only one color (e.g. a matrix full of CV_RGB(0,0,250)'s). I do this many times and in random instances the output histogram is full of NaN values.

jorjazo gravatar imagejorjazo (Oct 31 '13)edit

1 answer

Sort by » oldest newest most voted
0

answered Jun 18 '17

waschbaer gravatar image

I don't get NaN, even the matrix includes many NaN, it seems like it will ignore NaN as a single bin. Unless, the whole matrix contains only NaN, in that case, I don't know what will happen.

Preview: (hide)

Question Tools

Stats

Asked: Jul 20 '13

Seen: 662 times

Last updated: Jun 17 '17