Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

Lobe and BrainCraft- saving classified images and capture ra
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Lobe and BrainCraft- saving classified images and capture ra

by RustyWire on Thu May 13, 2021 3:19 pm

Hello,

I just got Lobe running on my RPI4 8gb and BrainCraft, it works great, but I have a few correlating questions-

[*]Can I change the exposure time? I need to be able to better capture faster moving images.
[*]Is it possible to save the classified images automatically? For example, when Lobe identifies your image, can I have it save that image to a specified location?
[*]What is the maximum rate for taking pictures and identifying them?
[*]Is it possible to trigger when an image is captured and classified?

What I'm trying to accomplish- I don't want Lobe to evaluate anything until a digital input comes on. Once the input is triggered, the Pi should take an image and Lobe should evaluate it, determine its classification, and save both the image and the classification results to a predetermined location.

Thank you for your help!

RustyWire
 
Posts: 2
Joined: Thu May 13, 2021 3:05 pm

Re: Lobe and BrainCraft- saving classified images and captur

by mikeysklar on Thu May 13, 2021 6:04 pm

It looks like lobe does not have any high level exposure settings. Picamera does have a shutter_speed, analog_gain and exposure_mode you can mess with.

To fix exposure time, set the shutter_speed attribute to a reasonable value.


https://picamera.readthedocs.io/en/rele ... ent-images

It looks like package detector has a little bit of logic you could build on around 'label' to place files. You should be able to expand on this for trigger when an image is captured and classified.

Code: Select all | TOGGLE FULL SIZE
         # File name
            name = datetime.now()
            # Save the current frame
            camera.capture(
               os.path.join(
                  f'./retraining_data/{label}',
                  f'{datetime.now().strftime("%Y-%m-%d_%H:%M:%S")}.jpg'
               )


The maximum rate for taking photos and identifying looks pretty slow. framerate is plenty fast at 30 fps, but there is a 2 second sleep in there plus whatever the overhead for processing the image.

Code: Select all | TOGGLE FULL SIZE
def main():
   with picamera.PiCamera(resolution=(224, 224), framerate=30) as camera:
      stream = io.BytesIO()
      camera.start_preview()
      # Camera warm-up time
      time.sleep(2)


https://github.com/lobe/lobe-adafruit-k ... capture.py

mikeysklar
 
Posts: 4559
Joined: Mon Aug 01, 2016 8:10 pm

Re: Lobe and BrainCraft- saving classified images and captur

by RustyWire on Fri May 14, 2021 9:10 am

Thank you, this is very helpful information!

RustyWire
 
Posts: 2
Joined: Thu May 13, 2021 3:05 pm

Please be positive and constructive with your questions and comments.