Poor picture focus / quality

A project log for Low cost / low power sleep / WiFi Camera

Using e.g. ESP32 and cheap camera to make a remote monitoring device that can watch things e.g. meters, gages, etc...

james-newtonJames Newton 01/08/2019 at 04:1711 Comments

Got the TTGO-CAMERA hardware. It works... ish... the picture quality is... less than fantastic. Here is a sample:

Both units have about the same picture quality. If anything, this was the better one. 

I included some objects in the foreground so you can see the focus isn't any better there. 

I'm not at all convinced that lousy focus is going to work for reading even the most bold meters. Anyone have ideas on improving the optics? Lense seem very glued on, not removable. So it would need "corrective lenses" and I'm not an optician.


maciekczwa wrote 02/28/2019 at 10:03 point

Better use esp-who sample - much better quality.

  Are you sure? yes | no

Martin Fasani wrote 01/16/2019 at 18:23 point

I made a case for this TTGO thing. If anyone is interested I will upload it to thingiverse:
I though about adding a motion detector to make a security camera or something alike.

  Are you sure? yes | no

James Newton wrote 01/16/2019 at 19:00 point

I'm VERY interested! Especially if you can add mounting holes in the corners so it can be screwed / strap tied / otherwise mounted to surfaces. 

  Are you sure? yes | no

Martin Fasani wrote 01/16/2019 at 19:11 point

Here you go:

Attention that my 3D skills are so, that I consider a model good enough when I don't have to take the saw and pliers out to make it fit. Be aware ;)

  Are you sure? yes | no

Martin Fasani wrote 01/08/2019 at 22:06 point

Can you show me what code are you using for this ? it’s clearly out of focus but also pixelated. What resolution are you using?

I also got one... will try to hack it when it comes. Bigger ArduCams work better but as you mentioned they are more expensive

Not sure if it’s possible to disable compression but If you look at the lib source they are 3 levels of quality (0 high, 1 default, 2 low) but this cannot be the pixelation reason, it looks like little resolution and stretched

  Are you sure? yes | no

James Newton wrote 01/08/2019 at 22:34 point

The library and example code for the TTGO-CAMERA
It's the "Station-Cam" example code which comes pre-loaded. Looks like it's SVGA or 800x600. And the JPEG quality defaults to 15

So there may be some hope to improve it.

It also turns out the code is perhaps replaceable with better?

  Are you sure? yes | no

Ted Yapo wrote 01/08/2019 at 16:09 point

The knurling on the the lens mount makes it look like it's supposed to be adjustable. I've seen a few cameras where the lens was adjusted then fixed in place with a drop of thread-lock, which could be broken with the proper amount of force. If you're not afraid to accidentally lose one, that might be an option.

If it's just a poor quality lens, adding more optics probably won't get it to 20/20, so replacing it might be the only option.

The other possibility is that what you're seeing are high-compression JPEG artifacts. Is there a way for you to adjust the JPEG quality settings? In fact, looking at it more closely, JPEG blockiness is really apparent, especially on the back wall. Maybe check into this first. It might be a software-only fix.

Or, even better, disable compression entirely.

  Are you sure? yes | no

James Newton wrote 01/08/2019 at 17:31 point

Thanks Ted for all those suggestions. I certainly will try to reduce compression first, as I continue to play around with the code. Honestly, I want to spend the bulk of my time porting my existing esp8266 wifi adapter code over to the esp32 because there are other projects and people waiting on that, so this thing may just go in the box for a while. Once that's ready, I'll integrate the camera code into my ported code, and look at resolution again at that time. Finally, if I need to, I'll try to break the glue free and re-focus, but it looks very solidly glued down; like 2/3 of the circumference is filled. 

Here is my existing code, BTW, so you can see what features it will bring to the project:

  Are you sure? yes | no

Ted Yapo wrote 01/08/2019 at 17:41 point

Nice. I'm going to check out that webserial stuff; it seems pretty handy.

  Are you sure? yes | no

Jarrett wrote 01/08/2019 at 07:21 point

Damn. Well, I appreciate you curing me of my desire to impulse-buy one of those.

  Are you sure? yes | no

James Newton wrote 01/08/2019 at 17:31 point

Not sure anything else is better, but certainly don't bother with this one; try something else.

  Are you sure? yes | no