Python Forum
Calculate png volume of Homer - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Calculate png volume of Homer (/thread-11102.html)



Calculate png volume of Homer - Antigr - Jun-22-2018

Hi!
Help me please solve this issue:
i have png image (for example great Homer)
This image is 1280*1024. How many Homer is in picture in %? For example -Homer:35%, Background:65%
i tried used Pillow,cv2 but it was too long calculation.
any suggestions?


RE: Calculate png volume of Homer - nilamo - Jun-22-2018

https://www.pyimagesearch.com/2018/06/18/face-recognition-with-opencv-python-and-deep-learning/

Facial recognition in python is fast enough to work while streaming video, without any noticeable delay. So if it's taking too long to do a static image, you might not be doing it the right way. Show some code, let's see what's going on.


RE: Calculate png volume of Homer - Antigr - Jun-22-2018

(Jun-22-2018, 05:25 PM)nilamo Wrote: https://www.pyimagesearch.com/2018/06/18/face-recognition-with-opencv-python-and-deep-learning/ Facial recognition in python is fast enough to work while streaming video, without any noticeable delay. So if it's taking too long to do a static image, you might not be doing it the right way. Show some code, let's see what's going on.
it was my previous question, i tried to delete all zeroes from image,and calculate it.
Yes machine learning can be fast, but im talking about pictures, they can be very very different. I need to calculate it not approximately, but precisely. It is good task,my suggestion was to delete all zeroes from left and right and remaining numbers to array, but it is too long*, even pathos multi cannot help
*my picture is 125 mb


RE: Calculate png volume of Homer - nilamo - Jun-22-2018

Does it work with a smaller image? What part(s) of it are slow?
What do you need from the image to do the determination? Just the pixel's rgb value, or do you need surrounding pixel data? If each individual pixel is unrelated to the surrounding ones, you can read the image into a queue, and have a process pool work through the queue, so you utilize more than one core of your computer (...or more than one computer).