Discussion:
[Maya-Python] Simple image comparing program using pyside
Hyuk Ko
2018-08-10 06:08:17 UTC
Permalink
Hello!

I am trying to make a simple image comparing program in maya

something like this...

I looks like a really easy job by using OpenCV and numpy

Tried to install these packages in maya, and failed HARD... (first time
installing outer packages to maya... not easy as it sounds)

Is it possible to make a similar program by using pyside?

Thanks in advance!
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/32958bc8-30cb-4afd-b93b-55e1e849a870%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcus Ottosson
2018-08-10 06:12:15 UTC
Permalink
You can install OpenCV and NumPy into Maya, but it can't be the packages
distributed via their standard installers or `pip` as they need to have
been compiled especially for your version of Maya, such as 2018.

Do a Google for pre-compiled versions for your platform and version of
Maya, I've seen those around.
Post by Hyuk Ko
Hello!
I am trying to make a simple image comparing program in maya
http://youtu.be/LNzC4NYYWdg something like this...
I looks like a really easy job by using OpenCV and numpy
Tried to install these packages in maya, and failed HARD... (first time
installing outer packages to maya... not easy as it sounds)
Is it possible to make a similar program by using pyside?
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/32958bc8-30cb-4afd-b93b-55e1e849a870%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/32958bc8-30cb-4afd-b93b-55e1e849a870%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAHGhHww7gBNqiCxnCkiWJT8fkfBfeN7uhgJw7eqo%2BzzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Justin Israel
2018-08-10 07:37:35 UTC
Permalink
It doesn't look like that demo is using OpenCV for more than just reading
and decoding images into byte arrays. And then a difference between the
byte arrays is used to determine if the images are the same. Seems you
could probably do the same thing with PySide using QImage

http://doc.qt.io/qt-5/qimage.html#operator-not-eq

It defines a similar subtraction operator that says it first checks cast
stuff like width/height and then would do a data comparison.

Im sure OpenCV *could* be used to do more advanced stuff like checking if
the images are different within certain thresholds to allow for stuff like
noise. Or evaluating if the images are generally of the same subject. And
also, you would probably get a wider support of file formats with OpenCV.

If you don't want to have to compile OpenCV and numpy, and your goal is
purely to check the difference, then there is always the option to shell
out from your script to something like idiff (provided by OpenImageIO) or
whatever other diff tools exist.

Justin
Post by Hyuk Ko
Hello!
I am trying to make a simple image comparing program in maya
http://youtu.be/LNzC4NYYWdg something like this...
I looks like a really easy job by using OpenCV and numpy
Tried to install these packages in maya, and failed HARD... (first time
installing outer packages to maya... not easy as it sounds)
Is it possible to make a similar program by using pyside?
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/32958bc8-30cb-4afd-b93b-55e1e849a870%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/32958bc8-30cb-4afd-b93b-55e1e849a870%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1zRos54y_6%3DQYecz%3Dv-JKFfV%2BF_y_gwMHwrYQkRiEvNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Hyuk Ko
2018-08-10 16:54:11 UTC
Permalink
Thank you for helping me out!

I found PIL might be just the right solution for me

def check_equal(imgA, imgB):
return ImageChops.difference(img1, img2).getbbox() is None

These two lines solved my problems!
Post by Justin Israel
It doesn't look like that demo is using OpenCV for more than just reading
and decoding images into byte arrays. And then a difference between the
byte arrays is used to determine if the images are the same. Seems you
could probably do the same thing with PySide using QImage
http://doc.qt.io/qt-5/qimage.html#operator-not-eq
It defines a similar subtraction operator that says it first checks cast
stuff like width/height and then would do a data comparison.
Im sure OpenCV *could* be used to do more advanced stuff like checking if
the images are different within certain thresholds to allow for stuff like
noise. Or evaluating if the images are generally of the same subject. And
also, you would probably get a wider support of file formats with OpenCV.
If you don't want to have to compile OpenCV and numpy, and your goal is
purely to check the difference, then there is always the option to shell
out from your script to something like idiff (provided by OpenImageIO) or
whatever other diff tools exist.
Justin
Post by Hyuk Ko
Hello!
I am trying to make a simple image comparing program in maya
http://youtu.be/LNzC4NYYWdg something like this...
I looks like a really easy job by using OpenCV and numpy
Tried to install these packages in maya, and failed HARD... (first time
installing outer packages to maya... not easy as it sounds)
Is it possible to make a similar program by using pyside?
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/32958bc8-30cb-4afd-b93b-55e1e849a870%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/32958bc8-30cb-4afd-b93b-55e1e849a870%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/39fac7cd-7f66-490a-8872-67eae05c5380%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...