1 | initial version |
You don't load your image in the loop, therefor, when you change the value with your trackbar, it doesn't load a new image. I suggest to load both image, into two different Mat. Compute all the descriptors for the both images. After that, you use the trackbar has a boolean to point to the right image.
//Create Matching class
CMareMatchingClass MColorMatch;
CMareMatchingClass MBnWMatch;
//Input PatchImg
MColorMatch.ExtractPatchSurf(PatchImgColor);
MBnWMatch.ExtractPatchSurf(PatchImgBnW);
...
if( colorInt == 1 )
res = MMColorMatch.GetObjectRectAndBestH(BackGroundImg, &rect4pt);
else
res = MMBnWMatch.GetObjectRectAndBestH(BackGroundImg, &rect4pt);
if( res 1= 0 )
...
2 | add explanations. |
You don't load your image in the loop, therefor, when you change the value with your trackbar, it doesn't load a new image. I suggest to load both image, into two different Mat. Compute all the descriptors for the both images. After that, you use the trackbar has a boolean to point to the right image.
//Create Matching class
CMareMatchingClass MColorMatch;
CMareMatchingClass MBnWMatch;
//Input PatchImg
MColorMatch.ExtractPatchSurf(PatchImgColor);
MBnWMatch.ExtractPatchSurf(PatchImgBnW);
...
if( colorInt == 1 )
res = MMColorMatch.GetObjectRectAndBestH(BackGroundImg, &rect4pt);
else
res = MMBnWMatch.GetObjectRectAndBestH(BackGroundImg, &rect4pt);
if( res 1= == 0 )
...
[EDIT] You have to: