Closed GoogleCodeExporter closed 9 years ago
I've already fixed this to the equivalent
for (i = 0; i <= nEigens; i++) {
at
http://code.google.com/p/javacv/source/browse/samples/FaceRecognition.java?spec=
svnce6c88e751053a06b1deb4e65f2490b5fe2694b0&r=ce6c88e751053a06b1deb4e65f2490b5fe
2694b0#547
Let me know if that doesn't work for some reason, thanks!
Original comment by samuel.a...@gmail.com
on 1 Feb 2013 at 3:32
Hi Samuel,
Quick reply. Cool!
But that's exactly what was on the example and didn't work.
What happens is:
eigenVectArr = new IplImage[nTrainFaces]; // nTrainFaces = 25
for (i = 0; i <= nEigens; i++) { // nEigens = 24
// some code...
eigenVectArr[i] = new IplImage(pointer);
}
That's because during doPCA() => 'nEigens = nTrainFaces - 1;'
So after this loop the last item was never initialized => 'eigenVectArr[24] ==
null' and later on it crashes.
Original comment by ronaldo....@grapplemobile.com
on 1 Feb 2013 at 3:38
Well
for (i = 0; i < 25; i++) {
and
for (i = 0; i <= 24; i++) {
are the same, so, please make sure again.
Original comment by samuel.a...@gmail.com
on 2 Feb 2013 at 1:11
Hi Samuel,
I do agree it's the same and the source link you provide do point to a correct
code (uses '<=' ); but, there's two issues here:
1. On my comment #2 I copied the wrong code. It was not supposed to contain the
'<='. I apologise for that.
2. I've just double checked the downloaded file 'javacv-0.3-src.zip' and the
FaceRecognition.java inside the samples folder line 547 is different from the
one showed on your link. the line is: 'for (i = 0; i < nEigens; i++) {' leading
to the NullPointerException.
Apparently the problem was at the moment the person was zipping the file for
download.
regards,
Original comment by ronaldo....@grapplemobile.com
on 4 Feb 2013 at 9:17
Yes, it was fixed recently in the repository, so it's not in the distribution
package, yet. Thanks for confirming!
Original comment by samuel.a...@gmail.com
on 5 Feb 2013 at 1:06
Fix included in latest release of JavaCV 0.4, thanks again!
Original comment by samuel.a...@gmail.com
on 3 Mar 2013 at 12:19
Original issue reported on code.google.com by
ronaldo....@grapplemobile.com
on 1 Feb 2013 at 3:24