Forgot your password?
typodupeerror
Image

Firmware Hack Allows Video Analysis On a Canon Camera 115

Posted by timothy
from the turn-your-family-green-with-envy dept.
An anonymous reader writes "Researchers from the University of Liege in Belgium have been able to perform real-time video analysis on a regular Canon digicam (video link) without any hardware modification. The results are shown directly on the digicam's screen. They use a hacked version of a popular open-source alternative firmware for Canon cameras: CHDK. This is a proof-of-concept that computer vision algorithms can now be embedded on regular Canon digicams with little effort (CHDK is coded in C). What other popular vision algorithms could be implemented? For what purpose?" You can get some idea about ViBe from this abstract at IEEE; basically, it allows background extraction in moving images.
This discussion has been archived. No new comments can be posted.

Firmware Hack Allows Video Analysis On a Canon Camera

Comments Filter:
  • Zoneminder (Score:3, Interesting)

    by b0bby (201198) on Wednesday March 17, 2010 @03:00PM (#31513228) Homepage

    I've been playing around with Zoneminder a bit & this could be a way to use decentralized cheap cameras to send events to a ZM server. Pretty neat.

    • Re: (Score:3, Funny)

      by davester666 (731373)

      I wrote code for this so that my camera would draw a little red box around the faces of terrorists. It seems I'm surrounded by them.

      • Re: (Score:1, Funny)

        by Anonymous Coward

        perhaps you could implement that with collision boundaries and gun turrets before they terrorize you. that would keep the status quo, right and proper, all the way.

    • by Lumpy (12016)

      Id rather zoneminder do the processing and use cheaper video cameras to send video to zoneminder.

      I've been using zoneminder for 4 years now, What more important is not "cheap" but high frame rate.

      • by b0bby (201198)

        If you're doing wireless, sending high quality images back continuously can really chew up your bandwidth. If the camera has enough smarts to only send events it can make things easier. Plus using less bandwidth makes things like having your Zoneminder box be an offsite VM easier too.

  • CHDK (Score:5, Informative)

    by The MAZZTer (911996) <[moc.liamg] [ta] [tzzagem]> on Wednesday March 17, 2010 @03:00PM (#31513230) Homepage

    I use CHDK [wikia.com] on my own Canon PowerShot. Good stuff.

    • Re: (Score:3, Interesting)

      What's the 'newest' Camera that supports CHDK? Mine got stolen recently and I'd like something to replace it for times I don't want to lug around my SLR.

      Does CDHK support the DIGIC IV (720p, better face recognition). I played around with one of my friends and face recognition, the fact that you can zoom in and scroll through all faces to make sure they're in focus. Lots of cool stuff, but CDHK seems to mostly support older stuff and Canon's numbering scheme sucks.

      • by Gruff1002 (717818)

        Newest Canon to the best of my knowledge is a G11 that will support CHDK

      • Re: (Score:3, Informative)

        by rhizome (115711)

        Check the sidebar: http://chdk.wikia.com/wiki/CHDK [wikia.com]

        I'm anxiously awaiting the SD1200 port.

      • Re: CHDK (Score:4, Funny)

        by Anonymous Coward on Wednesday March 17, 2010 @03:55PM (#31514120)

        What's the 'newest' Camera that supports CHDK? Mine got stolen recently and I'd like something to replace it for times I don't want to lug around my SLR.

        I'm interested by that too as I've recently "acquired" a new camera.

        • Re: (Score:3, Funny)

          by vegiVamp (518171)

          "acquired", with quotes ? What, you were taking an innocent evening stroll through a random stranger's living room and one just happened to fall into your pocket of it's own accord ?

      • Re: (Score:3, Interesting)

        by TubeSteak (669689)

        I played around with one of my friends and face recognition, the fact that you can zoom in and scroll through all faces to make sure they're in focus.

        Maybe someone can explain the multi-focus thing to me.
        Does the camera pick out all the faces and then pick an average focal point?
        Or does the software (as opposed to the lens) actually tweak each face into focus?

        • Re: (Score:3, Informative)

          by DZign (200479)

          As far as I know it'll check the different faces and decide where it has to put focus and a small enough aperture so
          they all are sharp.
          So if the faces are close enough to each other it can focus on one and go for a small dof that'll have them all sharp, if they're further away then it'll increase dof (and thus exposure time) and possible put actual focus somewhere in between the faces (again, if I'm not mistaken it's around 1/3 before your focal point and 2/3 after it that's sharp).

      • Re: (Score:2, Informative)

        by Trebawa (1461025)
        I have a PowerShot SX200, which is compact and DIGIC IV. It also shoots 720p. There's a beta of CHDK for it, and it's worked well so far.
    • Re: CHDK (Score:4, Informative)

      by kimvette (919543) on Wednesday March 17, 2010 @03:35PM (#31513832) Homepage Journal

      I use it on my S5 IS. I use the intervalometer, various grids (for composing level shots when it matters), the extended shutter modes (both slower and faster than the "stock" firmware allows) and of course the RGB histogram and on rare occasion raw. I don't use raw too often though because it slows the camere down a fair bit. However, CHDK is a wonderful tool and scripting it isn't too bad. The documentation is actually pretty good for a "young" open source project. In short, it makes point-and-shoot cameras usable where they otherwise wouldn't be, and where a point-and-shoot camera is preferable to a DSLR (such as when traveling), it can give you some of the capabilities you would normally turn to a DSLR for.

      I hope they manage to port it to the DSLRs, particularly the EOS 7D.

    • Re: (Score:3, Insightful)

      by xxdinkxx (560434)
      http://orbi.ulg.ac.be/bitstream/2268/12087/1/Barnich2009ViBe.pdf [ulg.ac.be] There is the paper in question. I despise the fact that I still have to pay for papers in IEEE silos when I am in fact a member.
      Yeah I could upgrade my subscription, but bah.

      RANT.YML
      rant:
      information should be free
    • Re: (Score:2, Informative)

      by Anonymous Coward

      Does repeating a link in the summary really count as informative?
      I know this article is only tangentially about CHDK but I've been looking into CHDK lately for a project so I thought I'd share some useful links.

      Supported Cameras [wikia.com]

      Note that a higher number doesn't mean it's a newer model. The A710 was released before the A590.
      Canon PowerShot A series info [wikipedia.org]

      CHDK Howto [hackaday.com]

      Info on how to make a port [mweerden.net]

      Info on implementing PTP in CHDK [mweerden.net]
      This is still relatively new but it could allow using a computer to remotely control the c

    • Wow! I didn't know people were doing this sort of thing. I have been leaning towards a Canon for other reasons, but this will weigh heavily in Canon's favour for my next camera purchase.
    • by ShakaUVM (157947)

      >>I use CHDK on my own Canon PowerShot. Good stuff.

      Ditto. When I get bored waiting for an animal to do something, I play Daleks on my camera. It's awesome.

    • by mctk (840035)

      Also use CHDK, also consider it good stuff. And I love the fact that my powershot takes AA batteries and has a standard USB connector. They've gotten more money out of me because of this, not in spite of it.

  • Subject pretty much says it all.

    Unfortunately, it seems many camera manufacturers - including Canon when it comes to their SLR line - are far happier to put any new functionality in newly released camera models and put them on the bullet list for those, rather than making it available for older models as well and just letting the new model's technical (rather than software) advantages make their sales.

  • Abstraction overload.

    I'm sure "video analysis" means something more concrete to those in the know (or not), but I can't shake off the feeling that it's all blahblahblah with no meaning other than to generate more blahblahblah.

    Guess it worked, too. Blah blah.

    Blah.








    Blah blha?

    • Re: (Score:2, Informative)

      by Anonymous Coward

      I'm sure "video analysis" means something more concrete to those in the know (or not), but I can't shake off the feeling that it's all blahblahblah with no meaning other than to generate more blahblahblah.

      OpenCV [wikipedia.org]
      Integrating Vision Toolkit [wikipedia.org]

      Think these libraries but on the camera. You take an image, you process HSV, contrast, and a bunch of other data to do shape detections, motion detection, etc.

    • by psbrogna (611644)
      Boss, is that you?
    • You said "blha" instead of "Blah" in the end. That makes no sense.

  • Interesting... (Score:4, Interesting)

    by fuzzyfuzzyfungus (1223518) on Wednesday March 17, 2010 @03:10PM (#31513412) Journal
    What I find interesting about this is not so much that the code can be loaded(since the CHDK project already did that job, and has had it working for some time now); but that consumer digicams would have enough general purpose punch to run anything much more than trivial scripts that more or less emulate series of button presses(which can be extremely useful, for time lapse, auto bracketing, etc, etc.).

    Given the sheer number that are produced, and the fairly tight battery life constraints, I would have assumed that most of the heavy lifting(crunching raw sensor data to .jpeg form, or encoding video) would be done with largely fixed function hardware, with just a little bit of general purpose computer slapped on to handle UI, user input, and tweak the settings of the encoder units. Apparently, the general purpose units have more punch than I thought.
    • Re:Interesting... (Score:4, Insightful)

      by vlm (69642) on Wednesday March 17, 2010 @03:26PM (#31513690)

      What I find interesting about this is ... that consumer digicams would have enough general purpose punch to run anything much more than trivial scripts

      Check the feature list of typical modern "consumer"-ish digital cams. Marketing has decided that the average moron needs to be able to filter pics to look like a faded photograph, or put the picture inside an ornate picture frame, or cover up parts of the image with heart and caption overlays like those stupid "reality-TV" dating shows. The enormous resources required for stupid marketing tricks can be re-purposed to do much more interesting things... Which probably pisses off the marketing guys. Which I like.

      To a first approximation, the computing power required to store a pic is not much worse than the viewfinder display. And they don't seem to care about updating the video viewfinder continuously. So, it can't be too horrible of a computational task.

      • Re:Interesting... (Score:5, Insightful)

        by timeOday (582209) on Wednesday March 17, 2010 @03:43PM (#31513946)
        The most computationally demanding onboard processing I've noticed (aside from video encoding, which surely uses a dedicated chip) is recognizing multiple faces in real-time, or tracking a moving object, to maintain focus. Far from the gimmicks you mention, these are very useful functions that just happen to require what amounts to video processing.
    • Well, for what it's worth, the only thing the camera in the video seems to be doing is threshold compare on a pixel by pixel basis, ie if each pixel changes from the previous frame by more than a certain amount then it's highlighted, which is a pretty simple operation. Still, it's a cool proof of concept.
    • by wvmarle (1070040)

      This also may explain why there are no truly cheap digital cameras.

      The cheapest that I can find nowadays costs still at least about USD 100. They all do zoom, fancy tricks, lots and lots of megapixels, whatever.

      Maybe I have only looked in the wrong shops but I can't seem to find cheap, simple point-and-shoot style digicams. For my business I often have to shoot photos, and would like to have a cheap cam that I can keep in my bag, that has decent quality, no need to zoom, cheap enough to not hurt my wallet

  • by eldavojohn (898314) * <eldavojohn&gmail,com> on Wednesday March 17, 2010 @03:23PM (#31513646) Journal
    OpenCV [sourceforge.net] has C interfaces [willowgarage.com] and there are more that have some C code libraries [cmu.edu]. Really the coding challenge would be building the wrappers to utilize those libraries with your camera's hardware (I assume provided through CHDK APIs). My vote is for a nifty KLT implementation that allows me to take a video and extract a huge wide pan image in post processing on the camera.
    • by xxdinkxx (560434)
      because having multiple computer vision systems with different focuses is not a bad thing. For instance OpenCV has nothing in the way of Waldboost classifiers. Opencv seems to be mostly focused on haar-like feature classifiers.
    • by pdxp (1213906)
      xxdinkxx makes some good points, and also I've learned from experience that OpenCV is too slow for mobile devices in its generic form. You'd end up needing to write optimized assembler code specific to the camera's processor anyway.
    • by wvmarle (1070040)

      I have seen exactly that demo'ed in an ad on TV not so long ago. I forgot which brand has it, but it exists.

  • by Anonymous Coward

    Meh, the video demonstrates simple motion detection, which is no surprise considering that these cameras do face and smile detection all the time.

    I was hoping for more, something along the lines of object recognition, artificial horizon, being able to see a road...

    • by SharpFang (651121)

      Mine doesn't have any "detection" built in, but original CHDK has edge detection, "Zebra" (marking saturated or entirely black areas), several different options of histogram, and quite a bit more. Yeah, this hack doesn't do all that much comparing to what CHDK does... comparing what a Canon camera without CHDK does - it's impressive.

      As for the other options you mentioned - they would be quite doable with the CHDK software. That wouldn't help much though, because all you'd get is the image with these feature

      • The monolithic build for CHDK already has simple motion detection built in. It is only accessible from a script, however, but you can find the configuration options for it in the menus.

  • by marcansoft (727665) <hector&marcansoft,com> on Wednesday March 17, 2010 @03:38PM (#31513866) Homepage

    It's worth pointing out that CHDK isn't a hacked firmware (that would probably not be legally redistributable), nor is it an alternative firmware (that would be too much work). CHDK is an add-on to the existing firmware, that works by piggibacking on its OS, hooking functions, and spawning off extra processes on the camera's RTOS. This is what makes it so great: you get the original funcionality of the camera plus extra stuff, and you don't have to wait for the developers to add what already came with your camera anyway.

    • Re: (Score:2, Interesting)

      by Anonymous Coward

      CHDK is an add-on to the existing firmware, that works by piggibacking on its OS

      If it would have been an Apple camera, ten thousand lawyers would have been busy suing the developers.

      CHDK made me buy a Canon, and Canons approach of "live and let live" will make my next purchase a Canon 50D.

      Thank you Canon!

      • If the camera was a networked device always running on the background Canon might react differently too. Maybe if Canon sold software packages to enhance the camera and this ate their sales they might also work against it. As is, I think this is really not very popular (all the people I know have a canon camera, none have installed CHDK vs. 25% of them have an iPhone and quite a few jailbroke them), so they have no reason to waste resources in fighting it.

        • by ShakaUVM (157947)

          >>As is, I think this is really not very popular (all the people I know have a canon camera, none have installed CHDK vs. 25% of them have an iPhone and quite a few jailbroke them), so they have no reason to waste resources in fighting it.

          You must have a different group of friends. Once when I was hiking, a friend of mine started talking about his awesome hacked firmware, and all three of us whipped out our Canons and had CHDK installed. =)

    • It's an awesome project. On my Canons it allowed a range of extra picture tweak settings and allowed some better RAW image manipulation.

    • On the other hand, it also can't add back what Canon took out. One of the best photos I ever took (IMHO) was taken with the Color Accent mode accidentally turned on in my Canon A540. This feature was removed in the A570 that replaced it. It seems like trivial functionality to put back in, but CHDK can't.

      • CHDK can add plenty of things, though of course if the code is physically missing then it would have to be reimplemented. Consider that CHDK allows RAW mode in cameras that don't originally support it, for example.

        • raw is actually relatively simple. Most cameras will have to have the pre-debayer/pre-jpeg readout of the sensor somewhere. As long it isn't completely hidden behind some opaque hardware, find it, write it to a file, there's your raw! This not to make light of work Vitaly and Grand did early in CHDK, getting to the point where you can do that is a big job.

          A bit OT, but CHDK raw doesn't necessarily buy you a lot. You get a little more dynamic range, and you can do white balance after the fact, but it's only

      • The stuff done by the Digic DSP (rather than the plain jane ARM946ES that runs the OS, UI and CHDK) hasn't been deeply explored. You might be able to get color accent back, if your hack-fu is sufficient. The fact it hasn't been done isn't by itself a sign that it is impossible, it more frequently means no one has spent a lot of time in that particular area. Of course, if you did spend the time, you might find that it is in fact not possible. The canon firmware code is complicated enough (~3MB of machine cod

  • by Anonymous Coward

    You can check our dedicated webpage [ulg.ac.be].

    It features downloadable binaries for windows and linux (thanks to wine).

FORTH IF HONK THEN

Working...