Come Mr. PixyMon, hack me Pixy firmware ;^)

398 views
Skip to first unread message

simon.d.levy

unread,
Jul 21, 2015, 12:50:18 AM7/21/15
to pixy_fir...@googlegroups.com
So I was able to make a trivial change in the PixyMon source (just replaced S= with S=# in the label for the blob rendering).  Now I'm diving into the firmware.

If I'm interested in changing the image-processing algorithm to Farneback optical flow (or anything else), would I want to look first at the CPP files in gcc/device/main_m4/src ? Or someplace else?

Rich LeGrand

unread,
Jul 21, 2015, 10:41:58 AM7/21/15
to simon.d.levy, pixy_fir...@googlegroups.com
Hi Simon,
Before I embed an algorithm in Pixy I usually do 2 things first---

1 test the algorithm in something like matlab using raw frames from Pixy
2 write a monmodule in PixyMon so I can test the algorithm "live" like
in cooked mode, but doing the processing on the PC side.

I'm guessing you don't need to do the first step because you're
familiar with the algorithm, how well it works, etc, but the 1st step
is useful when you're familiarizing yourself with an algorithm. The
2nd step is useful because it allows you to debug on the PC side.
Debugging/developing on the Pixy side is slower. The 2nd step also
has the advantage that you get your own cooked mode for the algorithm,
to debug, etc. (Cooked mode is a cheat --- we're taking raw frames
from Pixy, processing them within PixyMon and overlaying processed
video ontop of raw video.) And once the 2nd step is done, embedding
into Pixy is fairly straightforward.

There's a couple examples of monmodules in PixyMon, but you check out
the cblobmodule by uncommenting line 23 in cblobmodule.cpp
MON_MODULE(CBlobModule);

and recompile. It will reveal a new properties tab (see attached pic)
and several new menu options. This was our testbed for developing the
current algorithm. Using the mon-module interface, new algorithms can
be tested fairly easily using real pixels from Pixy.

Hope this helps!

--rich
> --
> You received this message because you are subscribed to the Google Groups
> "pixy_firmware_sdk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pixy_firmware_...@googlegroups.com.
> To post to this group, send email to pixy_fir...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pixy_firmware_sdk/5b3ab997-ff94-48cc-8496-aaebd12ce5cd%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Charmed Labs
www.charmedlabs.com
Image 306.jpg

simon.d.levy

unread,
Jul 22, 2015, 2:01:42 PM7/22/15
to pixy_firmware_sdk
Thanks for the tips, Rich!  I had already started on step 1 (prototyping the algorithm in Matlab), but I was unaware of possibility of prototyping the firmware by using PixyMon -- a very clever approach!

I will work on this and get back to you with some updates.  

simon.d.levy

unread,
Jul 27, 2015, 11:03:06 PM7/27/15
to pixy_firmware_sdk, simon....@gmail.com
Just a little progress report, guys: (been busy with other stuff too!): I successfully followed your (Rich's) instructions for modifying cblobmodule.cpp, and discovered that the render() method is the (obvious I guess) core of these modules.  Render wasn't doing anything in cblobmodule, so now I'm looking at it in cccmodule.cpp, where the real action is.  Looking in detail at your blob-making code will, I hope, help me add my algorithm to PixyMon.

Really growing to love this little camera and the cool stuff you've done with it!

More soon ...
Reply all
Reply to author
Forward
0 new messages