and try to assign the pixel to the HardAssigner, I am always stuck because the pixel is a Float[] but Hardassigner.assign expects a float[]. Any direction as to solving this would help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You've sort of answered the question in the exercise - the problem is that Java doesn't auto-box /unbox arrays, so you have to do the conversion manually, which incurs a potentially significant cost. To do the conversion you can do something like this:
float[] fp = new float[3];
for (int i = 0;i < 3;i++){
fp[i] = pixel[i];
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am just starting off with OpenIMAJ and am stuck at 3.1.1. Exercise 1: The PixelProcessor.
When I try to use the stump that was provided
and try to assign the pixel to the HardAssigner, I am always stuck because the pixel is a Float[] but Hardassigner.assign expects a float[]. Any direction as to solving this would help.
You've sort of answered the question in the exercise - the problem is that Java doesn't auto-box /unbox arrays, so you have to do the conversion manually, which incurs a potentially significant cost. To do the conversion you can do something like this:
Ah, ok - I clearly didn't see the forrest for all the trees ... if I'd only know how to use OpenIMAJ, I'd could make it do that :D