Chapter7 code for Raspbian Whizzy ?

56 views
Skip to first unread message

G10DRAS

unread,
Feb 16, 2016, 10:05:59 PM2/16/16
to OpenCV with Python Blueprints
Hello Michael ,

I am trying to run chapter7 GUI on Raspbian Whizzy (I dont have Ubuntu 14.04).
Till now I am able to see camera frames (after some code tweaking) in GUI but no control panels.
I am just tweaking the code to record training data but It seems very difficult to train model this way.
All other code seems working good.
After 4 days of testing I come to a conclusion that I have to re-write GUI code for Raspbian Whizzy.
Seems wxGlade is some what useful tool for this.

Would you recommend any other Python GUI designer ?

Thanks,

Michael Beyeler

unread,
Feb 21, 2016, 4:41:56 PM2/21/16
to OpenCV with Python Blueprints
Hi, I have just applied a fix to the code on GitHub that should resolve the GUI issues. It seems that I needed to bind the EVT_PAINT event to the panel instead of the frame. All the GUIs now run fine at least on Windows 8.1. Please let me know if this resolved the issue on Raspbian, too. Unfortunately, I do not have access to this platform...

I've found wxPython to be quite stable on a number of platforms, iff you use it correctly. :))
There's also Kivy, PyQt, and libavg.

Best,
Michael

G10DRAS

unread,
Feb 21, 2016, 11:53:52 PM2/21/16
to OpenCV with Python Blueprints
I tried latest code on Raspbian Whizzy (ARM7) but result is same i.e. not working.

The following code need to change for Raspbian (ARM7)
        self.bmp = wx.BitmapFromBuffer(self.imgWidth, self.imgHeight, frame)
to                         
        wxImage = wx.ImageFromBuffer(self.imgWidth, self.imgHeight, frame)
       
self.bmp = wx.BitmapFromImage(wxImage)  
After the above change I am able to see a Window with acquire frame (Face detected and a bounding rectangle around my face)

I suspect there is problem with wx.Panel on Raspbian (not 100% sure) and following code never works
self.pnl.Bind(wx.EVT_PAINT, self._on_paint)
i.e. the following function never called.
    def _on_paint(self, event):


I am replacing Panel with wx.BoxSizer, lets see how it will go.



Reply all
Reply to author
Forward
0 new messages