Raspberry Pi Autofocus Camera & libcamera

Rek XIX
40 followers
11 Video Views·Oct 31, 2022
Raspberry Pi Autofocus Camera & libcamera
Today in the workshop we'll take a look at an autofocus camera for the Raspberry Pi.
We'll see how to use this camera to capture pictures and video,
and we'll test the quality and capabilities of this inexpensive device.
We'll also use LibCamera to stream video to a Linux workstation.
It's coming into focus today, so welcome to the workshop.
Hello and welcome to the workshop, and today we are going to be looking at yet
another Raspberry Pi camera.
This one though has a feature that we haven't seen in any previous Pi cameras,
and that is the ability to autofocus,
and of course that could open up a number of interesting applications for us.
Now another thing about this camera is that it has the same resolution
as the Raspberry Pi high quality camera,
yet it is the same form factor and the same price as the Raspberry Pi version 2 camera,
so it's definitely a piece of hardware we're going to want to examine a bit further.
Now before we get started, I want to let you know that this camera is just going on sale right now.
It's been on a Kickstarter campaign since November,
and Arducam, who are the manufacturers of this camera,
were giving out samples of the camera, and I received one of the samples.
So this is an early version of the camera.
When you're watching this later there may be some changes to it,
but I believe this is actually what you're going to get in the production version.
And so before we begin, let's take a look at what it takes to add autofocus to a Raspberry Pi camera.
The Arducam autofocus camera is a 16 megapixel Raspberry Pi compatible camera.
It has an identical form factor to the standard Raspberry Pi version 1 and version 2 cameras,
so it can be mounted anywhere that these cameras can be used.
This camera uses a Sony IMX519 image sensor.
It has a resolution of 4656 by 3496 pixels,
which is identical to the resolution of the Raspberry Pi high quality camera.
It's capable of 1080p 30 frame per second and 720p 60 frame per second video.
The camera also includes a case with a quarter inch thread
for mounting on a standard photographic tripod.
As with all other Raspberry Pi cameras, this camera connects to the CSI camera port,
which is available on all modern Raspberry Pis.
An autofocus camera system requires three main components.
An image sensor, a focus motor to move the lens of the image sensor,
and a control system to control the movement of the focus motor.
When building a camera for the Raspberry Pi,
one needs to determine how they can control the focus motor without any additional connections.
In order to figure this out, let's take a look at the only connection we have to the camera,
which is the CSI camera cable.
This is a 15 pin ribbon cable that has the following pinouts.
As it turns out, there are a couple of pins that we could use to control our focus motor.
The I2C interface on the CSI cable is normally disabled,
as most cameras don't make use of it.
This is an independent I2C bus from the I2C buses that are included on the Raspberry Pi GPIO.
This interface can be enabled within the config.txt file,
which is in the boot directory of your Raspberry Pi operating system.
In our application, we can use this I2C bus to control the position of the focus motor.
We could use this capability to build a software controlled focus application,
allowing us to focus the camera without actually physically touching the lens.
Now to add autofocus capability,
we can choose through several different autofocus methods that are commonly used with modern cameras.
The phase detection method is commonly used on DSLR and other advanced cameras.
It breaks the image into multiple images,
and then compares the phase differences between them.
Many modern cameras also use the assist lamp method.
This uses an infrared LED or laser to measure the distance to the subject
and determine the lens position.
Another autofocus method is contrast detection.
This detects the differences between individual pixels,
and maximizes these differences in order to focus the object.
The Raspberry Pi autofocus camera uses the contrast detection method,
as it does not require any additional sensors or dividing of the image.
The OpenCV library, which is an open source computer vision library,
is used to implement the contrast detection in the Raspberry Pi autofocus camera.
So now that we know a little bit more about the autofocus method,
let's go and take a look at our Raspberry Pi autofocus camera.
Now here's the Arducam autofocus camera,
and I've got it along with a couple of other Raspberry Pi cameras.
The original camera, the 5 megapixel one, and the 8 megapixel version 2 camera.
And I just brought these other cameras here so you could see a size comparison.
And as it is, this camera is identical in size.
It'll mount in the same mounting holes as the original Raspberry Pi camera.
So if you have an existing holder for your camera,
you can substitute this one.
It also comes with this plastic mount that it's attached to right now.
And if you look at the back of the mount, they've got a very nice feature.
They've got a quarter inch thread over here so that you can mount it onto a tripod.
Now one thing I found about this thread, however, is it doesn't go that deep.
And so with the tripods that I've been using,
I had to insert a washer between the tripod and the camera mount
in order to get the thing to mount securely.
But otherwise, it's a very nice feature.
It also comes with a plastic cover that you can snap onto it like this.
And with this cover, it weatherproofs the camera very, very nicely.
So if you're using this for an outdoor application, that's a really handy thing.
Otherwise, the only thing that's packaged with the camera
is this instruction manual over here.
And it's not much of an instruction manual.
It just shows you how to plug the camera in.
And then it sends you off to a PDF document and a website
that you can get some more information about the camera on.
But there you go, the Raspberry Pi autofocus camera from Arducam.
Now in our previous work with Raspberry Pi cameras,
we made use of a camera stack called RasPi Still.
RasPi Still allows you to use the command line on the Raspberry Pi.
And it lets you do things like take still pictures and use it for video
and also manipulate a number of the camera parameters.
While RasPi Still has now been replaced with another open source camera stack called LibCamera.
Now LibCamera can do everything that RasPi Still did,
plus it has a number of additional features and improvements.
So before we start working with our autofocus camera,
let's take a quick look at some of the features of LibCamera.
LibCamera is an open source camera stack.
It runs on Linux, Android, and on Chrome OS.
LibCamera has been designed to control embedded camera hardware.
The hardware manufacturer will provide a custom pipeline handler.
In this case, this has been provided by Raspberry Pi.
LibCamera supports all of the Raspberry Pi camera modules.
You can also add custom camera modules to LibCamera,
as Arducam has for their autofocus camera.
Raspberry Pi has provided a number of LibCamera apps.
These apps emulate the legacy camera stack on the Raspberry Pi.
Specifically, they emulate RasPi Still and RasPi Vid,
allowing you to use your older commands with LibCamera.
These can be extended as the source code for LibCamera apps
is open source and is completely available.
Here are the LibCamera apps provided by Raspberry Pi.
LibCamera Hello gives you a preview of the camera module.
LibCamera JPEG is for capturing still images.
The LibCamera Still has all the features of RasPi Still,
while LibCamera Vid has all of the features of RasPi Vid.
LibCamera Raw gets raw frames from the image sensor for advanced processing.
And you can use LibCamera Detect with TensorFlow to capture a JPEG
when a specified object is detected.
Notice that this last one requires a build.
So now let's put LibCamera to use with the Raspberry Pi autofocus camera.
Now, before we start using our autofocus camera,
we're going to need to install a bit of software onto our Raspberry Pi.
This camera is part of Arducam's Pi Variety series,
and they have an installation program
that also installs a number of apps that we can make use of.
In addition, we're also going to need to install a driver
to work with this camera.
So let's go and fire up a Raspberry Pi
with the latest version of the Raspberry Pi operating system,
open up a terminal,
and install the software we need for our autofocus camera.
Now, unlike other Raspberry Pi cameras,
which are essentially plug and play,
you're going to need to install some software
in order to get the Arducam autofocus camera working.
And the first thing you're going to need to do
is to install some shell scripts from Arducam's Pi Variety packages.
So I've got the command over here to do that,
to get them from GitHub.
I'm going to hit enter right now and install these.
And they've been saved, so it's a pretty quick installation.
Now you need to give permission to the installation script
in order to allow it to execute,
and we do that with a chmod command.
Now, after we've done the permissions,
it's standard procedure to do an update onto your Raspberry Pi.
Okay, now we can start installing the actual packages themselves.
The first one we want to do is install the libcamera-dev package.
And now we need to install some modified versions
of the libcamera-apps package.
The easiest way to type that in is to use your arrow key
to get the last command,
and change the underscore dev to underscore apps.
Next, we'll need to install a kernel driver for the camera.
Again, I'm going to use my up arrow to get the last command.
I have to go back a little bit more though this time.
And it's the imx519 kernel driver.
And after doing this part of the installation,
you're going to want to hit yes to reboot your Raspberry Pi.
And we're almost done.
Now, the final step in installing the Arducam auto focus camera software
is to install an application that allows you to do a manual focus.
And I'll be demonstrating that application in a little bit.
So let's hit the enter key right now and do that.
And we're done.
And we've completed the installation of the Arducam auto focus camera software
on the Raspberry Pi.
Okay, I've got my Raspberry Pi auto focus camera hooked to the Raspberry Pi.
And it is aimed right now at the back of my workbench.
And we've got the command line open.
And we're going to start using libcamera
to take a few still pictures or to display a few still pictures as well.
Now, the very first thing you can do with libcamera,
just to make certain that everything is working,
is just do the libcamera hello.
So let's type that in.
And I'll hit enter.
And as you can see, I've got an image.
And it's a live image of what's on my workbench.
And it goes up for a few seconds.
And it comes back down.
Now, you'll probably notice that image was fairly small.
And that's not libcamera's fault.
The fact is that I'm using a 4K video display.
And so it appears pretty small.
And it's probably hard for you to see.
But we can do something about that.
I'll do libcamera slash hello.
And I'm going to add one more parameter to it.
I'm going to add a dash f.
And this should make it go full screen.
So let's try that again.
And there we are, a full screen of the back of my workbench.
Okay, now hello is just basically a demo program.
And you can use some of the other libcamera applications
in order to do things like save jpegs, et cetera.
So let's try this right now with libcam slash jpeg.
Now for this, we need to add a couple of parameters.
We need to tell it where we want our jpeg file to be saved.
So we do a dash o.
And that means output.
And then the name of the file.
So I'm going to call this workbench.
And so that should save a file called workbench.jpeg.
So let's just enter that.
And it's captured the still image.
So we can go and take a look at that image now.
If I open up my file manager.
And here's workbench.jpeg.
And there we go.
There's a lovely picture of the back of my workbench.
So we can use workbench.jpeg in order to do that.
Now, another way that we could have done that
is with libcamera slash still.
And that is the equivalent of raspi still.
The commands that were valid on raspi still
are all valid on libcamera slash still.
So let's try that.
And let's just do a help right now
just to see what kind of parameters we have over here.
And so as you can see,
there is a huge list of parameters that we have
that we can add to libcamera slash still.
And there's all sorts of parameters.
We can specify the width.
We can specify timeouts, et cetera.
We can specify exposures.
There's a lot of things that we can do over here.
So let's do...
And the slash t parameter is a timeout.
So how long is this going to stay on the screen?
And it's in milliseconds.
So this should produce our image for four seconds.
Now, if you want to make the image
stay up there permanently,
you can change that parameter to zero.
Now the image is up there basically forever.
I can use that to position my camera if I wanted to.
And it's not going to go away
until I close the window over here.
And you can also combine libcamera slash still
with an output parameter.
So let's just do a t 2000 maybe for two seconds
and then a slash o and we'll make it.
And we'll also put our slash f in here
to make this go full screen.
So this command should display in full screen for two seconds
and then take a picture called test2.jpg.
So here we are full screen and it's still image captured.
You can go back into our file manager
and there's test2.jpg.
And there you go.
So by using libcamera,
it is quite easy to grab images
from the Raspberry Pi autofocus camera
or indeed from any Raspberry Pi camera.
Now in this demonstration,
I'm going to show you how you can manually focus the camera.
Now you'll notice I've already opened up a camera window
and it's live right now.
And it is a bit out of focus as we can see as well.
So I've opened a second terminal window
and in here I'm going to change to a directory
in our Ducam Pivotry V4 L2 driver
slash focus directory on the Raspberry Pi.
So I'm going to enter that first.
And now I'm in that directory
and I'm going to run a Python 3 script
called focuser example.
And it's got a couple of parameters
after it as well.
And so I'm going to enter that right now.
And it brings me up a window
where I can use a key press
and now I can use my up and down arrow.
So I'm going to move the up arrow
and if you watch the image,
I can bring it into focus,
bring it out of focus
because I've gone too high.
And so I can go up and down
and I can manually focus my image.
And so this is a way that you can do a manual focus
on the RDCAM autofocus camera.
Now, of course, the big feature of this camera
is the fact that it's capable of autofocus
and it's very easy to add that to libcamera still.
All we need to do
is do the dash dash autofocus parameter
and it will do an autofocus when it first starts.
Again, I've added the dash F parameter
so that it can display on full screen.
And so what I'm going to do now
is hit enter over here.
And you'll notice it's focused
right on the RDCAM manual
that I'm holding in front of the camera
and that my background is now out of focus.
And so we can close that
and we'll try it again just with the background.
And now it's focused onto my background.
So autofocus works when it first comes on.
However, there's no way at the moment
to autofocus it after it has come on.
However, you can do that
if you add another parameter.
And so let's bring that back up
and add one more parameter.
I added the dash dash key press.
Now what that will do
is it will allow me to use my terminal
to enter a letter F.
You have to put an F in and then hit enter
and it can refocus the camera.
So let's just enter this right now.
Once again, you can see
it's focused on my background.
Now we need to get the terminal here.
And of course, with this being
in the full screen mode,
it's a little bit awkward,
but I'll put it down over here.
I'll get my cursor down here.
I'm going to put a letter F in
and I'll hold this in front of the camera
and we'll press enter.
Now, as you can see, it focused on it
and now my background is out of focus.
So I can put another letter F in there
and press enter.
And now it is focused on the background.
So by putting that dash dash
key press parameter in there,
I'm able to use the keyboard
to refocus the camera.
Now the autofocus drives a motor
which moves the camera lens in and out.
And if you observe the lens
while you're doing an autofocus,
you can actually see this operation.
So right now I've got it at minimum focal
and I'm going to move it up to maximum
and you can see the camera lens move out
and I'll move it back down to minimum again.
And there you go.
So you can actually observe
the physical operation of the lens
moving in and out
when you're performing an autofocus.
So now that we've seen
how the autofocus camera
works with still pictures,
the natural next step
is to see how it works with video.
Now, one thing I've got to tell you right now
that'll probably be a bit of a disappointment.
I know it was a disappointment to me
is that in video operation,
it does not perform continuous autofocus.
At least this current iteration
of the camera does not do that.
It just performs the autofocus operation once.
Nonetheless, it is still useful for video.
So let's go and see how we can do video
with our autofocus camera.
Now using the Raspberry Pi autofocus camera
or for that matter,
any camera with libcamera
is pretty simple
because we can use libcamera slash vid
and that pretty well emulates
the Raspi vid command.
Now I say pretty well emulates
because there is a demo
that is available with Raspi vid
that doesn't seem to be available with this.
But otherwise, there are a lot of things
you can do with libcamera slash vid
and I'll show you this.
We'll do a help over here
to demonstrate the commands.
Let me just maximize this
so it's actually more readable.
And as you can see,
there are just a ton of parameters
that you can add to libcamera slash vid.
Like there are parameters
to dictate the width
and the height of the output video.
The default is an HD video at 1920 by 1080.
You can do the timeout
to see how long the video displays
on the screen again.
You can specify an output file.
We'll do that in a moment
to record a video.
You can specify how the preview works
and the preview can also have
some arguments on it
so that you can give it
the width and the height.
So for example,
the example they show here,
00, that's the coordinates on the screen
that it's going to be at 640 by 480.
So you can set the size
of your preview window.
Again, a dash F for the full screen
like we've been doing before.
There are all sorts of things
you can rotate and flip the video.
You can set the shutter speed.
You can set the gain.
You can set the exposure,
the metering,
the auto white balance algorithm.
There is so much over here
that you can do with the video.
So as you can see,
there is a lot you can do
with libcamera slash vid.
So let's just,
didn't mean to close that,
just meant to minimize it,
but I'm not good at minimizing.
There we go.
All right, so let's do,
and that should just give us
a video screen for about 10 seconds.
And so we'll enter that.
And there we have a video screen
for about 10 seconds,
although it's not particularly in focus
at the present moment.
Now, remember, we aren't recording that.
You'll notice the top of the display,
if you'd saw that,
gives you the parameters of the video,
the frames per second,
the exposure, et cetera.
And you could even,
as you saw on the help screen,
dictate which parameters
you want to see over there.
So let's just do the same thing again,
only this time,
let's put autofocus on it.
And now it focused in
at the very beginning of the video,
but unfortunately,
it's not a continuous autofocus.
So if I were to bring something up
in front of it right now,
it isn't going to focus on it.
Now, we can also, of course,
do a video and record it.
So let's do a 10 second video
and specify an output file.
And we'll do this as test.h264.
And that's the file format.
Oops, I did a comma there,
meant to do a period, excuse me.
And that's the file format
that we use with these videos, h264.
And you can display an h264 video
on some video players like VLC
and the video player that comes
with the Raspberry Pi will display it.
You can also convert that
to another file format.
And if you want some information about that,
the previous video I did
on Raspberry Pi cameras
gives you a lot of details
about converting the video,
as does the article that accompanies it.
And I'll leave a link in the article
that accompanies this video
so that you can find
all of that information.
So let's just enter that.
And so we auto-focused
and we're filming a wonderful video
of the back of my workbench,
which is going to go for 10 seconds.
And then we can go up to our file manager
and we can see
that we have a video over here.
So I can open it up.
Let's just play that a bit bigger.
And there we go.
And there's a video
of the back of my workbench.
I probably won't be publishing
that one on YouTube,
but it does demonstrate
indeed the video capabilities
of libcamera slash vid
used in this case
with the RDCAM autofocus camera.
Now, although the camera
won't do continuous autofocus,
it is possible to do
a manual focus continuously
while you are filming videos.
So what I've done
for this demonstration
is I've done a libcamera slash vid
with a timeout of zero.
And you can see the window over here
with the view of my workbench on it.
And as I move around,
you'll see everything's
fairly out of focus.
And then I ran the same script
I showed you before,
the Python script
that allows you to do focus.
And so I am able to focus the video.
And so I could move around
and change the focus on this
if I wanted to,
to get a little bit better.
And I can manually adjust my focus.
And so while that isn't the same
as a full fledged
automatic continuous autofocus,
it does prove that you can indeed focus
while you are filming a video.
Now, I'm just displaying this right now,
but it could easily have been
recording it onto a video file
as well, an H.264 file.
So it makes me think
that it would be possible
programmatically for you
to eventually emulate
a continuous autofocus.
But at the moment,
I really don't know how to do that.
But I'm hopeful that someday
someone will come up with that
because that would indeed
be a wonderful feature
to have on this autofocus camera.
Now, streaming video
is a great application
for a Raspberry Pi camera.
You could use streaming video
for a number of different applications,
things like watching the progress
of a 3D print
or security applications,
or perhaps watching the birds
in your bird feeder.
And LibCamera makes it very easy
to stream video with this
or any other Raspberry Pi camera.
So let's go and take a look
at exactly how we do that.
Now, there are a number of methods
you could use to stream video
with a Raspberry Pi,
and some are better than others.
There's a very popular one
called GStreamer,
but you can actually do this
through LibCamera-vid,
and that's a pretty handy feature.
However, you're planning
to stream your video,
you're going to need
the IP address of your Raspberry Pi
so you can find it on your network.
So you can use an ifconfig for that.
An ifconfig will print back
a bunch of information
about the network side
of your Raspberry Pi,
and you'll notice there's
three IP addresses on here.
Now, this one you can eliminate.
This is what's called
the loopback address,
and pretty well every computer
has a loopback address
of 127.0.0.1,
and the loopback address
is just used for diagnostic purposes.
Packets sent to that address
don't even leave your Ethernet adapter.
They just turn around and go back in.
So I've got two other addresses here.
In my case, I've got 192.168.39.119
and one up here 192.168.1.113.
The reason I have two IP addresses
is that I have both Wi-Fi
and an Ethernet cable
connected to my Raspberry Pi.
If you're only using just the Ethernet
or just the Wi-Fi,
you'll only have one address.
Now, I happen to know
that the .1.113 is the one
that is on my Ethernet cable
because my Wi-Fi is on a different subnet.
The .39.1 is the Wi-Fi.
So I'm going to note this address
because I'm going to need it
on the receiving side
and it's actually copied it down over here.
I didn't really want to do that,
so let's just get rid of that.
Okay, so we can use libcamera-vid
in order to do this.
So let's do libcamera-vid
and then we'll do a timeout of zero.
And then we'll do the inline parameter
and then after that,
we'll do a listen parameter
and we'll specify an output with a dash o.
That's not a zero, it's an o.
And the output is going to be
tcp colon slash slash 0.0.0.0
which is the broadcast address
and then we'll give it a port number
with a colon and an 8888
and we'll hit enter.
And you won't see anything happening
on the screen here
until you've connected
the other end to the stream
and at that point,
you will see your video here on the screen.
So let's go to the other end
which is going to be an Ubuntu workstation
running VLC
and see if we can pick up on this stream.
I'm on my Ubuntu workstation
and I'm using VLC media player
to pick up the stream
and so I've opened VLC.
I'm going to go into media
and open network stream
and I need to give it an address.
Now you'll notice
I've already typed it in here
but it's tcp slash h264 colon slash slash
and then the IP address
which in my case is 192.168.1.113
and then the port number
which is a colon 8888.
So I'll hit play
and there we have my stream
and I can move around
and I can get the streaming video.
Now there is actually
quite a bit of latency over here
so it's not a perfect stream
but it certainly is a very simple way
of using libcamera
with a Raspberry Pi camera
in this case the autofocus camera
to do streaming video.
Now autofocus aside
this camera also has
some pretty impressive specifications
and I wanted to see
how it stacked up
against some other Raspberry Pi cameras.
So that's exactly
what I'm going to do right now.
I'm going to compare this camera
to a few other Raspberry Pi cameras.
So let's get going.
Now here are the cameras
that we're going to be using
for our camera test
along with some of the equipment
that we're going to be using
in order to perform the test.
Now here of course
we have the 16 megapixel
Arducam autofocus camera
with its shell on.
Here we have a Raspberry Pi
version 2 camera.
Here's the version 1.3 camera
and here is a Raspberry Pi
high quality camera
along with the 16 millimeter lens on it.
Now in addition to all of that
I've got some other equipment.
I've got a rather long ribbon cable
that I'm going to be using
for testing all of the cameras.
I've got a tripod over here
and this tripod can be adjusted
in a number of directions
which is really good
because although the Raspberry Pi camera
from Arducam
the autofocus camera
does come with a tripod thread
it's on the back of the camera
whereas it really should be
angled 90 degrees
and so this way I can take the tripod
and aim it down and put it on here.
Another thing I mentioned
about this camera thread
is that it isn't deep enough
and so the camera will spin on the thread
and in order to resolve that
I've got a washer over here
that I'm just going to put on
in order to alleviate that problem.
Now the Raspberry Pi
high quality camera
of course has a tripod thread
mounted in the correct place
and it can just simply
be screwed onto the tripod.
These ones don't come with a thread
but for that I've made this little adapter
I actually made this a while ago
for doing some other tests
and it allows me to
mount the Raspberry Pi camera
onto the adapter here
I just have to screw it onto here
and I've got a quarter inch thread
on the bottom of this
and I just made this out of a piece of perf board
and an old GoPro adapter
which I don't need
because I don't actually own a GoPro
and I've got a test target over here
now this is a test target
used for photography
it's got a number of colors on this side
and on this side
it's got a gray scale
and in order to make this accurate
I'm lighting everything right now
with a number of 5600 degree Kelvin video lights
so I'm not using the workshop lights
for all of this
so we're going to test
each of these cameras out
and compare their performance
now obviously I would expect this camera
to outdo the version one
and version two cameras
but it'll be really interesting
to see how it compares
to the Raspberry Pi high quality camera
of course I've got a very good lens on this
and this might give this camera an advantage
another advantage this camera may have
is the size of its sensor
but we won't really know until we try
so I'm going to do a couple of video tests
and a couple of photography tests
and we'll see how this all compares
to test the four cameras for still images
I simply used libcamera-still
but there are a few things
that you should make note of
before you look at these images
the first one and most important one
is that the colors that you see on YouTube
don't necessarily represent
the original color of the video
this is because YouTube distorts the colors
for most of my videos
I use something called an LUT
or lookup table
that can compensate for that
but I'm not applying the lookup table
to these images
as it does unnecessarily distort them
having said that
let's take a look at the images
from the four different cameras
the Raspberry Pi v1 camera
actually doesn't produce that bad a picture
when you consider it only has
a five megapixel sensor
now as this is a fixed focus camera
I had to physically move it
until it could get the picture
relatively in focus
so it may not be perfect
but all in all it isn't that bad
the grayscale performance of the camera
was also pretty good
pretty impressive again
for the original v1 camera
now I was rather disappointed
with the image
on the Raspberry Pi camera v2
but one thing to note
is that I have the noIR
or noir version of the camera
this is the version
that does not have an infrared filter
and so I believe the pinkish hue
that you see on the image
may be a result
of the lack of an IR filter
you can really see the pinkish hue
on the grayscale picture
in fact on the edges of the picture
it's quite predominant
so in actual fact
when you look at it
the Raspberry Pi v1 camera
gave me better performance
than the v2 camera
remember the v2 camera
costs the same amount of money
as the Arducam autofocus camera
the colors that the Raspberry Pi
high quality camera
gave off were quite impressive
and that's not too surprising
it's the most expensive camera
of the one that I reviewed
especially when you add
the cost of the lens
the lens also gives it
quite a different focal length
from the other three cameras
so I had to move it back quite a bit
so that is reflected a bit on the image
but all in all
it has very good color performance
the grayscale performance
of the high quality camera
was also very good
and here's the Arducam autofocus camera
which gives a very impressive picture
not surprising
considering its 16 megapixel sensor
but a bit surprising
considering the fact
that it doesn't have as good a lens
as the high quality camera
the grayscale performance
of the autofocus camera
was also quite good
now here's a side-by-side comparison
of the Raspberry Pi high quality camera
and the Arducam autofocus camera
both images are quite good
and the same goes
for the grayscale performance
it's actually very difficult
to see a difference
between the two different cameras
so all in all
I'd say the Arducam autofocus camera
in these very simple tests
performed just as well
as the much more expensive
Raspberry Pi high quality camera
for the video test
I used the libcamera
slash vid application
setting the width to 1920
and the height to 1080
I then used the mp4 box utility
at the command line
to convert the files
into an mp4 video
now note that during the conversion
some of the quality
would have been lost
and also keep in mind
what I said earlier
about the color distortion
that YouTube imposes on videos
the Raspberry Pi version 1 camera
actually produced reasonable video
it's certainly not good enough video
to use let's say for a YouTube video
but for robotics
and security applications
the video was just fine
once again I received
a lot of color distortion
on the Raspberry Pi version 2 camera
toward the red end of the spectrum
and again I suspect
that this is because
I'm using the no IR version
of this camera
the Raspberry Pi high quality camera
with the 16 millimeter lens
produced quite good video
in fact this would even be passable
for something like a YouTube video
and I also received very good results
from the Arducam autofocus camera
while it doesn't have
the same high quality lens
it still produced very good
and very sharp video
and that completes our video tests
now I think you'll agree with me
that the Arducam autofocus camera
is a pretty impressive device
especially for the price
now the biggest limitation
I found with this camera
is its lack of continuous autofocus
in video operation
but remember the focus motor
is being driven through software
and so I'm sure somebody
will eventually figure out
how we can continually focus in video
even if they don't
it's a great little camera for the price
now if you want some more information
about this camera
or if you want to grab a cheat sheet
that has all of those cryptic commands
I use to get it to work
you'll find all of that in the article
that accompanies this video
and there's a link to that article
right below the video
another thing you might want to do
is sign up for my newsletter
my newsletter is not a sales letter
by any means
it's just something I periodically send out
to let you know what's going on
here in the workshop
and it's free to join
there's also a link below the video to that
if you want to discuss this camera
the best place to do that of course
is the DroneBot Workshop Forum
and you can become a forum member for free
and there's details on doing that
below the video
and once you're on the forum
you can discuss this
and other electronic projects
with all sorts of like-minded individuals
and finally if you haven't yet
please consider subscribing
to the YouTube channel
all you need to do
is click on that subscribe button
and also on the bell notification
and that way as long as you have
notifications enabled on YouTube
you'll get notified every time
that I make a new video
so until we meet the next time
please take good care of yourself
please stay safe out there
and I'll see you soon here
in the DroneBot Workshop
Goodbye for now.
