Public bug reported:

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=fr_FR.UTF-8
atof(1.23)=1,000000

** Affects: opencv (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: libopencv-highgui locale

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1198249

Title:
  cv::imshow() function call changes current locale

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/opencv/+bug/1198249/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to