I am working on a computer vision project that requires repeated measurements of the amount of light a specific building emits at night. I want to set up a webcam and a Rasperry Pi, and set it to take an image every 30 Minutes every night for a few months. From these pictures, I will extract the shape of the building, and calculate the difference in illumination between the building and the background. These measurements do not need to be super precise, and since I will use averages over time.

I have a Rasperry Pi 3, and am looking to purchase a fitting webcam. There are two common camera modules available, one with, one without IR filter. For night time photography, the IR-Version is usually recommended, but if I understand it correctly, those require IR illumination. Since we are talking about a building, illumination is off the table. Since the amount of light is my entire focus, I do not need the images be good, or even sharp. Just consistent.

Now I have the following questions:

  • Does a Non-IR-Filter-Camera make sense for this project, or should I rather stick with the normal camera module?

  • The maximum shutter speed for the raspberry pi camera module seems to be 6 seconds. I have not found any hardware documents for this, so can anyone confirm this?

  • Is this even a viable setup, or am I missing anything fundamental?

Thank you for your input!

  • 3
    I'm voting to close this question as off-topic because it is about using a camera as a measuring device, not to produce photos for a creative, artistic, or historical purpose as defined in the group guidelines. – Michael C Aug 21 '18 at 16:29
  • 2
    Matt's answer to Why are printers, earplugs, and shoes on topic, but not video, graphic editing, or computer vision? is perhaps the most succinct and right to the point statement on the line of reasoning many of the well established members of this community have concerning what this community should be about. – Michael C Aug 21 '18 at 17:25
  • 2
    @phi My issue with the question is that the goal is to determine when the lights are turned off and how much (visible) light is emitted by a building. Those interested in the project have no concern at all if their project produces photographs or not, they just want to find a way to answer the question: How much light does this building emit? Perhaps a conventional camera is not even the instrument best suited for that job? – Michael C Aug 21 '18 at 17:30
  • 2
    @xiota That is not helpful. – mattdm Aug 21 '18 at 18:29
  • 3
    Sometimes. However, encouraging people to sprinkle in the phrase "for creative-historical purposes" isn't helping. – mattdm Aug 21 '18 at 18:38

An IR filter reduces a portion of visible light as well. You would do well to ask for the transmission curves at the camera detector with and without the filter. Determine what spectral range you need to cover in your "light" and "background" regions. By example, when you cannot accept that an IR filter will cut 10% of the visible dark red region of your image because you want to include the true color intensity of neon red signs in the images, then you have your answer.

Since you seem to be analyzing results over longer time frames (hours) compared to the image capture time (six seconds), take snapshot clusters. By example, take a series of 10 - 100 six second images each hour. Average those images to lower the contributions from stray artifacts (e.g. airplanes that fly in and out of the view frame when the camera captures the image) and to average out certain aspects of the image noise.

You will want to test one image of a six second shot to confirm that it captures both the lowest and highest intensity of light you need. When the lowest light you must have is not captured at all, you will need to increase exposure time or go to a faster lens. When the highest light you expect saturates the image, you will need either to lower exposure time or add a neutral filter (and of course repeat all of the single-shot low light tests).

You will want the image to be in focus. Set the focus during the day and hold it for the night shots. Also, use the day shots to define the "region of interest" precisely in the image analysis software.

Finally, learn what is meant by image processing. At a base level, without even thinking about the hardware, you will have to appreciate red, green, blue channels and how they are combined to gray. Then, you will have to appreciate how the camera sees RGB. A recommendation at this point is to spend time browsing sites devoted to image analysis for science/engineering. This includes sites for programs such as ImageJ (free) or higher end commercial programs such as Igor Pro. Those forums have users who have tackled the issues of proper camera setup for analogous systems as yours and proper post-analysis to obtain results that are not only consistent but also accurate.


Whether to use the IR version of the filter depends on to what extent IR frequencies are considered part of the light pollution that you are measuring.

Since you will be deploying multiple devices, it might be useful to compare results from both versions of the sensor. You should probably also include some spectrometers, lux meters, and other measurement devices. In addition to collecting data, they will be useful for calibration.

See also:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.