how to use unicode with knearest::train for arabic character

asked 2017-08-03 10:06:38 -0600

I want to do something like that but when I do that the result is ASCII code, not Unicode

cv::Mat_<wchar_t> trainFeatures(40, 1);
    trainFeatures <<  'ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ;
    cout << trainFeatures;
edit retag flag offensive close merge delete

Comments

1

train data type must be CV_32F : no problem with unicode

LBerger gravatar imageLBerger ( 2017-08-03 10:28:41 -0600 )edit

already i use it but when i cout the mat give me ASCII values not Unicode values

walid hamdy gravatar imagewalid hamdy ( 2017-08-03 10:37:57 -0600 )edit

@walid, hamdy, you might need to explain, what you're trying to do here, and what you expect to achieve.

in general, character recognition works on image features, not plain text (whatever that is encoded in)

berak gravatar imageberak ( 2017-08-03 10:40:54 -0600 )edit

cv::Mat does not support wchar_t at all. it probably only compiles, because your compiler assumes, it's the same as unsigned short

berak gravatar imageberak ( 2017-08-03 10:44:11 -0600 )edit

again, you will need numbers for both train data and labels, not (unicode) characters.

berak gravatar imageberak ( 2017-08-03 10:50:07 -0600 )edit