Ask Your Question
0

OpenCV crashes when waitKey receives a Cyrillic letter

asked 2018-10-16 14:57:13 -0600

nikola gravatar image

updated 2018-10-17 02:31:29 -0600

I have written a simple OpenCV video player. I have added some navigation 'q' - exits the program, 'p' - toggles play/pause mode, etc. Everything works fine but if I forgot to switch to Latin keyboard and type a letter in Cyrillic the program crashes immediately with the following error:

ASSERT: "false" in file qasciikey.cpp, line 495

I have identified that the crash is caused by waitKey(). It is the same with the extended version waitKeyEx(). Is there a workaround this?

I forgot to mention that I use OpenCV 3.2 with Qt support and Ubuntu 16.04.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-10-16 18:03:56 -0600

berak gravatar image

updated 2018-10-17 02:32:32 -0600

Is there a workaround this?

no, unfortunately. or -- not really.

opencv only accepts / uses ascii here.

you can change the keyboard locale on your box using os methods, but it cannot be done programatically from opencv.

edit flag offensive delete link more

Comments

I don't want to change the keyboard layout programmatically from OpenCV. I just want for waitKey() not to crash when I press a key and the keyboard is in Cyrillic layout. I cannot confirm that the same happens if the keyboard is in German, French, etc layouts, but for me I have two: the default US (Latin) layout and Bulgarian (Cyrillic) layout. When keyboard is in the latter the waitKey() crashes upon input.

nikola gravatar imagenikola ( 2018-10-17 02:37:29 -0600 )edit

it's a known problem. the qt window used has no support for some cyrillic languages.

berak gravatar imageberak ( 2018-10-17 02:41:43 -0600 )edit

Well, thank you! And this known problem has no known solution?

nikola gravatar imagenikola ( 2018-10-17 02:49:04 -0600 )edit

you could try to rebuild it with gtk instead of qt. else you have to switch the kb locale for running opencv programs

berak gravatar imageberak ( 2018-10-17 02:51:27 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-10-16 14:57:13 -0600

Seen: 471 times

Last updated: Oct 17 '18