Open standarm opened 6 years ago
Thanks for you attention. My english is poor, please see the function "create_initial_image" where "gray_image.convertTo(floatImage, CV_32FC1, 1.0 / 255.0, 0)" is express. This means we must convert the image to floating point type, 1.0 / 255.0 means the range is 0 to 1 after converted. So you must ensure the convertTo function support CV_S16C1. You should ensure the date type is identical .
If you want reduce the memory consume, i suggest you pay attention to the following aspects:
sift.cpp->num_octaves->temp = cvRound(log(size_temp) / log((float)2) - 2) you can reduce the layer, it is temp, modified it to "temp = cvRound(log(size_temp) / log((float)2) - 3)" or "temp = cvRound(log(size_temp) / log((float)2) - 4)"
main.cpp->MySift sift_1(0, 3, 0.04, 10, 1.6, true) change it to "MySift sift_1(0, 3, 0.04, 10, 1.6, false)"
delete the main.cpp->image_fusion(image_1, image_2, homography, fusion_image, mosaic_image, regist_image) the function image_funct
main.cpp->gauss_pyr_1, dog_pyr_1 and main.cpp->gauss_pyr_2, dog_pyr_2 is global variables, so you can change it to local variable. you can combine "sift_1.detect" and "sift_1.comput_des".
I note if I change all
CV_32FC1
in your code intoCV_16SC1
, then the programe can save a lot memory consumption. But thesift_1.detect
will fail to get thatkeypoints_1
in following. How to change the other code for the change?