6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7144
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: New 8MP Camera - Q&A thread

Fri Jul 29, 2016 7:54 pm

And about this 8MP camera....

I know some people want to complain about prices/quality/the colour of USB leads, but please take it into General Discussion, or at least a new thread.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
waveform80
Posts: 303
Joined: Mon Sep 23, 2013 1:28 pm
Location: Manchester, UK

Re: New 8MP Camera - Q&A thread

Sat Jul 30, 2016 3:50 pm

thanasispap wrote:I've read all the previous posts and I can't find out how to take full res. from the camera in a python script.

Sorry for this "silly" question but even when I try to set resolution further from 5MP (1920, 1080) I 've always an error.

p.s. I found the CameraPi lib in python3 folder and as 6by9 said there is a "MAX_RESOLUTION" where I can change to my value, but I don't think its the write thing to do. I've last update on raspi firmware and picamera libs.

p.s. 2. Is there a need to set GPU mem to 256?

Thanks in advance!
Firstly, confirm that you're definitely running an up to date version of picamera using the method in the FAQ. Support for the V2 module was added in 1.11 so if you're on 1.10 or before, you need to upgrade.

Secondly, be aware that picamera defaults to using the same resolution for both captures and preview (equivalent to the "-fp" flag with raspistill). This was primarily for simplicity, but it does cause issues when using the V2 camera module at the maximum resolution. There's a workaround further on in the FAQ.

A quick example of taking a maximum resolution image with the V2 module in picamera 1.11 (or above):

Code: Select all

import picamera
import time

camera = picamera.PiCamera()
camera.resolution = camera.MAX_RESOLUTION
time.sleep(2) # warm up time
camera.capture('foo.jpg')
camera.close()
The MAX_RESOLUTION attribute is adjusted upon camera initialization to match the maximum resolution of the installed module (so it'll be 2592x1944 for a V1 module, and 3240x2464 for a V2 module).

There are cases where an increased gpu_mem setting is required (high resolution MJPEG recordings particularly), but you should be able to capture basic JPEG at max. res with picamera with gpu_mem set to the default of 128 (at least, I can on my Pi 3).

Dave.

thanasispap
Posts: 14
Joined: Thu Jul 28, 2016 2:59 pm

Re: New 8MP Camera - Q&A thread

Sat Jul 30, 2016 7:03 pm

waveform80 wrote:
thanasispap wrote:I've read all the previous posts and I can't find out how to take full res. from the camera in a python script.

Sorry for this "silly" question but even when I try to set resolution further from 5MP (1920, 1080) I 've always an error.

p.s. I found the CameraPi lib in python3 folder and as 6by9 said there is a "MAX_RESOLUTION" where I can change to my value, but I don't think its the write thing to do. I've last update on raspi firmware and picamera libs.

p.s. 2. Is there a need to set GPU mem to 256?

Thanks in advance!
Firstly, confirm that you're definitely running an up to date version of picamera using the method in the FAQ. Support for the V2 module was added in 1.11 so if you're on 1.10 or before, you need to upgrade.

Secondly, be aware that picamera defaults to using the same resolution for both captures and preview (equivalent to the "-fp" flag with raspistill). This was primarily for simplicity, but it does cause issues when using the V2 camera module at the maximum resolution. There's a workaround further on in the FAQ.

A quick example of taking a maximum resolution image with the V2 module in picamera 1.11 (or above):

Code: Select all

import picamera
import time

camera = picamera.PiCamera()
camera.resolution = camera.MAX_RESOLUTION
time.sleep(2) # warm up time
camera.capture('foo.jpg')
camera.close()
The MAX_RESOLUTION attribute is adjusted upon camera initialization to match the maximum resolution of the installed module (so it'll be 2592x1944 for a V1 module, and 3240x2464 for a V2 module).

There are cases where an increased gpu_mem setting is required (high resolution MJPEG recordings particularly), but you should be able to capture basic JPEG at max. res with picamera with gpu_mem set to the default of 128 (at least, I can on my Pi 3).

Dave.

Dave I make again all upgrades/updates on my rpi and it just works. Thanks a lot for your fast and accurate answer!

moritzz06
Posts: 4
Joined: Tue Aug 16, 2016 8:27 pm

Re: New 8MP Camera - Q&A thread

Tue Aug 16, 2016 8:44 pm

Hi,

Are the new raspivid modes, especially the high framerate mode at 720p, only working with the new V2 Board?
I have a V1.3 Cam and are absolutely satisfied with it, but I need higher Framerates. Has anything changed for the V1.3 Cam since the update?
I could buy a V2 Cam, but I need a wide angle lens of at least 120deg FOV..

Regards,
Moritz

User avatar
bazza14
Posts: 65
Joined: Sun Jan 01, 2012 10:05 am

Re: New 8MP Camera - Q&A thread

Sun Aug 21, 2016 4:09 pm

I'm new to this thread after getting a V2 camera that is poorly focused. Will be making me a little spanner to adjust the lens.

Just FYI. High res picture of the camera showing the glue blobs.
https://drive.google.com/open?id=0B7Z_Q ... TJEV0dTV3c

I think this product would be suitable to relock the lens after focusing. Apply with the tip of a needle.
http://uk.farnell.com/electrolube/blr15 ... /dp/521747
LINUX convert since 2003

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7144
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: New 8MP Camera - Q&A thread

Mon Aug 22, 2016 8:39 pm

moritzz06 wrote:Are the new raspivid modes, especially the high framerate mode at 720p, only working with the new V2 Board?
I have a V1.3 Cam and are absolutely satisfied with it, but I need higher Framerates. Has anything changed for the V1.3 Cam since the update?
I could buy a V2 Cam, but I need a wide angle lens of at least 120deg FOV..
Yes, the high frame rate 720P mode is for the V2.1 boards only - the V1.3 module maxes out at VGA resolution at up to 90fps. That's a function of the camera sensor module, so isn't going to change.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

thanasispap
Posts: 14
Joined: Thu Jul 28, 2016 2:59 pm

Re: New 8MP Camera - Q&A thread

Fri Aug 26, 2016 8:40 am

As camera normally operates for some days, suddenly it starts something like "flickering" and emits black frames at 5MP and above resolutions;
flicker.jpg
flicker.jpg (41.27 KiB) Viewed 8493 times
I try to use as simpler script as I could but the camera still plays that way. Here is the script;

Code: Select all

import picamera
import time

camera = picamera.PiCamera()
camera.framerate = 15
camera.resolution = camera.MAX_RESOLUTION
time.sleep(2)
camera.start_preview()
time.sleep(5) 
camera.stop_preview()
camera.close()


Is there any ideas?

Ps. I've overclock the gpu_mem to 256MB
Ps. 2 I try to use another camera V2 and the problem still remains (changed cable also)

User avatar
waveform80
Posts: 303
Joined: Mon Sep 23, 2013 1:28 pm
Location: Manchester, UK

Re: New 8MP Camera - Q&A thread

Fri Aug 26, 2016 8:51 am

thanasispap wrote:As camera normally operates for some days, suddenly it starts something like "flickering" and emits black frames at 5MP and above resolutions;
flicker.jpg
I try to use as simpler script as I could but the camera still plays that way. Here is the script;

Code: Select all

import picamera
import time

camera = picamera.PiCamera()
camera.framerate = 15
camera.resolution = camera.MAX_RESOLUTION
time.sleep(2)
camera.start_preview()
time.sleep(5) 
camera.stop_preview()
camera.close()


Is there any ideas?

Ps. I've overclock the gpu_mem to 256MB
Ps. 2 I try to use another camera V2 and the problem still remains (changed cable also)
You need to drop the preview resolution - have a look at FAQ #15


Dave.

thanasispap
Posts: 14
Joined: Thu Jul 28, 2016 2:59 pm

Re: New 8MP Camera - Q&A thread

Fri Aug 26, 2016 9:05 am

You need to drop the preview resolution - have a look at FAQ #15


Dave.[/quote]

Thanks Dave for your answer!

I have already read this in FAQ and I have 2 questions;

1)The RPi cam. cannot operate real time in 5MP and above from start_preview? If this is true how can I saw this res. before and now I don't?

2)The camera.start_preview(resolution=(1024, 768)) seems that it doesn't supported by the camera's API. http://picamera.readthedocs.io/en/relea ... rt_preview

I tried to run the FAQ script but it returns an error. ("...unexpected keyword 'resolution' argument")

User avatar
waveform80
Posts: 303
Joined: Mon Sep 23, 2013 1:28 pm
Location: Manchester, UK

Re: New 8MP Camera - Q&A thread

Fri Aug 26, 2016 9:18 am

thanasispap wrote:
waveform80 wrote:You need to drop the preview resolution - have a look at FAQ #15


Dave.

I have already read this in FAQ and I have 2 questions;

1)The RPi cam. cannot operate real time in 5MP and above from start_preview? If this is true how can I saw this res. before and now I don't?
One possible explanation is that you weren't using the "real" maximum resolution. Prior to picamera 1.11 being released, the MAX_RESOLUTION value was fixed at (2592, 1944), i.e. the max resolution of the V1 module. Hence even if you had a V2 module attached and set MAX_RESOLUTION you'd still just get 2592x1944; that's simply because picamera <1.11 wasn't V2 module aware.

Since 1.11, when the PiCamera class is first initialized it queries the attached module and re-writes MAX_RESOLUTION from a place-holder value to the actual maximum resolution.
thanasispap wrote:2)The camera.start_preview(resolution=(1024, 768)) seems that it doesn't supported by the camera's API. http://picamera.readthedocs.io/en/relea ... rt_preview
It is, but it's specified as keyword-only parameters and thus winds up in **options. The available options are documented in the PiPreviewRenderer docs which are linked to from start_preview. However, I must admit I could do a better job making it clear what the options are in start_preview's docs themselves, rather than just linking to the renderer class - I'll get that added as a goal for 1.13.

Incidentally, why aren't the parameters declared as keyword-only parameters like so?

Code: Select all

def start_preview(self, *, resolution, layer, alpha, fullscreen, window, crop, rotation, vflip, hflip):
    ...
Because that syntax is specific to Python 3.x and the library (for the time being) needs to be compatible with both Python 2.x and 3.x. Hence, to force the keyword-only specification in both versions, a **kwargs parameter is used. Unfortunately, that's the best I can do while maintaining compatibility. In the dim and distant future when Python 2.x is well and truly dead and buried this should eventually be revised, but Python 2.x is still the default on the vast majority of platforms, so we're not there just yet.

Dave.

thanasispap
Posts: 14
Joined: Thu Jul 28, 2016 2:59 pm

Re: New 8MP Camera - Q&A thread

Fri Aug 26, 2016 9:47 am

One possible explanation is that you weren't using the "real" maximum resolution. Prior to picamera 1.11 being released, the MAX_RESOLUTION value was fixed at (2592, 1944), i.e. the max resolution of the V1 module. Hence even if you had a V2 module attached and set MAX_RESOLUTION you'd still just get 2592x1944; that's simply because picamera <1.11 wasn't V2 module aware.

Since 1.11, when the PiCamera class is first initialized it queries the attached module and re-writes MAX_RESOLUTION from a place-holder value to the actual maximum resolution.
I run;

Code: Select all

>>> from pkg_resources import require
>>> require('picamera')
The result is; [picamera 1.12 (/usr/lib/python2.7/dist-packages)]

So that causes the problem? I see that flickering effect also at 5MP resolution on V2 Camera with manual setting (resolution =(2592, 1944)).

User avatar
waveform80
Posts: 303
Joined: Mon Sep 23, 2013 1:28 pm
Location: Manchester, UK

Re: New 8MP Camera - Q&A thread

Fri Aug 26, 2016 9:53 am

thanasispap wrote:
One possible explanation is that you weren't using the "real" maximum resolution. Prior to picamera 1.11 being released, the MAX_RESOLUTION value was fixed at (2592, 1944), i.e. the max resolution of the V1 module. Hence even if you had a V2 module attached and set MAX_RESOLUTION you'd still just get 2592x1944; that's simply because picamera <1.11 wasn't V2 module aware.

Since 1.11, when the PiCamera class is first initialized it queries the attached module and re-writes MAX_RESOLUTION from a place-holder value to the actual maximum resolution.
I run;

Code: Select all

>>> from pkg_resources import require
>>> require('picamera')
The result is; [picamera 1.12 (/usr/lib/python2.7/dist-packages)]

So that causes the problem? I see that flickering effect also at 5MP resolution on V2 Camera with manual setting (resolution =(2592, 1944)).
You may be running 1.12 now but that doesn't tell us what you were running before or if you've upgraded. Still, that's only a guess on my part - it's the one explanation I can think of off the top of my head.

I can't replicate the flickering at 2592x1944 on my V2 camera module (gpu_mem is at the default of 128 as I typically test with default settings for obvious reasons).

Dave.

thanasispap
Posts: 14
Joined: Thu Jul 28, 2016 2:59 pm

Re: New 8MP Camera - Q&A thread

Fri Aug 26, 2016 10:22 am

You may be running 1.12 now but that doesn't tell us what you were running before or if you've upgraded. Still, that's only a guess on my part - it's the one explanation I can think of off the top of my head.
I think you're right. I update firmware in that time and now I have this problem.
http://picamera.readthedocs.io/en/relea ... tall2.html

I'll try to figure out what's wrong (suppose to downgrade my firmware release to a more stable for picamera?)...

Dave your work is admirable and your help very accurate. Keep on!

rodizio
Posts: 43
Joined: Sat May 07, 2016 2:40 am

Re: New 8MP Camera - Q&A thread

Sun Aug 28, 2016 12:22 pm

I have a question regarding the older V1 camera.

Before I upgraded firmware and userspace stuff for the V2 camera, maximum FPS supported was 49FS at 1296x730 (mode 5), when setting a higher FPS, it would either revert back to 640x480 and scale-up or give an error message (don't remember).

Now it seems that it is working with 60fps when using raspivid -md 5 -fps 60. Is that 'intended' behaviour? I was always under the impression that max. 49fps is some kind of hardware limitation of the V1 cam.

User avatar
waveform80
Posts: 303
Joined: Mon Sep 23, 2013 1:28 pm
Location: Manchester, UK

Re: New 8MP Camera - Q&A thread

Sun Aug 28, 2016 7:02 pm

rodizio wrote:I have a question regarding the older V1 camera.

Before I upgraded firmware and userspace stuff for the V2 camera, maximum FPS supported was 49FS at 1296x730 (mode 5), when setting a higher FPS, it would either revert back to 640x480 and scale-up or give an error message (don't remember).

Now it seems that it is working with 60fps when using raspivid -md 5 -fps 60. Is that 'intended' behaviour? I was always under the impression that max. 49fps is some kind of hardware limitation of the V1 cam.
The various modes (including their framerate ranges) are listed here. 49fps is indeed the limit for the 1296x730 mode on the V1 camera, and 90fps is the overall limit for V1 camera.

When you let the camera auto-select a mode, you can request, say, 1280x720 @60fps and the camera will produce it, but it'll do so by using one of the high framerate VGA modes, with cropping and upscaling. I'm not sure what happens if you force a particular mode and then select a framerate outside its bounds, though.

Dave.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7144
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: New 8MP Camera - Q&A thread

Sun Aug 28, 2016 7:56 pm

waveform80 wrote:When you let the camera auto-select a mode, you can request, say, 1280x720 @60fps and the camera will produce it, but it'll do so by using one of the high framerate VGA modes, with cropping and upscaling. I'm not sure what happens if you force a particular mode and then select a framerate outside its bounds, though
It'll get clipped to the range permitted by the mode.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

rodizio
Posts: 43
Joined: Sat May 07, 2016 2:40 am

Re: New 8MP Camera - Q&A thread

Mon Aug 29, 2016 12:08 pm

It'll get clipped to the range permitted by the mode.
Thanks. I have in memory, that when not forcing the mode, it will revert back to 640x480 and when forcing the mode and setting something over 49fps, it throws some "MMAL ...." error. That's why I hoped it was working with more than 49fps now.

Okay, so my plans to run the cam at the same 60 fps as the monitor are doomed again :D

What is the exact highest framerate, would it be possible to run the cam at let's say 49.5 fps and hope that my monitor which supports 1920x1080 at 50Hz can run with that also?

User avatar
KevinA
Posts: 64
Joined: Tue Oct 27, 2015 3:50 pm
Location: Park Valley, Utah

Re: IMX219 spectral sensitivity curves

Thu Sep 01, 2016 5:37 pm

jbeale wrote:I notice that the IMX219 description http://www.sony.net/Products/SC-HP/new_ ... 219_e.html says it has the same spectral sensitivity characteristics as the IMX111 sensor, which in turn is described here http://www.sony.net/Products/SC-HP/cx_n ... _111pq.pdf including the sensitivity plots, which I have excerpted below (IMX111 / IMX219 is the solid lines). OmniVision never published equivalent data for their OV5647 as far as I know, so for the first time, we actually know this information for a RPi camera. It seems the three colors are normalized separately, so the absolute response, and the sensitivity beyond 400-700 nm is still left as an exercise for the reader.

Image
According to this the sensor shouldn't see IR or above 700nm so what am I missing? How does the NOIR version of the camera work?

User avatar
jbeale
Posts: 3476
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: New 8MP Camera - Q&A thread

Thu Sep 01, 2016 6:49 pm

That chart does not show the sensor's response longer than 700 nm, so based only on that chart, you don't know what the IR response is. But from charts published for other CMOS sensors, we see that a response that drops off smoothly from 700 nm and reaches near zero around 1050 nm or so. There is still a usable response left at 850 nm where IR security lights are commonly run. It is reasonable to guess the RPi camera behaves in a similar way.

Below is a graph for a Sony Exmor IMX224 CMOS sensor. You will note that around 800 nm the Red, Green, and Blue (Bayer filter) color dyes become transparent and all channels follow the response of the CMOS itself. Chart below taken from http://www.altairastro.com/Altair-GPCAM ... amera.html
IMX224-spectrum.jpg
IMX224 Spectral Response
IMX224-spectrum.jpg (61.39 KiB) Viewed 7661 times

image37
Posts: 1
Joined: Thu Sep 01, 2016 5:07 pm
Contact: Website

Re: New 8MP Camera - Q&A thread

Thu Sep 01, 2016 6:56 pm

thanks

moritzz06
Posts: 4
Joined: Tue Aug 16, 2016 8:27 pm

Re: New 8MP Camera - Q&A thread

Wed Sep 07, 2016 4:57 pm

I just bought a RPi3 with the V2.1 Cam.
I tried to get the cam working with 720p 120fps, but I "only" get 90fps out of it.
Did I miss a special setting or is it just not working right now?
I overclocked the Pi, but with no result.

Regards,
Jan

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7144
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: New 8MP Camera - Q&A thread

Wed Sep 07, 2016 7:02 pm

moritzz06 wrote:I just bought a RPi3 with the V2.1 Cam.
I tried to get the cam working with 720p 120fps, but I "only" get 90fps out of it.
Did I miss a special setting or is it just not working right now?
I overclocked the Pi, but with no result.
A few more details of what you've tried would be useful.
What overclocking settings?
What command line to try capturing at 120fps?
Is it a genuine V2.1 camera? A company did flog an OV5647 (V1 sensor) camera under the name Pi Camera V2.0. The EXIF data from a JPEG capture, or otherwise querying the camera_info component (see raspistill code) is the most reliable answer.
I haven't tried this recently, but I thought people had achieved almost 720P120 with a hefty overclock. It'd be on this thread if anywhere, but I haven't got time right now to check back through it.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

moritzz06
Posts: 4
Joined: Tue Aug 16, 2016 8:27 pm

Re: New 8MP Camera - Q&A thread

Thu Sep 08, 2016 8:30 pm

Thats my raspivid code:

Code: Select all

raspivid -w 1280 -h 720 -fps 120 -b 6000000 -g 5 -t 0 -vf -hf -n -fl -ih -pf high -ex fixedfps -awb horizon -o
And these are my overclocking settings:
gpu_mem=400
arm_freq=1350
over_voltage=5
sdram_freq=500
core_freq=500
gpu_freq=450

If I start it like this, I get 90fps. It seems raspivid isn't even trying to reach 120fps.

Thank you,
Jan

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7144
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: New 8MP Camera - Q&A thread

Thu Sep 08, 2016 9:38 pm

How are you determining that it isn't exceeding 90fps? You don't appear to be using the "-pts <filename>" option to save the buffer timestamps out which is the easiest way to confirm the frame rate.
I'd also suggest you drop -ih and -g 5 for initial tests - you'll be crippling the codec by asking for 720P120 in 6MB/s with an I-frame every 5 frames. Do remember that dropping frames totally is a valid rate control approach for extreme bitrate overshoots.
And -fl to force a flush after every write will be crippling the file system.

You also haven't confirmed that this is definitely a V2.1 camera module. OV5647 (V1.3) will never exceed 90fps and would explain your observations.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

thanasispap
Posts: 14
Joined: Thu Jul 28, 2016 2:59 pm

Re: New 8MP Camera - Q&A thread

Mon Sep 12, 2016 9:03 am

Hi,

I want to ask whats the process for upscaling/downscaling to the required resolution (binning I suppose but 2x2 or what?).
I have noticed that when I change resolution to 640x480 the full FoV remains.

I read the docs, but my questions still remains...
(http://picamera.readthedocs.io/en/relea ... mera-modes)

Return to “Camera board”