I'm working with visual studio 10, qt addin and opecv library.
What I want to do is to load multiple files using a for-loop:
(I have ui.image_templates_comboBox->currentText() = "cat")
for (int i = 1; i <= 15; i++){
string currentText = ui.image_templates_comboBox->currentText().toStdString();
char name[40];
sprintf(name, "Logos/cat/%s_%d.tif", ¤tText, i);
templ_img [i] = cv::imread( name );
So, I thought this should be working OK, but when I debug it, I hover my mouse above "name" and I notice that there are 4 non-english characters preceding currentText value.
I ask 2 questions:
a) How is it possible to ommit those 4 useless characters? (I typed them as "1234" as this site couldn't display them)
- name 0x003a7b04 "Logos/cat/1234cat_1.tif" char [40]
b) It is possible to collapse those 4 lines into 1 using an expression inside imread()?