We have a problem in the world right now. The old outdated technology of printed reciepts. We get reciepts all of the time from shopping at the store, to gas station, to restraunt. What do you ussually do with it, throw it away. This can cause problems with returns and business operation. Everyone working at a restraunts always works with reciepts. Some problems that arrive, is that you might miss type the tip or price into the system, and you eventually get fined. Another problem, A lot of small businesses like constrction use reciepts all the time by the laborers to track the operation expense. Working in construction for 4 years, I always lost reciepts. Then I checked how they store the reciepts, and its terrible. Glued reciepts in multiple binders that only the person that has done it knows where they go. This problem could relativly easily solved by taking a picture and using an ML app to take down all of the info from the reciept and add the data to a database with a picture and generated text and numbers from the reciept.
import os
import pandas as pd
from PIL import Image
# Create an empty list to store image information
image_list = []
# Define the path to the folder containing the images
folder_path = './images'
# Loop through all the files in the folder
for filename in os.listdir(folder_path):
if filename.endswith('.jpg') or filename.endswith('.png'): # You can specify the file extensions you want to include
# Open the image using PIL library and get the image size
with Image.open(os.path.join(folder_path, filename)) as img:
width, height = img.size
# Append the image information to the list
image_list.append({'filename': filename, 'width': width, 'height': height})
# Create a pandas dataframe from the list
df = pd.DataFrame(image_list)
# Print the dataframe
print(df)
filename width height 0 1078-receipt.jpg 750 1000 1 1085-receipt.jpg 631 1000 2 1197-receipt.jpg 338 450 3 1008-receipt.jpg 750 1000 4 1134-receipt.jpg 750 1000 .. ... ... ... 195 1143-receipt.jpg 750 1000 196 1013-receipt.jpg 750 1000 197 1171-receipt.jpg 480 640 198 1063-receipt.jpg 250 250 199 1101-receipt.jpg 750 1000 [200 rows x 3 columns]
# Get the filename of the first image in the folder
filename = os.listdir(folder_path)[0]
# Open the image using PIL library
with Image.open(os.path.join(folder_path, filename)) as img:
# Display the image in Jupyter Notebook
display(img)
Using Keras Tensorflow text vectorization and image classification, It would be possible for the image dataset to be read and tested to possibly get some type of classification of the data the reciept has, after the data is read, it would be added to the a dataframe. After the data has been added, it would be able to be worked with and visualized any way possible.