You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
852 B

  1. from os import walk
  2. import detectObject as do
  3. import matplotlib.pyplot as plt
  4. #image_data = do.imgFileToData("imgs/34.png")
  5. image_data = do.imgFileToData2("object/25.png")
  6. boundingBox = do.detectObj(image_data)
  7. image_data = do.prova(image_data)
  8. r = do.crop(image_data, boundingBox)
  9. import detectObjects as dos
  10. r_copy = r
  11. dos.detectObjects(r_copy)
  12. #do.saveDataToImageFile(image_data, "out.png")
  13. #r = do.prova(image_data)
  14. fig = plt.figure()
  15. ax = fig.add_subplot(121)
  16. ax.set_title("Original")
  17. ax.imshow(image_data)
  18. ax1 = fig.add_subplot(122)
  19. ax1.set_title("Result")
  20. ax1.imshow(r)
  21. plt.show()
  22. '''
  23. f = []
  24. for (dirpath, dirnames, filenames) in walk("imgs"):
  25. for filename in filenames:
  26. print filename
  27. image_data = do.imgFileToData("imgs/" + filename)
  28. boundingBox = do.detectObj(image_data)
  29. print boundingBox
  30. '''