Homework Writing Robot With Python ( Python Program That Writes Assignment / Homework in Your Handwriting)

by Python EveryDay in Circuits > Robots

2740 Views, 15 Favorites, 0 Comments

Homework Writing Robot With Python ( Python Program That Writes Assignment / Homework in Your Handwriting)

Robot Writes Assignments / Homework in Your Handwriting | Python Code | School & College Students
writing on page with pen.jpg

A students life is full of assignments and homework. Every student gets assignment from their school and colleges, that they have to submit on time. These assignments don't add any productive value to student. Student does not learn anything by writing assignments. They just copies it from their friend's.

By doing so they are wasting their valuable time, that they can spend to do some innovative thing. They can learn something new and productive in that time rather than copying.

So, I decided to to make a Computer Program that will help them writing assignments faster. I made a program which will write assignments for the student in his/her own handwriting. They just need to paste the question and answer in a text file. And, after running the code, the assignment image will be generated. This image will have the assignment content in student's handwriting. This image can be easily shared and submitted.

Student will be able to complete one page of assignment in less than a minute.

Supplies

  • Computer
  • Camera / Mobile phone with Camera
  • Python Interpreter
  • Software/Application to Align Images straight and Adjust background color
  • Software/Application to Crop Images

Collecting Your Handwriting Images

raw_img 1.jpg
raw_img 2.jpg

You need to write all the alphabets, numbers and symbols.

  • Take a blank page.
  • Write all upper case alphabets (Capital letters) i.e. A-Z.
  • Write all lower case alphabets (Small letters) i.e. a-z.
  • Write all digits (numbers) i.e. 0-9.
  • Write all the possible special characters like " ' , . ? ! = + - * etc.

Processing Handwriting Images

img 2.jpg
img 3.jpg

Use any document scanner or editor to :

  • Align the page straight.
  • Make background white and homogeneous.

Cropping Individual Characters

cropped images.JPG
a.png
ac.png
b.png
bc.png
dot.png
question.png
0.png
1.png
2.png

Now you have crop each character.

So, select any image size (dimensions height x width) and keep it fix for entire duration. I used 60x40 image size.

Adjust the cropping window such that, the character should be at exactly center of the cropped image.

Save these all images in a separate folder. The will be accessed in the code with the path to folder.

Name the cropped images as per the character they contain. For example :- image for 'a' can be named as a.png whereas image for 'A' can be named as 'a_capital' or 'a_c', so it will be easy to access them in code.

Adding Content in a TEXT File

text file image.JPG

The content that needs to be written must be pasted in a text file. This content will be as it is converted to your handwriting. So, go through the file and correct all spelling mistakes and punctuation errors.

The path to this text file will be used in the code.

Open Python IDLE/IDE

libraries.JPG

Import the following libraries.

import cv2
import textwrap
import os

We will be using only these three libraries. Of which os comes preinstalled with python.

Opening File

file open.JPG

use open function to open the text file

f=open("text.txt") #text is the name of file, you should replace it with yours

Read Image

read image.JPG
image=cv2.imread("a.png") 

Use the following code to read or open the image. Here i used "a.png" image which was in the same folder, you can provide path to the image you want.

Concatenate Horizontally

hconcat.JPG
imgh =cv2.hconcat([img1.imp2])

hconcat joins two or more images horizontally i.e. side by side. The images to be concatenated need to be passed in the form of list. Concatenated image is generated and stored in variable imgh.

Concatenate Vertically

vconcat.JPG
imgv=cv2.vconcat([img1.img2])

vconcat joins two or more images vertically i.e. one above another . The images to be concatenated need to be passed in the form of list. Concatenated image is generated and stored in variable imgv.

Display Image

imshow.JPG
cv2.imshow("Image name", img)

imshow - shows or displays the image 'img' with the name 'Image name' in the output.

Storing the Final Result Image

imwrite.JPG
cv2.imwrite("path\output.png",img)

imwrite - stores the image 'img' with the name provided at the the provided path.

Input

text file image.JPG

This was the provided input to the code.

The content that need to be generated as assignment is pasted in the text file. Now onwards you don't need to waste time in writing useless assignments. Just copy it from somewhere, paste here in text file. And your homework will be done by this program,

Provide path to this text file in code.

All this text need to be converted into the handwriting of student.

Output

output java.png
Homework Doing Robot #Shorts

This is the output we got.

The text is converted to handwriting without touching pen and paper. It is like magic.

The computer wrote homework/ assignment for us in out handwriting. It is like homework writing robot. That converts text to my handwriting without my intervention. That to within seconds. Copy your friends assignment without touching pen and paper.

No need of pen and paper. All writing work is done by computer. Automatic Writing Machine. This is a homework doing robot., made in python language. We used python code to do all of this.

Python code to write assignments. Python automates homework assignment. this is an Auto writing software which can write any thing. you just need to paste the text in the text file. it will automatically generate assignment for you. Robot writes assignment and robot do the homework. Robot copies my handwriting.

Complete assignment automatically. complete assignment without writing actually. someone writes homework for you. do homework without touching pen and paper. homework doing machine or writing machine. best for engineering students to write assignments. this is an Auto Assignment Writer for you. Best for essay competition 2021. Computer robot program generates and replicates handwriting. Do my homework robot. This robot will do homework for you.

For more details watch video :Explanation with code

Python Everyday!!!