Coder Social home page Coder Social logo

jhdewitt / sltk Goto Github PK

View Code? Open in Web Editor NEW
247.0 20.0 63.0 49.16 MB

An OpenCV-based structured light processing toolkit.

License: MIT License

C++ 72.87% Makefile 0.91% Python 11.48% C 8.55% Processing 6.19%
structured-light-for-3d-scanning structured-light 3d-scanner camera projector opencv computer-vision gray-code triangulation camera-calibration

sltk's Issues

Hey

Howdy. Getting this when i go to test slcapture.py.....think it may be due to your refactoring.

Traceback (most recent call last):
  File "slcapture.py", line 19, in <module>
    from OSC import OSCServer, OSCClient, OSCMessage, OSCStreamingClient, OSCClientError
ImportError: No module named OSC

FAILED TO FIND CHESSBOARD, exiting..

Hi,
Not sure if the project is still active or not, but I did get it to compile on Arch Linux and am projecting/generating/capturing image files. I cannot seem to get the calibration done though. Never seems to find the chessboard. I had to comment out the exif data collection part of slcrunch because it would seg fault. I should be calibrating using slcrunch, right?
Any assistance would be appreciated.
Thanks

Is this supposed to show a date?

('1522413892.250540', '1522378145.697283 late', 'frame# 0743', '......', 'dT: 0.03377 (29.6fps)', 'ts.show_dt = 0.000000, ts.show_dtavg = 0.000000\\n')
('1522413892.285613', '1522378145.698957 late', 'frame# 0744', '......', 'dT: 0.03340 (29.9fps)', 'ts.show_dt = 0.000000, ts.show_dtavg = 0.000000\\n')
('1522413892.320582', '1522378145.700393 late', 'frame# 0745', '......', 'dT: 0.03353 (29.8fps)', 'ts.show_dt = 0.000000, ts.show_dtavg = 0.000000\\n')
('1522413892.355609', '1522378145.701665 late', 'frame# 0746', '......', 'dT: 0.03375 (29.6fps)', 'ts.show_dt = 0.000000, ts.show_dtavg = 0.000000\\n')
('1522413892.395481', '1522378145.708071 late', 'frame# 0747', '......', 'dT: 0.03347 (29.9fps)', 'ts.show_dt = 0.000000, ts.show_dtavg = 0.000000\\n')
('1522413892.432098', '1522378145.711195 late', 'frame# 0748', '......', 'dT: 0.03349 (29.9fps)', 'ts.show_dt = 0.000000, ts.show_dtavg = 0.000000\\n')
('1522413892.466803', '1522378145.712304 late', 'frame# 0749', '......', 'dT: 0.03360 (29.8fps)', 'ts.show_dt = 0.000000, ts.show_dtavg = 0.000000\\n')
('1522413892.501728', '1522378145.713616 late', 'frame# 0750', '......', 'dT: 0.03361 (29.8fps)', 'ts.show_dt = 0.000000, ts.show_dtavg = 0.000000\\n')

slcapture.py from terminal

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

slcrunch

How do i use slcrunch. I am trying to calibrate webcam. I grabbed 5 scans and varried monitor position.

prahjister@amlogic:~/sltk-master/~/completed_scans/Calib4.23.18/scan_0000$ slcrunch sequence.yaml
PREFIX FOR OUTPUT : [sequence.yaml]
outMapPath      sequence.yaml.yaml
outVisCPath     sequence.yaml_rgb.png
outVisXPath     sequence.yaml_x.png
outVisYPath     sequence.yaml_y.png
outVisDirPath   sequence.yaml_direct.png
outVisAmbPath   sequence.yaml_indirect.png
outVisChessCamPath      sequence.yaml_chesscam.png
outVisChessProPath      sequence.yaml_chesspro.png
outPlyPath      sequence.yaml_cloud.ply
checking image list: sequence.yaml
        prefix : []
        fname  : [sequence.yaml]
parsing [sequence.yaml]
[1524532734.170169_gcb_00_09_0-00_img.jpg]
[1524532734.906104_gcb_00_09_1-01_img.jpg]
[1524532735.573819_gcb_00_08_0-02_img.jpg]
[1524532736.238951_gcb_00_08_1-03_img.jpg]
[1524532737.006515_gcb_00_07_0-04_img.jpg]
[1524532737.774084_gcb_00_07_1-05_img.jpg]
[1524532738.542061_gcb_00_06_0-06_img.jpg]
[1524532739.306771_gcb_00_06_1-07_img.jpg]
[1524532740.042508_gcb_00_05_0-08_img.jpg]
[1524532740.810280_gcb_00_05_1-09_img.jpg]
[1524532741.478750_gcb_00_04_0-10_img.jpg]
[1524532742.178773_gcb_00_04_1-11_img.jpg]
[1524532742.918053_gcb_00_03_0-12_img.jpg]
[1524532743.618185_gcb_00_03_1-13_img.jpg]
[1524532744.386239_gcb_00_02_0-14_img.jpg]
[1524532745.118648_gcb_00_02_1-15_img.jpg]
[1524532745.782736_gcb_00_01_0-16_img.jpg]
[1524532746.450331_gcb_00_01_1-17_img.jpg]
[1524532747.114433_gcb_00_00_0-18_img.jpg]
[1524532747.814483_gcb_00_00_1-19_img.jpg]
[1524532748.606311_gcb_01_09_0-20_img.jpg]
[1524532749.338774_gcb_01_09_1-21_img.jpg]
[1524532750.106476_gcb_01_08_0-22_img.jpg]
[1524532750.874104_gcb_01_08_1-23_img.jpg]
[1524532751.638974_gcb_01_07_0-24_img.jpg]
[1524532752.406525_gcb_01_07_1-25_img.jpg]
[1524532753.139006_gcb_01_06_0-26_img.jpg]
[1524532753.806575_gcb_01_06_1-27_img.jpg]
[1524532754.474524_gcb_01_05_0-28_img.jpg]
[1524532755.174436_gcb_01_05_1-29_img.jpg]
[1524532755.942744_gcb_01_04_0-30_img.jpg]
[1524532756.675200_gcb_01_04_1-31_img.jpg]
[1524532757.346674_gcb_01_03_0-32_img.jpg]
[1524532758.014303_gcb_01_03_1-33_img.jpg]
[1524532758.683011_gcb_01_02_0-34_img.jpg]
[1524532759.450685_gcb_01_02_1-35_img.jpg]
[1524532760.218221_gcb_01_01_0-36_img.jpg]
[1524532760.982961_gcb_01_01_1-37_img.jpg]
[1524532761.747107_gcb_01_00_0-38_img.jpg]
[1524532762.514525_gcb_01_00_1-39_img.jpg]
[1524532763.202705_rgb_255_255_255_0-00_img.jpg]
[1524532763.971107_rgb_192_192_192_0-01_img.jpg]
[1524532764.738541_rgb_128_128_128_0-02_img.jpg]
[1524532765.506359_rgb_092_092_092_0-03_img.jpg]
[1524532766.271232_rgb_064_064_064_0-04_img.jpg]
[1524532767.039245_rgb_032_032_032_0-05_img.jpg]
[1524532767.807251_rgb_128_000_000_0-06_img.jpg]
[1524532768.542310_rgb_000_128_000_0-07_img.jpg]
[1524532769.239421_rgb_000_000_128_0-08_img.jpg]
gcb images : 40, rgb images: 9
Using image list: sequence.yaml
loading exif data..
Segmentation fault

Hey

I know this is a lot of work. Do you think that I should ask for some help? I feel like we are so close.

Export to 3D format

Hi,

this looks like a great project. Are there any plans to export the point cloud to other 3D formats? Obj for Example?

make error

Hey I am trying to compile on my S905X box and I get this error

g++ -c -o hid.o hid_LINUX.c
hid_LINUX.c: In function ‘int rawhid_recv(int, void*, int, int)’:
hid_LINUX.c:123:64: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
r = usb_interrupt_read(hid->usb, hid->ep_in, buf, len, timeout);
^
In file included from hid_LINUX.c:34:0:
/usr/include/usb.h:310:5: note: initializing argument 3 of ‘int usb_interrupt_read(usb_dev_handle*, int, char*, int, int)’
int usb_interrupt_read(usb_dev_handle dev, int ep, char bytes, int size,
^
hid_LINUX.c: In function ‘int rawhid_send(int, void
, int, int)’:
hid_LINUX.c:145:70: error: invalid conversion from ‘void
’ to ‘const char*’ [-fpermissive]
return usb_interrupt_write(hid->usb, hid->ep_out, buf, len, timeout);
^
In file included from hid_LINUX.c:34:0:
/usr/include/usb.h:308:5: note: initializing argument 3 of ‘int usb_interrupt_write(usb_dev_handle*, int, const char*, int, int)’
int usb_interrupt_write(usb_dev_handle dev, int ep, const char bytes, int size,
^
hid_LINUX.c:147:77: error: invalid conversion from ‘void
’ to ‘char
’ [-fpermissive]
return usb_control_msg(hid->usb, 0x21, 9, 0, hid->iface, buf, len, timeout);
^
In file included from hid_LINUX.c:34:0:
/usr/include/usb.h:312:5: note: initializing argument 6 of ‘int usb_control_msg(usb_dev_handle*, int, int, int, int, char*, int, int)’
int usb_control_msg(usb_dev_handle *dev, int requesttype, int request,
^
Makefile:94: recipe for target 'hid.o' failed
make: *** [hid.o] Error 1

camera lens intrinsics

I am guessing that i need to find camera lens intrinsics first

I am trying to follow process

All compiled apps are running on the arm box
I first started mjpg-streamer and i verified it is running by browser on my windows box http://10.0.0.201:8080/?action=stream
I start sldisp and my screen starts to flash on arm box
I alt tab out and run slcapture.py and it takes control of my mouse and i have a plus on my cursor. I cannot do anything except move the mouse at this time with my mouse and a blank terminal window is opened and is blank. This is also on my arm box
I alt tab out to sldisp and screen is flashing

In the slcapture.py
final_destination = "~/completed_scans"

cam_server_addr = "127.0.0.1"
cam_server_port = 4011 port 8080?????

turn_server_addr = "127.0.0.1""
turn_server_port = 4013

GUI_server_addr = "10.0.0.17" windows box ip address??????
GUI_server_port = 12000

control_server_addr = "127.0.0.1" not sure what ip address this is
control_server_port = 3210

I run slcontrol on my windows box with required libraries and press scan and get nothing

I assume that all these IP address are the arm box

remoteControl = new NetAddress("10.0.0.201", 4010);
remoteDisplay = new NetAddress("10.0.0.201", 4021);
//remoteTurntable = new NetAddress("10.0.0.201", 4013);

Missing hid_$(OS).c files

Attempting to make on Linux, having set OS= LINUX, results in:

make: *** No rule to make target 'hid_LINUX.c', needed by 'hid.o'. Stop.

I don't believe this file, or hid.h is provided by the listed prerequisites or system.

Just an update 3.29.18

All the bin files are at least running chessfind chessgen listcreator plotlens slcalibrate slcrunch

I am missing sldisp right now it is the only thing not compiling. :)

slcontrol doesn't seem to be doing anything. After I press start capture nothing happens...unless it is requiring a response from sldisp which is currently not running due to not compiling currently

Coming along nicely

Box

Do you want me to ship you one of these boxes to develop on?

slcontrol

I get these errors hovering over turn less turn more less scan and more scan

java.lang.NoSuchMethodError: processing.core.PVector.set(FFF)V
at controlP5.Tooltip.activate(Unknown Source)
at controlP5.Controller.setMouseOver(Unknown Source)
at controlP5.Controller.updateEvents(Unknown Source)
at controlP5.ControllerGroup.updateEvents(Unknown Source)
at controlP5.ControlWindow.updateEvents(Unknown Source)
at controlP5.ControlWindow.draw(Unknown Source)
at controlP5.ControlWindow.draw(Unknown Source)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1408)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1401)
at processing.core.PApplet.handleMethods(PApplet.java:1600)
at processing.core.PApplet.handleDraw(PApplet.java:2439)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1557)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)

Hey

How is it going. Seeing if there are any updates to this project

plotlens : segmentation fault.

Hi,

This is my first active participation to a git project ( 3d scanner is really cool) . I started to compile your project, two days ago and things are going well now. All my modules talk together, and now I'm trying to get my first camera calibration... but I got into problems with plotlens... I got a segmentation fault...

Problem: the problem rises into the last loop to plot the grid image...
pixb seems to be update to the first pixel of each row... so calculated index from this equation :
int idx = 3(r*w+c);* will produce an overflow... I think you need to just calculate the offset of the current column with 3*C see corrected code below. What do you think of this... Maybe I don<t understand your code... but I'm pretty sure of this correction.

Prelard812.

`// generate grid image distorted with lens (simulated image of grid)
if( gen_grid )
{

    int w = grid_img.cols;
    int h = grid_img.rows;
    for(int r=0; r<h; r++)
    {
         uchar* pixb = grid_img.ptr<unsigned char>(r);
         for(int c=0; c<w; c++)
         {
            //int idx = 3*(r*w+c);
            **int idx = 3*(c);**
            unsigned char v = 255;
            pixb[idx+0] = v;
            pixb[idx+1] = v;
            pixb[idx+2] = v;
         }
    }

}`

Turn Table

Do you want me to work on the turntable...if so what hardware do you have?

update 4.5.18

FYI i re imaged my box and started over sltk compiles perfectly.

I tried both mjpg streamers and doesnt compile

Yours has this error....Getting closer

In file included from /home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/input_uvc.c:44:0:
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/input_uvc.c: In function ‘input_init’:
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/../../utils.h:74:17: error: ‘context_settings {aka struct <anonymous>}’ has no member named ‘timestamp_auto’
         settings->v##_auto = 1; \
                 ^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/input_uvc.c:367:9: note: in expansion of macro ‘OPTION_INT_AUTO’
         OPTION_INT_AUTO(39, timestamp)
         ^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/../../utils.h:75:46: error: ‘context_settings {aka struct <anonymous>}’ has no member named ‘timestamp’
     } else if (sscanf(optarg, "%d", &settings->v) != 1) { \
                                              ^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/input_uvc.c:367:9: note: in expansion of macro ‘OPTION_INT_AUTO’
         OPTION_INT_AUTO(39, timestamp)
         ^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/../../utils.h:79:13: error: ‘context_settings {aka struct <anonymous>}’ has no member named ‘timestamp_set’
     settings->v##_set = 1;
             ^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/input_uvc.c:367:9: note: in expansion of macro ‘OPTION_INT_AUTO’
         OPTION_INT_AUTO(39, timestamp)
         ^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/input_uvc.c: In function ‘help’:
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/input_uvc.c:540:66: warning: backslash and newline separated by space
     " [-timestamp ]..........: Set timestamp value to populate\n"\
                                                                  ^
plugins/input_uvc/CMakeFiles/input_uvc.dir/build.make:86: recipe for target 'plugins/input_uvc/CMakeFiles/input_uvc.dir/input_uvc.c.o' failed
make[3]: *** [plugins/input_uvc/CMakeFiles/input_uvc.dir/input_uvc.c.o] Error 1
make[3]: Leaving directory '/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/_build'
CMakeFiles/Makefile2:286: recipe for target 'plugins/input_uvc/CMakeFiles/input_uvc.dir/all' failed
make[2]: *** [plugins/input_uvc/CMakeFiles/input_uvc.dir/all] Error 2
make[2]: Leaving directory '/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/_build'
Makefile:127: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/_build'
Makefile:17: recipe for target 'all' failed
make: *** [all] Error 2
prahjister@amlogic:~/mjpg-streamer/mjpg-streamer-experimental$

Estimating ref normals... Segmentation fault (core dumped)

Whe I run "./plyAlign bun000.ply bun045.ply bun090.ply"
output:

argv[1] : bun000.ply
argv[2] : bun045.ply
argv[3] : bun090.ply
loaded [bun000.ply].. 204800 points
loaded [bun045.ply].. 204800 points
loaded [bun090.ply].. 204800 points
scene : 204800
object : 204800

Estimating ref normals...
Segmentation fault (core dumped)

What is problem I cant understand

Windows Binaries?

A long shot but looking for an alternative to David3d that works for my use case (manual dslr triggering), was wondering if you could provide a way to compile on windows or even better a windows binary. all the projects that I have found so far I cant compile for one reason or another so I'm hoping the most flexible of the projects (sltk) could fill the gap.

Hard coded server display address?

Do i need to hard code this address? What address is this?

#define SERVER_DISPLAY_ADDRESS "0.0.0.0"
#define SERVER_DISPLAY_PORT "3210" //4001 // from client for displaying patterns
#define CLIENT_DISPLAY_PORT "4011" // to client

#define SERVER_CAMERA_PORT "4002" // from client for image capture
#define CLIENT_CAMERA_PORT "4012"

#define CLIENT_SERIAL_PORT "4013"
#define SERVER_SERIAL_PORT "4003" // from client for stepper motor control

Hey

Hey,

Just following up to see how it is going. FYI I used xming to remotely start the app on the arm box.

Looks like an awesome project

Can you contact me via Skype @ prahjister. I have some questions and would like to write an article about your tools and make a how to on this project.

Errors may occur in line 484-487 of plyalign.cpp

The code in line 484-487 of plyalign.cpp are listed in the following:
PointCloudT::Ptr ref (new PointCloudT);
ref->reserve(clouds[i]->points.size());
PointCloudT::Ptr dat (new PointCloudT);
dat->reserve(clouds[i-1]->points.size());
However, I think "ref" and "dat" should exchange positions. Am I right?Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.