【发布时间】:2014-05-06 17:18:15
【问题描述】:
我在 Eclipse 中尝试了 Blobscanner 的 hand_gesture_recognition。
有这条线可以得到一个像素的红色值:
int [] Background;
void Set(PImage I){
for(int i=0; i<I.width*I.height; i++){
int iP=I.pixels[i];
Background[i*3]=(int)red(iP);
}
}
最后一行是这个错误的原因:
Exception in thread "Animation Thread" java.lang.NullPointerException
at processing.core.PApplet.red(Unknown Source)
at Test$PBGS.Set(Test.java:475)
at Test$PBGS.<init>(Test.java:466)
at Test.setup(Test.java:39)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我猜这与如果您在 Eclipse 中实现处理,您必须将 color 类型更改为 int 的点有关。那么,如果您想在 Eclipse 中使用 Processing,有什么方法可以更改/实现这个 red() 方法?
【问题讨论】:
标签: java eclipse processing