jhdewitt / sltk

An OpenCV-based structured light processing toolkit.
MIT License
251 stars 63 forks source link

slcapture.py from terminal #6

Closed prahjister closed 6 years ago

prahjister commented 6 years ago

When i run from a terminal I get

prahjister@amlogic:~/sltk-master$ python slcapture.py Traceback (most recent call last): File "slcapture.py", line 16, in from OSC import OSCServer, OSCClient, OSCMessage, OSCStreamingClient ImportError: No module named OSC

prahjister commented 6 years ago

One interesting thing is if i run from gui as i attempt to close the file i get some files generated each time i press the x to close

np,urlib,sys,cv2.os,time,optparse

They have a header with color info then a bunch of codes at

jhdewitt commented 6 years ago

Got so focused on C++ dependencies, python deps totally slipped my mind.

slcapture.py has two only external dependencies: opencv (you have, i think) and pyOSC https://github.com/ptone/pyosc

I have updated the Compilation Guide with details on how to install pyOSC https://github.com/jhdewitt/sltk/wiki/Software-Setup-Guide

Next up, python dependency for slcapture.py:

  1. git clone https://github.com/ptone/pyosc

  2. cd pyosc

  3. sudo ./setup.py install

jhdewitt commented 6 years ago

One interesting thing is if i run from gui as i attempt to close the file i get some files generated each time i press the x to close np,urlib,sys,cv2.os,time,optparse They have a header with color info then a bunch of codes at

Now this one, has me stumped! More details needed.

prahjister commented 6 years ago

after install pyosc

prahjister@amlogic:~/sltk-master$ python slcapture.py Traceback (most recent call last): File "slcapture.py", line 827, in client_display.connect( (display_server_addr, display_server_port) ) NameError: name 'display_server_addr' is not defined

prahjister commented 6 years ago

What version of python should i be running slcapture.py?

jhdewitt commented 6 years ago

Python 2

I'm running it on 2.7.14

prahjister commented 6 years ago

I threw in an ip address and port...(not exactly sure which one) and it seems to be working

image

prahjister commented 6 years ago

once those r defined looks like this one is good

jhdewitt commented 6 years ago

yay !! small steps

slcapture continuously streams the images from mjpg-streamer and discards all images except for the ones "known" to have been taken just after sldisp reports the pattern was shown during a capture sequence

slcapture asks sldisp for pattern X. some time passes, and then sldisp has generated the pattern and VSYNC it out to display device, after which it sends back a packet to slcapture saying "pattern X is live as of time T". some time passes, and slcapture then saves the first image it gets with a timestamp after time T.

The program naively trusts timestamps, so if slcapture and sldisp are run on two computers with system clock offsets, it will act poorly and potentially be waiting many seconds before saving an image after a pattern has been shown.

prahjister commented 6 years ago

Ok great that is why no captures yet. And I think beneficial to run slcapture and sldisp on the same box