testGetPlate.py 676 B

1234567891011121314151617181920
  1. from GetPlate import getPlateAt
  2. from pylab import imread, imshow, show, figure
  3. from GrayscaleImage import GrayscaleImage
  4. # Define the coordinates of the licenseplate
  5. x_vals = [310, 382, 382, 310]
  6. y_vals = [383, 381, 396, 398]
  7. # Get the image
  8. image = GrayscaleImage('../images/test_plate.png')
  9. # Let the code get the licenseplate
  10. output_image = getPlateAt(image, x_vals[0], y_vals[0],\
  11. x_vals[1], y_vals[1],\
  12. x_vals[2], y_vals[2],\
  13. x_vals[3], y_vals[3], 100, 20)
  14. # Show the licenseplate
  15. output_image = GrayscaleImage(None, output_image)
  16. output_image.show()