In the departments of petroleum and geology,many important parameters come from the cores of rocks,and the core images which play a key role in the research on cores are the firsthand data after getting cores by drilling. But it is not enough to watch only the surface images of the cores for obtaining the authentic form of them. Therefore,the three-dimensional reconstruction is necessary. And some damages on the cores will inevitably occur during the drilling process. A sort of online three-dimensional reconstruction technology is put forward,which repairs the core images simply and then reconstructs the images by using OpenGL and the online three-dimensional reconstruction technology based on COM component technology. As a result,geologists can get three-dimensional images of the cores without being on the spot. Practices indicate the online three-dimensional reconstruction technology shows a big utility value in the departments of petroleum and geology.