1

OpenImaj の AdaptiveLocalThresholdContrast スレッシュホールドを使用して画像を 2 つの「セグメント」に処理し、処理された画像を表示する方法を学習しようとしています。次のコードを実行すると:

AdaptiveLocalThresholdContrast thresholder = new AdaptiveLocalThresholdContrast(10);
MBFImage input = ImageUtilities.readMBF(new File("/path/to/file.jpg"));
FImage flat = input.flatten();
DisplayUtilities.display(flat);
thresholder.processImage(flat);
DisplayUtilities.display(flat);

元の (平坦化された) イメージが表示され、thresholder.processImage(flat) の行で次のヌル ポインター例外が発生します。

Exception in thread "main" java.lang.NullPointerException
at org.openimaj.image.processing.threshold.AdaptiveLocalThresholdContrast.processImage(AdaptiveLocalThresholdContrast.java:74)

74 行目の AdaptiveLocalThresholdContrast のソース コードを見ましたが、ヌル ポインター例外の原因が明確ではありません。どんな助けでも大歓迎です。

http://www.openimaj.org/openimaj-image/image-processing/xref/org/openimaj/image/processing/threshold/AdaptiveLocalThresholdContrast.html

4

1 に答える 1

1

うーん、それはバグです (おそらく、ある時点でのリファクタリングの結果です - 申し訳ありません)。ソース ( https://github.com/openimaj/openimaj/commit/2f247e4ab0f7da02713e8545d4ac153aa08070b8 ) で修正され、jar の最新の「1.4-SNAPSHOT」バージョンでも利用できるようになりました。

于 2015-07-09T08:07:31.457 に答える