Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Bonsai shaper program, .raw from digital camera

  1. Feb 22, 2015 #1


    User Avatar
    Gold Member

    Hi people,
    I would like to create a sophisticated program that takes care of a bonsai. For simplicity let's assume that the bonsai is put into a cubic box with white walls, a digital camera able to produce .raw files and is under a compact fluorescent lamp.
    I want to define what I'd call the "perfect range" of green value for the leaves, say from 540 to 570 nm wavelength so that if a leaf is outside this range, the program would cut it with the help of a mechanical arm.
    Now, under such an illumination, I expect to be able to determine how 550 nm wavelength light is represented into the .raw file from the digital camera. I would like a real world example but I can't seem to find any example of .raw file on the web and I don't have a digital camera that produces such file extension.
    How hard would it be to extract such information (colors) from a .raw file? Do you have any idea about this crazy project?

    P.S.:The program would do many other things like taking care of humidity, etc. but for now let's tackle the visual part.
  2. jcsd
  3. Feb 22, 2015 #2
    Hey, my Cannon takes images in raw format. What I would do in your case is export to a 16 bit TIFF, so I have 2^16 shades of green to choose from.

    Light is hard though. For instance, a leaf on top might need trimming if the camera captures a certain shade of dark green, but a leaf lower than it might be healthy, but come up as the exact same shade of dark green in the picture because its further from the light or slightly shadowed. You would want some 3D awareness of the plant to make these sorts of judgements, like from a 3D camera. Here's a Lytro watching flowers grow:
  4. Feb 22, 2015 #3


    User Avatar
    Gold Member

    I see, very nice. I guess that would be more than enough.

    Maybe a partial fix would be to shed the light from just above the camera (somehow like a flash from a digital camera).
    Although if a leaf is dark green this shouldn't be a problem because it's still green. If however there is yellow light coming from leaf/ves then there would be problem.
    I've searched on the web some pictures in .raw extension, still can't find any.
  5. Feb 22, 2015 #4
    Here's a few raw images:
    The suffix for what my Canon calls raw images is .cr2. They are about 20 megs each though, I would just work from a standard picture format, even jpeg just for simplicity.

    One interesting thing to test would just be to get rid of all the luma (lightness darkness info) and look just at dominant color frequency, like you were talking about. I'll bet unhealthy leaves would always be skewed toward red/yellow.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Bonsai shaper program, .raw from digital camera