Working with raw image data
Downloading
← Older revision Revision as of 01:02, 19 January 2018 (2 intermediate revisions by the same user not shown)Line 1: Line 1: −==<font color='darkblue'>Downloading</font>==+==<font color='darkblue'>Capturing and downloading</font>== +===Command line, demo script: raw.py === +* run: + <font size='2em'>'''root@elphel393:~# raw.py'''</font> +* description: + <font size='2em'>1. scans all available ports, determines the trigger master + 2. reads current frame_number to be used later + 3. formats system memory buffers and mmaps to user memory (all available ports) + 4. selects position in video memory (0 or 1) + 5. triggers copying pixel data from video memory to system memory for the frame_number+1 (waiting is implemented in the videomem driver) + 6. prints the first 16 bytes of the image + 7. prints raw image info for each port</font> + +===Command line=== * Available options (channels can be 0..3): * Available options (channels can be 0..3): <font size='2em'># set receiving buffer size in 4kB pages (thus 4096 equals to 16MB) <font size='2em'># set receiving buffer size in 4kB pages (thus 4096 equals to 16MB) Line 19: Line 32: '''echo 0 > /sys/devices/soc0/elphel393-videomem\@0/membridge_start2''' '''echo 0 > /sys/devices/soc0/elphel393-videomem\@0/membridge_start2''' '''cat /dev/image_raw2 > /tmp/test.raw'''</font> '''cat /dev/image_raw2 > /tmp/test.raw'''</font> − − ==<font color='darkblue'>Displaying</font>== ==<font color='darkblue'>Displaying</font>== Line 39: Line 50: ===Python=== ===Python=== * Camera settings: 2592x1936 JPEG: * Camera settings: 2592x1936 JPEG: +** a) + <font size='2em'>#!/usr/bin/env python + import cv2 + import numpy as np + + width = 2608 + height = 1940 + + with open("test.raw", "rb") as rawimg: + img = np.fromfile(rawimg, np.dtype('u1'), width * height).reshape(height, width) + img.tofile("test2.raw") + colimg = cv2.cvtColor(img, cv2.COLOR_BAYER_GB2BGR) + cv2.imwrite("test.jpeg", colimg) + #cv2.imshow("color", colimg) + #cv2.waitKey(0)</font> + +** b) for PC: <font size='2em'>''#!/usr/bin/python3'' <font size='2em'>''#!/usr/bin/python3'' from PIL import Image from PIL import Image Oleg01/18/18 [elphel-web-393][] by Oleg Dzhimiev: forgot to install raw.php
Oleg Dzhimiev committed changes to the Elphel git project :
forgot to install raw.php
forgot to install raw.php
01/18/18 [elphel-web-393][] by Oleg Dzhimiev: more comments
Oleg Dzhimiev committed changes to the Elphel git project :
more comments
more comments
01/18/18 [elphel-web-393][] by Oleg Dzhimiev: +help
Oleg Dzhimiev committed changes to the Elphel git project :
+help
+help
01/18/18 [elphel-web-393][] by Oleg Dzhimiev: test and added help
Oleg Dzhimiev committed changes to the Elphel git project :
test and added help
test and added help
01/18/18 [elphel-web-393][] by Oleg Dzhimiev: moved raw.php to php_top
Oleg Dzhimiev committed changes to the Elphel git project :
moved raw.php to php_top
moved raw.php to php_top
01/18/18 [meta-elphel393][master-next] by Oleg Dzhimiev: Added python3 and python3-opencv
Oleg Dzhimiev committed changes to the Elphel git project :
Added python3 and python3-opencv
Added python3 and python3-opencv
01/18/18 [x393][CMV300] by Oleg Dzhimiev: minor change in shebang
Oleg Dzhimiev committed changes to the Elphel git project :
minor change in shebang
minor change in shebang
01/18/18 [elphel-web-393][] by Oleg Dzhimiev: cleanup
Oleg Dzhimiev committed changes to the Elphel git project :
cleanup
cleanup
01/18/18 [elphel-web-393][] by Oleg Dzhimiev: minor changes
Oleg Dzhimiev committed changes to the Elphel git project :
minor changes
minor changes
Working with raw image data
Python
← Older revision Revision as of 18:10, 18 January 2018 (One intermediate revision by the same user not shown)Line 39: Line 39: ===Python=== ===Python=== * Camera settings: 2592x1936 JPEG: * Camera settings: 2592x1936 JPEG: +** a) + <font size='2em'>#!/usr/bin/env python + import cv2 + import numpy as np + + width = 2608 + height = 1940 + + with open("test.raw", "rb") as rawimg: + img = np.fromfile(rawimg, np.dtype('u1'), width * height).reshape(height, width) + img.tofile("test2.raw") + colimg = cv2.cvtColor(img, cv2.COLOR_BAYER_GB2BGR) + cv2.imwrite("test.jpeg", colimg) + #cv2.imshow("color", colimg) + #cv2.waitKey(0)</font> + +** b) for PC: <font size='2em'>''#!/usr/bin/python3'' <font size='2em'>''#!/usr/bin/python3'' from PIL import Image from PIL import Image Oleg01/18/18 [elphel-web-393][] by Oleg Dzhimiev: +demo scripts
Oleg Dzhimiev committed changes to the Elphel git project :
+demo scripts
+demo scripts
01/18/18 [linux-elphel][rocko] by Oleg Dzhimiev: added fullwidth (16B burst aligned) and actual width to sysfs
Oleg Dzhimiev committed changes to the Elphel git project :
added fullwidth (16B burst aligned) and actual width to sysfs
added fullwidth (16B burst aligned) and actual width to sysfs
01/17/18 [linux-elphel][rocko] by Oleg Dzhimiev: put correct width value for jp4 and jpeg settings
Oleg Dzhimiev committed changes to the Elphel git project :
put correct width value for jp4 and jpeg settings
put correct width value for jp4 and jpeg settings
01/17/18 [linux-elphel][rocko] by Oleg Dzhimiev: fixed frame number to raw info
Oleg Dzhimiev committed changes to the Elphel git project :
fixed frame number to raw info
fixed frame number to raw info
01/17/18 [linux-elphel][rocko] by Oleg Dzhimiev: Added raw_frame_info to sysfs
Oleg Dzhimiev committed changes to the Elphel git project :
Added raw_frame_info to sysfs
Added raw_frame_info to sysfs
01/16/18 [elphel-web-393][] by Oleg Dzhimiev: tested mmap
Oleg Dzhimiev committed changes to the Elphel git project :
tested mmap
tested mmap
Tmp manual
Accessing raw pixel values
← Older revision Revision as of 20:25, 16 January 2018 (2 intermediate revisions by the same user not shown)Line 267: Line 267: ==<font color="blue">Firmware images</font>== ==<font color="blue">Firmware images</font>== −* [https://community.elphel.com/files/393/20180109/ '''20180109''']+* [https://community.elphel.com/files/393/20180116/ '''20180116'''] +* [https://community.elphel.com/files/393/20180109/ 20180109] * [https://community.elphel.com/files/393/20171120/ 20171120] * [https://community.elphel.com/files/393/20171120/ 20171120] * [https://community.elphel.com/files/393/20171115/ 20171115] * [https://community.elphel.com/files/393/20171115/ 20171115] Line 318: Line 319: ===Powering from batteries (12V or 48V)=== ===Powering from batteries (12V or 48V)=== [[10393_power#Powering_from_batteries| 12V and 48V power options]] [[10393_power#Powering_from_batteries| 12V and 48V power options]] +===Accessing raw pixel values=== +[[Working_with_raw_image_data|Working with raw pixel data]] ==<font color="blue">Known problems</font>== ==<font color="blue">Known problems</font>== Oleg01/16/18 [elphel-web-393][] by Oleg Dzhimiev: test scripts to get raw files
Oleg Dzhimiev committed changes to the Elphel git project :
test scripts to get raw files
test scripts to get raw files
10353
← Older revision
Revision as of 05:35, 14 January 2018
Line 1:
Line 1:
+{{Legacy}}
+See current products here: [[10393]]
+
[[Image:10353top_sm.jpeg|frame|[[Media:10353top.jpeg|10353 board, top view]]]] [[Image:10353top_sm.jpeg|frame|[[Media:10353top.jpeg|10353 board, top view]]]]
[[Image:10353bot_sm.jpeg|frame|[[Media:10353bot.jpeg|10353 board, bottom view]]]] [[Image:10353bot_sm.jpeg|frame|[[Media:10353bot.jpeg|10353 board, bottom view]]]]
Andrey.filippov
Pages
