cv::imshow() function call changes current locale
Bug #1198249 reported by
elpro
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
opencv (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
A call to cv::imshow() function changes current locale.
Here is a piece of code to reproduce the bug :
#include <cv.h>
#include <highgui.h>
#include <locale.h>
void getLocale(void)
{
printf( "LC_ALL=%s\n", setlocale( LC_ALL, NULL));
printf( "LC_NUMERIC=%s\n", setlocale( LC_NUMERIC, NULL));
}
int main(void)
{
cv::Mat img( 480, 640, CV_8UC3);
getLocale();
printf( "atof(1.23)=%f\n", atof("1.23"));
cv::imshow( "test", img);
getLocale();
printf( "atof(1.23)=%f\n", atof("1.23"));
cv::waitKey(5);
}
The result on my computer (Ubuntu 12.04.2 LTS AMD64):
LC_ALL=C
LC_NUMERIC=C
atof(1.23)=1.230000
LC_ALL=fr_FR.UTF-8
LC_NUMERIC=
atof(1.23)=1,000000
To post a comment you must log in.