make one pdf from the photos, the teacher wants the homework as one file
Homework notebook photos into one PDF
The agent put three phone photos of a notebook into one scan-like PDF: cropped the table out, straightened the pages, turned one upright and shrank the file to 1.2 MB.
- The agent worked
- 2 min
- It cost
- $0.03
- Steps
- 10
- Files
- 3
Homework notebook photos into one PDF
Problembot
Task
A child did Russian homework on three notebook pages, and mom photographed them with her phone on the kitchen table: the pages are at an angle, the table shows around them, one page is shot sideways. The teacher wants the work as one PDF through the school's online diary, and it accepts files up to 2 MB.
What the agent was told
First the three photos and "make one pdf from the photos, the teacher wants the homework as one file". Then: "the last page is sideways. and the table shows everywhere, can it look like a scan?". In the end: "can it be smaller? the online diary won't take it, says up to 2 mb".
How the agent solved it
In the first turn the agent simply put the three photos into a PDF as they were, in 26 seconds. When asked for "like a scan", it looked at small copies of the photos, marked the corners of each page, cut the pages out with the perspective corrected, turned the third page upright and evened out the lighting so the background became flat and light. For this it installed the OpenCV library on its own computer. For the 2 MB limit it scaled the pictures down and tuned the compression until the file fit.
Result
A three-page PDF of 1.2 MB: the notebook pages without the table, straight, all upright and in order, the grid and margins visible, the writing sharp. The agent worked about two and a half minutes, and the dialog cost $0.03.
What did not work
- The first PDF came out as is: with the table behind and the third page sideways. The agent could have straightened the pages at once but did it only when asked.
- The agent found the page corners by eye on small copies, not automatically. It came out accurate, but thin grey slivers of the table are left at the edges of some pages.
- The pages differ in size and are not A4: they will need scaling to print.