According to nondestructive nitrogen content detection techniques for greenhouse cultivated crops, an experimental process for sweet pepper nitrogen detection was described based on ridge regression analysis of nearinfrared reflectivity (NIR) spectral data in this paper. Firstly, the targeted crop spectral images in leaf scale were captured by NIR reflectance spectral imaging technique; secondly, a spectral digital image processing was launched by using image analysis software to extract spectral data; thirdly, variables were screened by statistical analysis on the data; finally, a crop nutrition detection model was established by completing agricultural chemical analysis. In the data processing phase, ridge regression, which is a kind of biased estimation method, was adopted to obtain the regression equation. In the ridge regression analysis, characteristic bands were screened further, then, the nitrogen nutrition detection model of sweet pepper leaf was gotten based on NIR data of three characteristic bands. The adjusted R2 in the model is 0.843, the RMSE is 0.105.