Beispiel #1
0
    def GET(self):
        user_data = web.input()

        if web.last_upload:
            web.slides.append(web.last_upload)

        print 'Rectifying'
        rectified_slides = []
        for (linear_shapes, ellipses) in web.slides:
            img, rectified = \
                process.prepare_rectified(None, linear_shapes, ellipses)
            rectified_slides.append(rectified)

        print 'Generating PDFs'
        tikz.build_pdf(rectified_slides)

        print 'Sending to email address ', user_data.email
        email_pdf.send_pdf(user_data.email)

        # print 'Clearing'
        web.slides = []
        web.last_upload = None

        return 'Emailed!'
Beispiel #2
0
    return rectified

    # import tikz
    # tikz.build_pdf([rectified])

if __name__ == '__main__':
    slides = []
    import os, tikz

    for filename in os.listdir('./input-images/uploaded/'):
        if '.jpg' in filename:
            print filename
            slides.append(test_img(os.path.join('.', 'input-images', 'uploaded', filename)))

    tikz.build_pdf(slides)

    # test_img('input-images/training/square.jpg')
    # test_img('input-images/slides/slide1.jpg')
    # test_img('input-images/slides/slide2.jpg')
    # test_img('input-images/slides/slide3.jpg')
    # test_img('input-images/slides/slide4.jpg')
    # test_img('input-images/slides/slide5.jpg')
    # test_img('input-images/slides/slide6.jpg')
    # test_img('input-images/slides/slide7.jpg')
    # test_img('input-images/slides/slide8.jpg')
    # test_img('input-images/slides/slide9.jpg')
    # test_img('input-images/slides/slide10.jpg')
    # test_img('input-images/slides/slide11.jpg')
    # test_img('input-images/slides/slide12.jpg') # Need help on thresholding
    # test_img('input-images/slides/slide13.jpg')