this is the main
when compiling i got this:
--------------------Configuration: <Default>--------------------
D:\javafiles\Image Matching\ImageMatching.java:34: '.class' expected
mf_pixTrillice=mf.createPixels(int mf_getrows, int mf_getcols);
^
D:\javafiles\Image Matching\ImageMatching.java:34: ';' expected
mf_pixTrillice=mf.createPixels(int mf_getrows, int mf_getcols);
^
D:\javafiles\Image Matching\ImageMatching.java:34: ';' expected
mf_pixTrillice=mf.createPixels(int mf_getrows, int mf_getcols);
^
D:\javafiles\Image Matching\ImageMatching.java:35: '.class' expected
sf_pixTrillice=sf.createPixels(int sf_getrows, int sf_getcols);
^
D:\javafiles\Image Matching\ImageMatching.java:35: ';' expected
sf_pixTrillice=sf.createPixels(int sf_getrows, int sf_getcols);
^
D:\javafiles\Image Matching\ImageMatching.java:35: ';' expected
sf_pixTrillice=sf.createPixels(int sf_getrows, int sf_getcols);
^
6 errors
Process completed.
import java.util.*; public class ImageMatching { public static void main (String[] args) { Scanner readDim=new Scanner(System.in); MainFrame mf = new MainFrame(); SubFrame sf = new SubFrame (); Random rand = new Random(); int mf_getrows, mf_getcols, sf_getrows, sf_getcols; int [][] mf_pixTrillice ; int [][] sf_pixTrillice ; int [][][] coRel; System.out.println("size of the main window:"); System.out.print("Horizontal Magnitude ="); mf_getrows=readDim.nextInt(); System.out.print("Vertical Magnitude ="); mf_getcols=readDim.nextInt(); mf.setSize(mf_getrows, mf_getcols);// assign to mf_horz mag and vert mag System.out.print("size of the Sub window:"); System.out.print("\nHorizontal Magnitude ="); sf_getrows=readDim.nextInt(); System.out.print("Vertical Magnitude ="); sf_getcols=readDim.nextInt(); sf.setSize(sf_getrows, sf_getcols);// assign to sf_horz mag and vert mag mf.defineValidWindows(mf_getrows,mf_getcols,sf_getrows,sf_getcols);//if sf coor > mf coor-> reverse; else set/assign mf_pixTrillice=mf.createPixels(int mf_getrows, int mf_getcols); sf_pixTrillice=sf.createPixels(int sf_getrows, int sf_getcols); for(int i=0; i<mf_pixTrillice.length; i++) { for (int j=0; j<mf_getcols; j++) { int value=(int) (10*rand.nextInt()); // assigning random values to the pixels if (value < 0) mf_pixTrillice[i][j]=value*(-1); else mf_pixTrillice[i][j]=value; System.out.print(mf_pixTrillice[i][j]); System.out.print(" "); } System.out.print("\n"); } System.out.print("\n\n"); for(int i=0; i<sf_pixTrillice.length; i++) { for (int j=0; j<sf_getcols; j++) { int value=(int) (10*rand.nextInt()); // assigning random values to the pixels if (value < 0) sf_pixTrillice[i][j]=value*(-1); else sf_pixTrillice[i][j]=value; System.out.print(sf_pixTrillice[i][j]); System.out.print(" "); } System.out.print("\n"); } } } ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- public class MainFrame { public int OrgPnt1_X; public int OrgPnt1_Y; public int OrgPnt2_X; public int OrgPnt2_Y; int returnCols; public int H_Magnitude; public int V_Magnitude; public void setSize(int dim1, int dim2) { H_Magnitude=dim1; V_Magnitude=dim2; OrgPnt1_X=H_Magnitude; OrgPnt1_Y=V_Magnitude; } public static int [][] createPixels(int row, int col) { returnCols = col; int [][] Pixels=new int [row][col]; return Pixels; } public int getColsNum() { return returnCols; } public void defineValidWindows(int pnt1x, int pnt1y,int pnt2x, int pnt2y) // this method belongs for both super and sub classs { int sf_OrgPnt2_X=pnt2x; int sf_OrgPnt2_Y=pnt2y; int mf_OrgPnt1_X=pnt1x; int mf_OrgPnt1_Y=pnt1y; int temp=0; // in java a variable MUST be initialized if ( (mf_OrgPnt1_X < sf_OrgPnt2_X) || (mf_OrgPnt1_Y < sf_OrgPnt2_Y ) ) { if (mf_OrgPnt1_X < sf_OrgPnt2_X) { temp=mf_OrgPnt1_X; mf_OrgPnt1_X=sf_OrgPnt2_X; sf_OrgPnt2_X=temp; OrgPnt1_X=mf_OrgPnt1_X; OrgPnt2_X=sf_OrgPnt2_X; } if (mf_OrgPnt1_Y < sf_OrgPnt2_Y) { temp=mf_OrgPnt1_Y; mf_OrgPnt1_Y=sf_OrgPnt2_Y; sf_OrgPnt2_Y=temp; OrgPnt1_Y=mf_OrgPnt1_Y; OrgPnt2_Y=sf_OrgPnt2_Y; } } if ((mf_OrgPnt1_X==sf_OrgPnt2_X) || (mf_OrgPnt1_Y==sf_OrgPnt2_Y) ) { if ( sf_OrgPnt2_X==mf_OrgPnt1_X ) { sf_OrgPnt2_X=mf_OrgPnt1_X - 1; OrgPnt2_X=sf_OrgPnt2_X; } if ( sf_OrgPnt2_Y==mf_OrgPnt1_Y ) { sf_OrgPnt2_Y=mf_OrgPnt1_Y-1; OrgPnt2_Y=sf_OrgPnt2_Y; } } }//end of the method }// end of the class class SubFrame extends MainFrame { /* SubFrame(int horz_dim, int vert_dim) { super(horz_dim,vert_dim); } */ }// end of the class