#raspberry pi HQ cam

26 messages ยท Page 1 of 1 (latest)

feral oxide
#

Hey, has anyone used the raspberry pi hq cam and knows a good way how to get raws out?

plain briar
#

yeh I used one for ages. It's not very good to be honest

feral oxide
#

ok nice ๐Ÿ™‚

#

yea i don't expect that much from it but id like to test it on planetary but mainly id like do build my own tracking with it

plain briar
#

ok let me know if that software is useful to you

feral oxide
#

i think not, even though it is a precise answer to my initial question, so thanks for that ๐Ÿ™‚
i seems like a realy usefull tool in gerneral, so i'd say good job,
but i like to build everything from scratch, so i'm looking for a more basic way to acces the camera
for the guiding for example i thought about python with opencv, but maybe you have a better idea which is faster

oblique hawk
#

I believe the proper way to do things is to use dcraw but not entirely sure how to.

feral oxide
#

i'd like to do two separate things (maybe shoudl have written that initialy xD)

  1. get raws in full resolution out as fast as possible and store them on the pi itself or external harddrive as some usefull rawformat.
  2. build my own guiding, current idea here is python and opencv for the image processig
oblique hawk
# feral oxide Hey, has anyone used the raspberry pi hq cam and knows a good way how to get raw...

Here is the code if you want

import time
from PIL import Image

class rawDataToPicture:

    def __init__(self):
       pass

    #video frames should be split into individual files
    def rawDataToPreviewPicture(self,inpath, outpath, width, height, stride, bitdepth):
        with open(path, "rb") as rawFile:

            ono = bytearray(rawFile.read(-1))
            img1 = Image.frombytes('L',(stride,height), bytes(ono))
            #crop black bits from unused part of sensor
            #should probably do black level but i don't know how or why
            cropWidth = width * (bitdepth / 8)
            cropArea = (0,0,int(cropWidth),height)
            img1 = img1.crop(cropArea)
            ono = bytearray(img1.tobytes())


            if(bitdepth != 8):
                #strip every xth line containing end bits
                #turns images into 8 bit but perfectly fine for preview
                if(bitdepth == 10):
                    k = 5
                if(bitdepth == 12):
                    k = 3
                
                del ono[k-1::k]
            
            imgu = Image.frombytes('L',(width,height), bytes(ono))

            imgu.show()
            imgu.save(outpath + '.bmp')

rDTP = rawDataToPicture()
#should read this from settings file, or string
start = time.time()

#should be absolute path I think
path = '1223inaTest00000.raw'
outputpath ='1223outInaTest00000'

#input file path, output file path, width, height, stride, bitdepth
#rDTP.rawDataToPreviewPicture(path,outputpath,1665,990,1696,10)
rDTP.rawDataToPreviewPicture(path,outputpath,4056,3040,6112,12)

end = time.time()
print(end - start)
oblique hawk
feral oxide
#

i read something about a more optimal way with raspyraw or something which is capable of getting higher frame rates, hm but i can't find it now

plain briar
feral oxide
sleek snow
#

yeah, i have but until now i use it as a microscope camera. I didnt know it only able to do 4k stillframes.

#

why dont you just record in uncompressed avi and get the pics via pipp

#

im working on getting it record 1440p still its a lot of bandwith issue through using raspi zero and usb2.0

feral oxide
#

oh nice, so is there a simple commandline command which captures raw video?

sleek snow
#

if you have a Jetson board the best there is 4k 30fps but not uncompressed

#

Ican just adapt little things sofar, If you want to have more i suggest learning coding.

#

i managed to force 1440p output but is at best unreliable and the camera shuts down quite often.

#

the csi a cable is also a bottle neck