How do I Move Art at the National Gallery of Art in Washington DC using a Pixy and Arduino?

Calder_NGA-WashDC
I am using a Pixy2 with the Pan/Tilt servos on an Arduino Uno and using the ribbon cable SPI to connect the two. Please see the attached pic of the Calder Mobile at the National Gallery of Art in Washington DC. Using the Pixy I need to know if the Calder is moving. If it is NOT moving I need to tell a fan to turn on to make it move. I have the Arduino configured for 2 analog outputs for the x, y coordinates and a digital output to turn on a relay for the fan. My biggest problem, as you can see from the pic, is the objects are all RED and vary in size. The other part of the Calder Mobile has BLACK objects which I understand the Pixy does not recognize. If I target the largest RED object it becomes smaller as it moves away from the Pixy so it's no longer the largest. And as for using coordinates of the largest RED object. The Pixy uses the object that is in its center frame for those coordinates, so whether it's the largest or smallest RED object the coordinates will be the same.
Thank you for any programming assistance,
John

The Pixy2 is not intended for the purpose you have in mind, and might never work for the project.

Investigate other possibilities, like the ESP32-CAM, which is cheaper, and supports conventional image processing.

I would start by disconnecting the pan and tilt hardware since you are trying to detect motion and doing that with a moving camera makes it more dificult.

I would use the "CCC Hello World" sketch:

This should be able to give you a list of red blobs it sees and their bounding boxes. If those bounding boxes have not changed for a while, the mobile is not moving.