almalence / OpenCamera

Open camera project - multi-functional camera application for android.
Other
1.1k stars 416 forks source link

Allow cropping to custom area of interest before saving the images #111

Open valentinitnelav opened 1 year ago

valentinitnelav commented 1 year ago

Thank you for developing this app. We use it for research purposes, installed on Android phones placed on top of flowers to record time-lapse images (possibly videos as well) of any visiting insect. One major improvement would be to be able to set a region of interest (ROI) that contains the target objects (like a square buffer around a target flower). This ROI should be of rectangular shape (a square or a rectangle), and it can be adjusted to custom sizes on the screen of the phone. The recorded images or videos must be cropped with this ROI and only then saved.

Would it be possible to implement this feature, or if not, do you know of any other app that can take time-lapse images and allows for defining a ROI?

Most probably the ROI will be square or nearly square because we use the images as a training dataset for a deep learning pipeline.

This issue is a bit related to #43

Gitoffthelawn commented 1 year ago

@valentinitnelav How do you automatically trigger the shutter when the insect appears? Or are you just doing it manually for each insect?

valentinitnelav commented 1 year ago

@Gitoffthelawn , thank you for your question.

We do not use any automatic triggers (motion-based ones can give a lot of false positives because the flowers can move due to wind + small insects could be missed; infrared ones do not work for insects because insects do not emit heat).

So, we set the OpenCamera app to take time-lapse images using the "Repeat mode interval" set at "1 s" & "Unlimited" "Repeat" mode (in Settings wheel). We let the app run for 1 hour and then stop it by touching the camera shutter button and we move to the next flower. We also fix the focus from the start, no flash, and a resolution of 1600 x 1200 (we would also want to have the option for a square frame like 1280 x 1280 to use the images later for YOLOv5 for example). The phones are fixed on tripods and connected to a power bank. It works well for several hours in field conditions. When it is too sunny, then the phones tend to overheat and get really slow or shut down, but we'll work on building a white protective casing.

Below is a print screen with the current settings that we use: Selection_108

Face detection = off; Timer = off (no need for the timer - this is for selfies for example); Repeat = unlimited (it takes photos until you click again on the shutter button to stop); We would need to be able to input a custom value here (1 hour or several hours) - see also my other issue #112. Repeat mode interval = 0.5s or 1s (attempts to take a photo every 1 second, but it depends on how fast the phone is). Would be nice to be able to have the option to put our custom values here as well (fraction of seconds or some other seconds values, like 1.5 or 2.5, etc) - see also my other issue #112

Would be extremely helpful for our research project to be able to define on the screen an area of interest (square or not) from the very start when we set the phone on top of a flower. Right now we have to be too close to the flowers and we think that we scare the insects. If we are too far, then we get too much background noise (the flower occupies only a small portion of the image area and therefore also the insects will be small - this is very problematic for object detection pipelines and also for us to identify the insects).

We are currently in the process of documenting our past work and publishing a scientific article in a peer-reviewed journal. We find the OpenCamera app really helpful and it will be part of our citations with the hope that others in the domain of pollination ecology will use it.