Better Downward Camea

mrandt
Posts: 407
Joined: Mon Apr 27, 2015 10:56 am
Location: Stuttgart, Germany

Re: Better Downward Camea

Post by mrandt »

Hey Gregor,

C270 makes a perfect up cam - if you buy an Andonstar microscope make sure to get one with physical 2 MP resolution (not jus interpolated).

Cheers
Malte
mucek
Posts: 40
Joined: Mon Oct 26, 2015 7:06 pm

Re: Better Downward Camea

Post by mucek »

Hi! Thanks for info! It says 2 mp, so I expect to get such ... Otherwise ebay service will have a claim to solve ;)
User avatar
Mark Harris
Posts: 38
Joined: Sat Nov 14, 2015 12:34 am
Location: Calgary, AB

Re: Better Downward Camea

Post by Mark Harris »

mucek wrote:Hi!

Thans for your answers. Regarding to https://www.youtube.com/watch?v=94lDYZgihT4 C920 should have fixed focus.
However, I am still wondering if go into it: 40 EUR vs. 20 EUR (for C270) is still double price and I am not sure if difference is so big (as already original camera does its job quite splendid and C270 is already a big improvement)

Regards,
Gregor

[edit] Found Andonstar microscope on ebay for 50 EUR: as it seems to be proven stuff, I'll take this :)
For future reference, the C920 appears to have auto focus, which we don't want.
Autofocus
The 20-step autofocus is more responsive, more sensitive and more intelligent. So whether your kids won’t stop moving or you’re trying to capture your latest dance moves, the C920 delivers razor-sharp images (from 10 cm and beyond) for every occasion.
assasinsareus
Posts: 22
Joined: Mon Nov 02, 2015 12:43 pm

Re: Better Downward Camea

Post by assasinsareus »

I managed to pick up a c270 webcam for £15 at the local PC World so made a simple 3D printed bracket to allow it to be used as the downward cam.

Bracket and photo available from here,
http://www.thingiverse.com/thing:1147216

I had to open up the camera to adjust the focus but its now working very well. A drop of glue helps to keep the bracket fixed in place on the aluminium holder.

The LED ring also fits onto the camera using double sided foam tape but I need to work on the diffuser. I wonder is there is any way to adjust the brightness of the LED ring?
User avatar
Mark Harris
Posts: 38
Joined: Sat Nov 14, 2015 12:34 am
Location: Calgary, AB

Re: Better Downward Camea

Post by Mark Harris »

assasinsareus wrote:The LED ring also fits onto the camera using double sided foam tape but I need to work on the diffuser. I wonder is there is any way to adjust the brightness of the LED ring?
Use a voltage regulator, switchmode or linear. Then you dont get issues of PWM and frame rates causing weirdness for the vision system :)
assasinsareus
Posts: 22
Joined: Mon Nov 02, 2015 12:43 pm

Re: Better Downward Camea

Post by assasinsareus »

then you dont get issues of PWM and frame rates causing weirdness for the vision system
Good call I hadn't thought about that. Though I can probably clock out PWM at a few hundred KHz which should hopefully work with the cam? I'll have a play :D might need a simple RC low pass filter on the PWM.
mrandt
Posts: 407
Joined: Mon Apr 27, 2015 10:56 am
Location: Stuttgart, Germany

Re: Better Downward Camea

Post by mrandt »

Mark Harris wrote:Use a voltage regulator, switchmode or linear.
Depending on voltage regulator (switchmode) you may still encounter similar issues with rolling shutter effects.

Btw, great explanation of the problem in one picture:
https://pbs.twimg.com/tweet_video/CUXg3o_WIAEElRJ.mp4

Same line-by-line reading of CMOS sensor causes problems if PWM frequency is too low.

I suggest you go for either constant voltage (and make sure power supply does not have high voltage ripple) and current limiting resistors (mind the power dissapation!) or high speed PWM. Minimum frequency depends on resolution (number of lines) and framerate. > 2 kHz seems OK with most cameras.

There are many special LED driver buck switching regulator ICs available which support high speed PWM.

A great multi-vendor selection tool can be found here:
http://www.dcdcselector.com/en/dc-dc-led-driver

Cheers
Malte
User avatar
Mark Harris
Posts: 38
Joined: Sat Nov 14, 2015 12:34 am
Location: Calgary, AB

Re: Better Downward Camea

Post by Mark Harris »

mrandt wrote:
Mark Harris wrote:Use a voltage regulator, switchmode or linear.
Depending on voltage regulator (switchmode) you may still encounter similar issues with rolling shutter effects.
It would have to be a really really bad SMPS to generate flicker. Even a bad chinese ebay SMPS has less than 500mV of voltage ripple, a good one should have well under 100mV - an LED really shouldn't change in brightness that much with that little variation, unless you are driving it JUST past the point it turns on and is therefore most sensitive. Anywhere past half brightness and it really shouldn't show up. PWM on the other hand is switching from 0V to VCC, which means the LED goes from fully on to fully off rather than just a tiny tiny change in the voltage level.
WayOutWest
Posts: 198
Joined: Thu Jul 16, 2015 12:18 am
Location: Washington State, USA

Re: Better Downward Camea

Post by WayOutWest »

mrandt wrote: The CMOS chips in Logitech cams are great and I believe all their HD cams support both MJPEG and H.264 at reasonable frame rates.
Are you sure about H.264? The C270 definitely does not support it. If one of their other cameras does I will definitely upgrade. USB bus isochronous bandwidth is precious.
mrandt wrote: - Also, I wish it would be possible to set aspect ratio, viewport dimensions and scaling for camera pre-processing. Rotating or flipping images might come in handy as well.
Unfortunately although the USB spec has commands for these, I've found that very very few cameras implement them. The C270 and Andonstar definitely do not support hardware scaling or windowing -- there is no way to get them to transmit less than 100% of the visual field over the USB bus. But you can lower the resolution and use MJPEG compression.
mrandt wrote: - Reeza and some people on the forum have also experimented with setting and adjusting exposure, aperture, brightness and white balance for USB cams through software which greatly improved computer vision results.
Seconded. You definitely need manual control of the exposure and gain to get good results. Fortunately nearly all the cameras I've come across so far allow this, but it isn't exposed through most APIs; you need to use libuvc.
- Adam
mrandt
Posts: 407
Joined: Mon Apr 27, 2015 10:56 am
Location: Stuttgart, Germany

Re: Better Downward Camea

Post by mrandt »

Hey Adam,
WayOutWest wrote:
mrandt wrote:I believe all their HD cams support both MJPEG and H.264 at reasonable frame rates.
Are you sure about H.264? The C270 definitely does not support it.
No, the C270 does MJPEG not H.264 but at 720p that still results in OK framerate. Also, for the upcam it is not as important.

The Logitech C920 definetely has H.264 encoder for Full HD (1080p). Downside is that it also has a motorized autofocus - which either would need to be controlled via driver interface (which might be benefifical if using part trays...) or disconnected in hardware after adjusting to desired focal length.
WayOutWest wrote:
mrandt wrote: - Also, I wish it would be possible to set aspect ratio, viewport dimensions and scaling for camera pre-processing. Rotating or flipping images might come in handy as well.
Unfortunately although the USB spec has commands for these, I've found that very very few cameras implement them. The C270 and Andonstar definitely do not support hardware scaling or windowing -- there is no way to get them to transmit less than 100% of the visual field over the USB bus. But you can lower the resolution and use MJPEG compression.
I just tested with VLC - C270 supports different resolutions in driver. Setting lower resolution obviously results in higher framerates and *might* have less noise (I have no way to measure) depending on the way CMOS sensor control is implemented in hardware.

Scaling, cropping, mirroring or rotating the image IMHO is processing that should be done inside LitePlacer software. I envision that to be part of generic camera setup so it should always happen before display in software and any other image manipulation (e.g. for computer vision).
WayOutWest wrote:Seconded. You definitely need manual control of the exposure and gain to get good results. Fortunately nearly all the cameras I've come across so far allow this, but it isn't exposed through most APIs; you need to use libuvc.
Maybe. Whatever API is used to achieve this - user should just be able to configure settings in LitePlacer and be good to go ;-)

Regards
Malte
Post Reply