16-bit -> 10-bit return image (Basler A601f)

63 views
Skip to first unread message

Ryan

unread,
Apr 25, 2012, 9:51:30 PM4/25/12
to pydc1394
Hi Malte,
Hi,

Hoping this group is still active. I came upon an old (2010) thread
here, where Malte had an issue getting pydc to return 14-bit images
for his AVT camera. Has this been resolved?

-- let me say here: great interface to 1394 cameras. thanks for the
hard work.

I have a Basler A601f (monochrome) camera that has 10-bit capability
(it's 16-bits but only 10-bits are effective). So, an image range from
0-1023. But both coriander and pydc are returning 16-bit images with
image ranges from ~8000-12000 (in intensity), but of course a maximum
value of 65535.

Do you know how I can get the "real" intensity values from these
images?

The result of cam0.dtype for me (running the open_camera.py example)
is also ">u2", meaning big-endian uint16. I know my camera (and
perhaps Malte's AVT) are supposed to return little-endian values,
according to the manual.

Note, I had to make a change to the script for my camera to run,
successfully. First, I called cam0.mode = "FORMAT7_0". (Although, this
only worked if I first went into coriander and set the depth to 16bpp,
then ran open_camera.py, as did Malte). And I also had to comment out
the line in camera.py (line 594 I believe) that sets the framerate to
"auto" (self.framerate.mode = "auto") because it would give me a
"Invalid frame rate" warning and wrong image array shape error.

Many thanks in advance,

Ryan

M.W.

unread,
Apr 26, 2012, 5:45:38 AM4/26/12
to pydc...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I just noticed, that you wrote to the group as well, so I reply to the
group, so that the rest can chime in.

1) I am not sure what is happening with your pictures. Maybe upload them
somewhere and post links here, so others can find a reason for those
results. Maybe try dividing by 128? I am not sure.

2) I remember that I had some problems with that. I actually had to add
some code to pydc to fully control the exposure time, but that was
pretty specific to my AVT camera:
https://groups.google.com/group/pydc1394/browse_thread/thread/c9f55fae1786c2e3?hl=de
To control the shutter, I use:

#hand over the new shuttervalue to the cam0 object
cam0.shutter.val = shuttervalue

in my code. "shuttervalue" is calculated for the AVT

shuttervalue = int(((1 / fps) - offset) / timeBase)

It will be different for your camera, as yours might not use timebase
values to calculate shutter values. This should be found in the manual
somewhere, the one from the AVT was pretty good.

Yours,
Malte

>
> Hi Malte -- thanks for the quick reply.
> So, dividing by 64 sort of puts the range in the ballpark. But not quite.
> Saturated pixels are 1020, not 1023.
>
> 1)
> But more importantly, the image as a whole
> is very messy. I've attached two FITS images, one is from letting coriander
> set
> the depth to 8bpp ("room8.fits") and the other is for a depth of 16bpp (but
> divided
> by 64 -- "room16.fits"). The 16bpp image (saved as img=np.array(img/64))
> looks
> like it has a data type issue still. Could this be an endian thing?
> - I tried to look at img.astype(np.dtype("<u2")), but it still looks messy
>
> 2)
> A second question, from this module, it looks like you cannot control the
> exposure time. Or maybe that's set through adjusting the frame rate
> (depending
> on whether exposure time or packet size takes over, I guess?). How do you
> approach this, if at all?
>
> Many thanks in advance for any advice you can provide.
>
> Best,
> Ryan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk+ZGT4ACgkQZ2ILQVnPodDNpACg4/4kdy/rpUhISYtoxHAebLf0
6igAoLL6jEPhH/OKT0pBSQbF6TW8wNDw
=acFW
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages