0

I need to create a GUI (create a Button to select an image from directory or list the image from a particular directory and select one image for conversion)with python cv2.Because i can't install pyqt or tkinter like modules. I have cv2 , numpy and other basic modules.How can i do this without installing any other modules ? (my device have space limitation ).

Aju S
  • 31
  • 1
  • 6

1 Answers1

0

It looks like you can pass key inputs to opencv but not easily, as well as log slider events with generic functions. It doesn't look like there is a native file interface even in the latest version (https://docs.opencv.org/3.4.1/d7/dfc/group__highgui.html)

What about creating a command line GUI? You can use autocomplete in raw input as in this question and then pass the input to imread and then imshow the file.

Ed Smith
  • 10,665
  • 2
  • 36
  • 51
  • Actually i'm trying to create an application so i need gui (the application need a key and if i press the key then it open a directory which contain images ,after selecting the image just press another key 'ok' and the image will display and the converted rgb values where shown in background.So i didn't need terminal gui.Is it possible with cv2 module alone in python ? – Aju S Nov 06 '18 at 12:06
  • Is it possible to create this application with an image of a switch ? – Aju S Nov 06 '18 at 12:38
  • I posted an answer then deleted as it involved tkinter. If you can use it, I'll repost the sample program that showed integrating OpenCV with a GUI. – Mike from PSG Nov 06 '18 at 17:29
  • I'm no expert in OpenCV but it looks like there is no native solution to select files in the OpenCV High-level GUI. If you could use tkinter, the solution is simple (see https://stackoverflow.com/questions/9319317/quick-and-easy-file-dialog-in-python?noredirect=1&lq=1) or use MikeyB's solution. – Ed Smith Nov 06 '18 at 17:34