| 187 | |
| 188 | |
| 189 | string jsonFormat(string key, string value, string type){ |
| 190 | stringstream jsonFormatMessage; |
| 191 | jsonFormatMessage << ( "\"" + key + "\": " ); |
| 192 | |
| 193 | if(type == "string") |
| 194 | jsonFormatMessage << ( "\"" + value + "\"" ); |
| 195 | if(type == "rstring") |
| 196 | jsonFormatMessage << value; |
| 197 | if(type == "int") |
| 198 | jsonFormatMessage << stoi(value); |
| 199 | if(type == "float") |
| 200 | jsonFormatMessage << (float)stof(value); |
| 201 | if(type == "double") |
| 202 | jsonFormatMessage << (double)stof(value); |
| 203 | if (type == "bool") |
| 204 | jsonFormatMessage << ((value == "true" || value == "1") ? "true" : "false"); |
| 205 | |
| 206 | return jsonFormatMessage.str(); |
| 207 | } |
| 208 | |
| 209 | // Return JSON string for the tracker effect |
| 210 | string trackerJson(cv::Rect2d r, bool onlyProtoPath){ |
no outgoing calls
no test coverage detected