Smartphone spectrophotomter based on hue to wavelength conversion

58 views
Skip to first unread message

Markos

unread,
May 4, 2017, 9:02:38 AM5/4/17
to plots-spe...@googlegroups.com, plots-wat...@googlegroups.com

Markos

unread,
May 8, 2017, 8:03:26 AM5/8/17
to plots-spe...@googlegroups.com, plots-wat...@googlegroups.com
Hi,

I'm taking my first steps with photometry and I decided to use the
approach proposed by this article using a webcam.

http://www.sciencedirect.com/science/article/pii/S0925400516311911

I am evaluating the possibility of measuring the color intensity of the
chlorine colorimetric analysis kits.

These kits use the principle of visual comparison and my intention is to
automate color evaluation using a webcam.
The goal is to extract quantitative color information (RGB parameters)
from an image.

I am using fswebcam to capture the images.

I observed that the webcam makes automatic sensitivity adjustments when
it varies the external brightness.

Any tips on how to keep the webcam sensitivity constant even by varying
the brightness of the image?

Thanks,
Markos

Em 04-05-2017 10:04, Markos escreveu:
> http://www.sciencedirect.com/science/article/pii/S0925400516311911
>
> https://www.researchgate.net/publication/305719497_A_handheld_smartphone-controlled_spectrophotometer_based_on_hue_to_wavelength_conversion_for_molecular_absorption_and_emission_measurements
>
>

Pei

unread,
May 9, 2017, 1:22:25 PM5/9/17
to plots-spectrometry, plots-wat...@googlegroups.com, mar...@c2o.pro.br
Hi Markos,

I would say it probably depends on the webcam but in general your control over the webcam is going to be limited. You may be able to control exposure but probably not white balance or ISO or aperture. On the other hand, what you might be able to look into is to have a constant reference in the view with your object, so in the image processing steps you can calibrate each image based on the reference. A scientific image reference can be costly though.

I might also suggest using a phone camera instead - just makes everything easier.

Feel free to reply if you have more questions,

Pei

Amir Bernat

unread,
May 11, 2017, 4:09:46 PM5/11/17
to plots-spectrometry, plots-wat...@googlegroups.com, mar...@c2o.pro.br
It's great they used and published their findings, but I have some reservations on the image analysis methods, why use hue to wavelength if you can do an absolute calibration with CLF lamps? 
In the past year and a half I am working at a company called MobileODT where I participate in the development of a biomedical imaging multi-spectral camera. Last January we presented in SPIE photonics west some of our work, part of it was verification of color correctness when imaging with a smartphone, see link below. One conclusion we came to and were supported by other in the conference is that setting your imaging parameters correctly is crucial. We used a Nexus 6 saving RAW dng images with set white balance. those images then needed to be converted from RGB to gray, as the source was a raw image we could employ different white balance, different gamma etc. a good source is the rawpi python package where you could find different conversion schemes. Whenever you can do something in more than one way - you can bet there are many wrong ways but not more that one right way. A later talk presented a different way which they claimed to be more correct, sadly they didn't share it with me... If you do find a manual on this - please share it!

https://spie.org/Publications/Proceedings/Paper/10.1117/12.2252189

It is my *opinion* using a compressed lossy format with auto settings may be problematic, you should ideally use hard coded settings, save in raw, make sure you translate to gray properly. test your system with a known target such as color calibration card, then start doing the interesting stuff. I'd recommend you check out either the picam, or even better the noir cam which can take raw images for a low cost rather than a webcam or phone.

Another tip following Pie's, I found on ocean optics website is to use styrofoam as a reflectance target, it is generally very spectrally flat at ~95% reflectance and easy to find.

That being said - I do think the work you published here is really cool and interesting!

Amir Bernat

unread,
May 11, 2017, 4:13:18 PM5/11/17
to plots-spectrometry, plots-wat...@googlegroups.com, mar...@c2o.pro.br
Also, I forgot to add this tutorial:

Markos

unread,
May 13, 2017, 1:44:55 PM5/13/17
to plots-wat...@googlegroups.com, plots-spectrometry
Hi Amir,

There is a lot of information in your message.

I will read it slowly and try to understand your suggestions in more detail and respond later.

Thank you very much,
Markos
--
Post to this group at plots-wat...@googlegroups.com
 
Public Lab mailing lists (http://publiclab.org/lists) are great for discussion, but to get attribution, open source your work, and make it easy for others to find and cite your contributions, please publish your work at http://publiclab.org
---
You received this message because you are subscribed to the Google Groups "plots-waterquality" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plots-waterqual...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Markos

unread,
May 14, 2017, 10:23:52 AM5/14/17
to plots-wat...@googlegroups.com, plots-spectrometry
An interesting review:

Recent developments in computer vision-based analytical chemistry: A tutorial review

http://www.sciencedirect.com/science/article/pii/S000326701501243X


Em 11-05-2017 20:09, Amir Bernat escreveu:
Reply all
Reply to author
Forward
0 new messages