The need for feature-size measurements on microchips for VLSI and other developing technologies with micrometer and submicrometer dimensions has resulted in using scanning electron microscopes (SEMs) for critical dimension measurements during fabrication. However, good measurement practice requires the ability to accurately predict the observed signal output for any given feature. The model used to predict the output then becomes the basis for measurement algorithms, error analysis, and proper calibration techniques. The SEM, especially for secondary electron imaging and low beam voltages, has lacked the ability to quantitatively predict image waveforms at the 0.01 μm level needed for sub-micrometer dimensional control. This paper describes such a model for SEM imaging and edge detection. A new approach to secondary-electron image modeling has been developed consisting of a surface integral (over the line geometry) of a probability density function which describes the likelihood of a secondary electron being generated by the primary beam and emitted at a given point in space, if that point coincides with the surface of a line. This probability density function can be determined by using either a state-of-the-art Monte Carlo technique or by using a modified diffusion model which is a good approximation to the Monte Carlo method and greatly reduces the computation time. The calculation of the image from this probability density function takes into account edge geometry and shadowing due to nearby edges as well as field effects due to any bias voltage on the electron-detector grid. The Monte Carlo approach takes into account the fact that low energy secondary electrons cannot be produced inside the specimen by a primary or high energy secondary electron after it exits the surface of the specimen. The resulting probability density function which is referred to here as "forward-looking" is, therefore, not a gaussian distribution. An alternate approach to determination of the probability density function uses a modified diffusion model which, although it does not take into account the forward-looking aspect of electron scattering at edges, is shown to approximate edge images well. The diffusion approach has the advantage that calculations can be readily performed on a desktop computer in seconds as compared to hours for Monte Carlo simulations. In addition, it is readily adapted to the development of edge detection algorithms and error analyses.