Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Frank Ononye
Published © GPL3+

Rock, Paper, Scissors with the Maaxboard RT

This project is a demo on how to deploy a vision project on the Maaxboard RT from Edge Impulse through MCUXpresso.

IntermediateFull instructions provided2 hours287
Rock, Paper, Scissors with the Maaxboard RT

Things used in this project

Hardware components

MaaXBoard RT
Avnet MaaXBoard RT
×1
NXP MCU Link
×1
Avnet 5V/3A USB Type-C Power Supply
×1
MaaXBoard MIPI DSI Cap Touch 7-inch Display
Avnet MaaXBoard MIPI DSI Cap Touch 7-inch Display
×1
Avnet MaaXBoard Camera Module
×1

Software apps and online services

Edge Impulse Studio
Edge Impulse Studio
TensorFlow
TensorFlow
NXP MCUXpresso

Story

Read more

Code

rotateimage.py

Python
from PIL import Image
import glob

image_list = []

rotated_image = []
rotated_image2 = []
rotated_image3 = []
mirror_image = []

rotated_mirror_image = []
rotated_mirror_image2 = []
rotated_mirror_image3 = []


rotate = 180
rotate2 = 90
rotate3 = 270

for filename in glob.glob('/home/frank/embeddedcv-export/training/*.jpg'):
    print(filename)
    img = Image.open(filename)
    image_list.append((img,filename))

for image,filename in image_list:
    image = image.rotate(rotate, expand=True)
    image2 = image.rotate(rotate2, expand=True)
    image3 = image.rotate(rotate3, expand=True)
    image4 = image.transpose(Image.FLIP_LEFT_RIGHT)

    image5 = image4.rotate(rotate, expand=True)
    image6 = image4.rotate(rotate2, expand=True)
    image7 = image4.rotate(rotate3, expand=True)


    rotated_image.append((image,filename))
    rotated_image2.append((image2,filename))
    rotated_image3.append((image3,filename))
    mirror_image.append((image4,filename))

    rotated_mirror_image.append((image5,filename))
    rotated_mirror_image2.append((image6,filename))
    rotated_mirror_image3.append((image7,filename))


for (new,filename) in rotated_image:
    new.save('{}'.format(filename+'.rotated.jpg'))

for (new,filename) in rotated_image2:
    new.save('{}'.format(filename+'.rotated2.jpg'))

for (new,filename) in rotated_image3:
    new.save('{}'.format(filename+'.rotated3.jpg'))

for (new,filename) in mirror_image:
    new.save('{}'.format(filename+'.mirror.jpg'))

for (new,filename) in rotated_mirror_image:
    new.save('{}'.format(filename+'.rm.jpg'))

for (new,filename) in rotated_mirror_image2:
    new.save('{}'.format(filename+'.rm2.jpg'))

for (new,filename) in rotated_mirror_image3:
    new.save('{}'.format(filename+'.rm3.jpg'))

Credits

Frank Ononye
4 projects • 11 followers
Contact

Comments

Please log in or sign up to comment.