Difference between revisions of "Convex Mirror"

From Robert-Depot
Jump to: navigation, search
(V2 Background Subtract)
(V2 Background Subtract)
Line 27: Line 27:
 
*produces frame0024.svg
 
*produces frame0024.svg
  
=V2 Background Subtract=
+
=Background Subtract=
 
*subtract one image from background with given threshold and dilations:
 
*subtract one image from background with given threshold and dilations:
 
**<code>python bgsubtract.py square0001.jpg square0002.jpg 66 3</code>
 
**<code>python bgsubtract.py square0001.jpg square0002.jpg 66 3</code>
Line 37: Line 37:
 
**<code>processing-java --sketch=/Users/rtwomey/processing/dm_xml/convexmirror_cmdline --output=tmp/convexmirror --run --force</code>
 
**<code>processing-java --sketch=/Users/rtwomey/processing/dm_xml/convexmirror_cmdline --output=tmp/convexmirror --run --force</code>
 
**NOTE: all filenames in the app need full paths.
 
**NOTE: all filenames in the app need full paths.
 +
*run workflow with processing from commandline:
 +
**<code>python bgprocessing.py ~/Pictures/raspi/frame0031.jpg</code>
  
 
=Error Image + Drawing Image=
 
=Error Image + Drawing Image=

Revision as of 08:13, 2 April 2013

<<< back to Wiki Home

Self Portrait in a Convex Mirror

Workflow

RPi side

  • take photo on raspberry pi:
    • gphoto2 --capture-image-and-download --filename capt0004.jpg
  • send to laptop:
    • cp capt0004.jpg rtwomey@192.168.2.1:~/Pictures/raspi
  • USB reset device:
    • usbreset /dev/bus/usb/001/004

OS X side

  • crop:
    • convert ~/Pictures/raspi/frame0001.jpg -crop 1450x1450+779+275 +repage square0001.jpg
  • bg subtract:
    • python bgsubtract.py square0002.jpg square0008.jpg 20 2
  • edge detect:
    • python edge.py square0001.jpg 20 255
  • convert to pnm:
    • convert square0001_edge.png edge0001.pnm
  • vectorize:
    • potrace edge0001.pnm --tight -i -s -o frame0001.svg
  • send to gcode machine:

Helper script:

  • python process_image.py ~/Pictures/raspi/frame0024.jpg
  • produces frame0024.svg

Background Subtract

  • subtract one image from background with given threshold and dilations:
    • python bgsubtract.py square0001.jpg square0002.jpg 66 3


Processing from commandline

  • install processing-java from tools menu in processing
  • run from command line:
    • processing-java --sketch=/Users/rtwomey/processing/dm_xml/convexmirror_cmdline --output=tmp/convexmirror --run --force
    • NOTE: all filenames in the app need full paths.
  • run workflow with processing from commandline:
    • python bgprocessing.py ~/Pictures/raspi/frame0031.jpg

Error Image + Drawing Image

  • compute new contours from error image. NOT DONE.
  • accumulate error image. NOT DONE.
  • accumulate drawing image. NOT DONE.