I am currently working on a demonstration of image processing in java (Applet).
I ran into a problem when my arrays are too large and I get the error message "java.lang.OutOfMemoryError: Java heap space".
The executed algorithm creates an NxD floating-point array, where: N is the number of pixels in the image, and D is the coordinates of each pixel plus the color space components of each pixel (usually 1 for grayscale or 3 for RGB). For each iteration of the algorithm, it creates one of these NxD floating point arrays and stores it for later use in the vector so that the applet user can look at the individual steps.
My client wants the program to be able to load an RGB 500x500 image and work as an upper bound. About 12 to 20 iterations per turn, so I should be able to store the 12x500x500x5 float in some way.
Is there a way to process all this data and, if possible, how?
An example of a problem: I upload an image ranging in size from 512 to 512 in shades of gray, and even before completing the first iteration, I run out of empty space. The line to which she points is as follows:
Y.add (new float [N] [D])
where Y is a vector, and N and D are as described above. This is the second instance of code using this line.
EDIT: the upper border, as I mentioned, but forgot to fix, should be approximately: 20+ x500x500x5 (20 iterations, 500 width, height 500, 5 dimensions (where 3 is RGB and 2 for coordinates (moving coordinates and also pixels, so I need to write down values that can and are decimal)) (Approximately 100,000,000 bytes)