Wednesday, December 8, 2010

(3) SetInputImage(String file)

public void setInputImage(String file){  file name is set as a parameter 
try {
inputSourceImage = ImageIO.read(new File(file)); Tries to read image
}
catch (Exception e) {
e.printStackTrace();
}
wpixel = inputSourceImage.getWidth(null); //num of pixels  
sets pixel width to width of image
hpixel = inputSourceImage.getHeight(null); //num of pixels
sets pixel height to hight of image

screenWidth = wpixel*mag;
screenHeight = (hpixel*mag + buttonHeight + titleHeight);
setSize(screenWidth*2+space, screenHeight+100);
graphStartX = screenWidth + space; //maybe *mag or (screenWidth+space);
i=0;
edgecounter =0;

totaldata = new int[(wpixel*hpixel)*4]; set length total data
edgepoints = new int[(wpixel*hpixel)*4]; set length edge points
processedImage = pixelArray(); processedImage[][] = pixelArray()

             ~~~~~~~~~~~~~~ PixelArray() <-- CLICK! ~~~~~~~~~~~~~~~
FindEdge(processedImage);

            ~~~~~~~~~~~~~~ FindEdge() <-- CLICK! ~~~~~~~~~~~~~~

//printPoints(edgepoints); THIS IS CALLED IN FINDEDGE()
//printDerivative(totaldata); THIS IS CALLED IN FINDEDGE()
//System.out.println("totaldatalength" + totaldata.length);
//System.out.println("w: " + wpixel);
//System.out.println("h: " + hpixel);
efficiency = findEfficiency(totaldata);
 findEfficiency()






System.out.println("E:" + efficiency + "%");

}

No comments:

Post a Comment