opencv creat an input text box in a GUI and read it

非 Y 不嫁゛ 提交于 2019-12-02 09:23:28

问题


Just wondering if there is any command in OpenCV to create an input "Text box" or"Edit text box" for a GUI in C++? Like name box (to enter a name)

PS: I'm using Linux (Ubuntu)


回答1:


As Miki says, there is no such facility in OpenCV itself, but there is nothing to stop you using Zenity or any of the alternatives, which work like this at the command line:

zenity  --title  "Gimme some text!" --entry --text "Enter your text here"

If it does what you want, you can integrate it into your C++ program by calling it through popen().




回答2:


No.


From the doc:

While OpenCV was designed for use in full-scale applications and can be used within functionally rich UI frameworks (such as Qt*, WinForms*, or Cocoa*) or without any UI at all, sometimes there it is required to try functionality quickly and visualize the results. This is what the HighGUI module has been designed for.

HighGui provides only a limited GUI, mainly for debugging purposes. If you need something more than:

  • showing images
  • detecting mouse clicks
  • using sliders to change some value
  • draw shapes or text
  • use a button (Qt backend only)

then you need to use some GUI library such as Qt*, WinForms*, or Cocoa*.



来源:https://stackoverflow.com/questions/34669719/opencv-creat-an-input-text-box-in-a-gui-and-read-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!