Pixymon modified with a custom tracking algorithm with no colors!

Added by Sondre Jensen about 3 years ago

Hello!

I've been working on a custom motion tracking algorithm for pixy, and figured I'd modify pixymon first to develop, test and tweak the algorithm.

The algorithm is pretty different from the original pixy algorithms, instead of tracking colors equal to predefined colors/colorcodes, this algorithm does the opposite, it looks for changes in pixels/colors over time. It does require (a lot) more cpu/memory, at least on the desktop, but hopefully it's possible to port the algorithm over on the pixy itself(?).

Here's a short video demonstrating the algorithm/pixymon in action.
www.youtube.com/watch?v=zDv3GksQtp8
(yes, that is me headbanging xD )

I've also included a few screenshots in the attachments.

With my limited understanding of pixymon, c++ and qtcreator, I took a rather crude approach to this mod.
The original source-code for pixymon has been, frankly, butchered by me, but keep in mind that my intention was only to test out the algorithm with images from the pixy, call it a conceptual test :)
So, I promise nothing in regards to the stability, portability and usability of this program.

That said, If you would like to try out my modified pixy, go ahead and download the source-code from here:
https://github.com/Pravuz/Pixymon_modified

The classes I've changed are; renderer, mainwindow.
I've only added one new class; urmmodule
I've also removed a whole bunch of classes and features that I didn't need to concern myself with (made it easier for me to keep an overview of the code).

The settings window have a new tab under "PixyMon Parameters (saved on computer)" called uRobotics (my bachelors project group-nickname).
Here you can play with the filters and modes, which will need changing depending on lighting etc.

I hope you like it, and I would very much appreciate feedback, optimization tips, general tips etc.
This is a part of my bachelors project, so I will continue to work/improve on this, and in the end, port the algorithm to the pixy firmware (any offered assistance on this is greatly appreciated as well).

Thanks!

EDIT: Whops, the settings screenshot was the wrong screenshot.
EDIT2: uhm, Added all the screenshots twice :P one of the settings.png is the right one...


Replies (6)

RE: Pixymon modified with a custom tracking algorithm with no colors! - Added by Rich LeGrand about 3 years ago

Hi Sondre,
This is awesome! I really like the video!

We'll be posting some docs on how to modify PixyMon using what we're calling "monmodules". If you look at the current source code in github, cccmodule.ccp/h is an example of a monmodule -- it allows you to define your own rendering routines, add your own parameters, commands, etc. for a particular algorithm (but it looks like you've added your own configuration tab, so maybe you've figured it out already.)

good stuff man!

RE: Pixymon modified with a custom tracking algorithm with no colors! - Added by Sondre Jensen about 3 years ago

Thanks a lot Rich!:)

Yes, I tried to make use of monmodule with the urmmodule class I made, which extends monmodule. I didn't quite figure out how to implement custom render routines, so I just mofified the renderer class:p I did implement some config paramenters here however.

I did some rudimentary performance analysis of my modified pixymon, and noticed that while the cpu load was pretty much the same as with the original pixymon, ram usage was at more tha n 20mb higher.

This might be due to some memory leak/waste, but do you think the pixy will be able to run this algorithm? Reducing the image from the sensor to 8bit greyscale might reduce memory usage enough, or?

Thanks in advance, and thanks again for the nice feedback:)

RE: Pixymon modified with a custom tracking algorithm with no colors! - Added by Edward Getz about 3 years ago

Hello Sondre,
I believe the cccmodule.cpp and cccmodule.h have examples of rendering routines. renderCCQ2() and renderCMV2(). The cccmodule (or any monmodule) gets its render method called and it can choose to render the data (by returning true) or not and returning false.

Hope this helps!

RE: Pixymon modified with a custom tracking algorithm with no colors! - Added by Sondre Jensen about 3 years ago

Hi Edward

I see, thanks :) due to time-constraint in my project, I've decided to discontinue pixymon for now, and focus on the pixy firmware implementation of my algorithms.
I might have to use pixymon for user-configurations however, so If I end up with some spare time, I'll try and make a completely separate module in pixymon based on monmodule :)

Thanks!

RE: Pixymon modified with a custom tracking algorithm with no colors! - Added by Ales Pogacar 6 months ago

Hi everybody,

Great work. I am trying to use this motion tracking algorithm with small adjustments for my needs. I would like to know what would be the easiest way to move the pan tilt mechanism to track this movements without porting the algorithms to pixy itself? So essentially doing it from pixymon. Thanks

(1-6/6)