Skip to content
This repository was archived by the owner on Feb 21, 2021. It is now read-only.

Commit e69cc39

Browse files
committed
fix a bug about histogram visualization with Java 8
1 parent d1af95c commit e69cc39

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/it/polito/teaching/cv/VideoController.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,19 @@ private void showHistogram(Mat frame, boolean gray)
275275
}
276276
}
277277

278-
// display the whole
279-
this.histogram.setImage(mat2Image(histImage));
278+
// display the whole, on the FX thread
279+
final Image histImg = mat2Image(histImage);
280+
281+
Platform.runLater(new Runnable() {
282+
283+
@Override
284+
public void run()
285+
{
286+
histogram.setImage(histImg);
287+
288+
}
289+
});
290+
280291
}
281292

282293
/**

0 commit comments

Comments
 (0)