Okey I understand, thank you:)
I have to use nested 4 *for loops and my code part;

```
for(int i =lowpoint;i<(highpoint-1);i++)
{
for(int j = i+1;i<highpoint;j++)
{
for(int k = offpoint;k<highpoint;k++)
{
result1=function1(i,j,image);
result2=function2(image1,image2,integernumber);
for(int m=impoint;m<highpoint;m++){
result2=function3(image, ver-size,hor_size,,result1[0],result1[1],m);
result3=function4(result2,duoblenumber);
sum = sum+result3[m];
}
}
sum=sum/doublenumber2;
}
}
```

all functions include operations related to the pixel values of the images except function2.

pixel values operations, for example;

```
**public Mat [] Function(Mat[] imagearray, int ver_size, int hor_size, double doublenumber, int lowpoint, int highpoint, int offset_point){
public static double[] colorspace1;
public static double[] colorspace2;
public static double[] colorspace3;
float [] colorspace_u=new float[1];
for(int i=0;i<ver_size;i++){
for (int j=0;j<hor_size;j++){
colorspace1=imagearray[high_temp_point].get(i,j);
colorspace2=imagearray[low_temp__point].get(i,j);
colorspace_u[0]=division/(float)(colorspace2[highpoint]-colorspace1[lowpoint]);
if (colorspace_u[0]>5){
colorspace_u[0]=5;
}
else if(colorspace_u[0]<0.2){
colorspace_u[0]=(float)0.2;
}
image3.put(i,j,colorspace_u[0]);
colorspace3=imagearray[offset_point].get(i,j);
colorspace_u[0]=doublenumber-(float)(colorspace3[0]*(double)colorspace_u[0]);
image4.put(i,j,(float)colorspace_u[0]);
}
}
result[0]=image3;
result[1]=image4;
return result;
}**
```

//So other function's calculate like this.

heh

Yes, it took more than 1 hour to work. Why off-topic???

Nobody can help you if you don't 1l tell what you do to the images, 2l show an example image and tell the generic properties of the images (size..) 3) show your code and 4) describe the running environment - a low memory system could spend its time swapping.

Note that you should be able to find out where exactly the time is spent. Java has functions for that.

doing what, btw ?

where's the problem ?

my question is not off-topic or something, it is a very opencv related situation. javafx can be a special detail. You might think as java, I didn't think it would be hard. As for the details, I access the pixel values in the operations I do in the loops, and perform operations such as searching and changing depending on some conditions. the program runs very slowly in these for loops. In summary, the processes I deal with pixel values are huge. my pixel values are 16 bits

there are 4 more functions like this, in the loops.

please:

shoulddo.then we can try to help you using opencv's api better (NEVER write loops like that !)