Skip to content

Commit e9809c4

Browse files
authored
Merge pull request #207 from githubdoe/fix_histogram_crash
Fixed bug in pixelstats.cpp that was causing intermittent crash
2 parents 56e1c4f + 65ecfb5 commit e9809c4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pixelstats.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,8 @@ void pixelStats::updateHisto(){
493493
ui->histo->detachItems( QwtPlotItem::Rtti_PlotCurve);
494494
ui->histo->detachItems( QwtPlotItem::Rtti_PlotMarker);
495495
ui->histo->detachItems(QwtPlotItem::Rtti_PlotItem);
496-
// Quantize the hue to 30 levels
497-
// and the saturation to 32 levels
498-
int hbins = 1000, sbins = 32;
499-
int histSize[] = {hbins, sbins};
500-
// hue varies from 0 to 179, see cvtColor
496+
int hbins = 1000; // make histogram with 1000 bins
497+
int histSize[] = {hbins};
501498

502499

503500
cv::Mat hist;
@@ -510,7 +507,7 @@ void pixelStats::updateHisto(){
510507

511508
float hranges[] = { (float)m_wf->min, (float)m_wf->max};
512509
const float* ranges[] = { hranges };
513-
int channels[] = {0, 1};
510+
int channels[] = { 0 };
514511
cv::calcHist( &values, 1, channels, m_wf->workMask, // do not use mask
515512
hist, 1, histSize, ranges,
516513
true, // the histogram is uniform

0 commit comments

Comments
 (0)