Package: ak-frame-extractor
# AKFruitData: AK_FRAEX - Azure Kinect Frame ExtractorPython-based GUI tool to extract frames from video files produced with Azure Kinect cameras. Visit the project site
athttps://pypi.org/project/ak-frame-extractor/and check the source code athttps://github.com/GRAP-UdL-AT/ak_frame_extractor/ContentsPre-requisites.Functionalities.Install and run.Files and folder description.Development tools, environment, build executables.1. Pre-requisitesSDK Azure Kinectinstalled.pyk4a libraryinstalled. If the operating system is Windows, follow
thissteps. You can find test basic examples with
pyk4ahere.In Ubuntu 20.04, we provide a script to install the camera drivers following the instructions
inazure_kinect_notes.Videos recorded with the Azure Kinect camera, optional video samples are available atAK_FRAEX - Azure Kinect Frame Extractor demo videos2. FunctionalitiesThe functionalities of the software are briefly described. Supplementary material can be
found inUSER's Manual.[Dataset creation]This option creates a hierarchy of metadata. This hierarchy contains sub-folders that will be
used to store the extracted data.[Data Extraction]The user can configure the parameters for extracting data frames from videos, such as: output
folder, number of frames to extract. The extraction can be done from one video or by processing a whole folder in
batch mode.[Data Migration]In this tab, we offer a tool for data migration in object labelling tasks. It is used to convert
files from .CSV format (generated withPychet Labeller)
toPASCALVOCformat.Data extracted and 3D cloud points can be retrieved from *"your dataset metadata folder"**.3. Install and run3.1 PIP quick install packageCreate your Python virtual environment.** For Linux systems **
python3 -m venv ./ak_frame_extractor_venv
source ./ak_frame_extractor_venv/bin/activate
pip install --upgrade pip
pip install python -m ak-frame-extractor

** execute package **
python -m ak_frame_extractor

** For Windows 10 systems **
python -m venv ./ak_frame_extractor_venv
.\ak_frame_extractor_venv\Scripts\activate.bat
python.exe -m pip install --upgrade pip
pip install ak-frame-extractor

** execute package **
python -m ak_frame_extractor3.2 Install and run virtual environments using scripts provided[Linux]
Enter to the folder"ak_frame_extractor/"Create virtual environment(only first time)./creating_env_ak_frame_extractor.shRun script../ak_frame_extractor_start.sh[Windows]
Enter to the folder "ak_frame_extractor/"Create virtual environment(only first time)TODO_HERERun script from CMD../ak_frame_extractor_start.bat4.3 Files and folder descriptionFolder description:FoldersDescriptiondocs/Documentationsrc/Source codewin_exe_conf/Specifications for building .exe files withPyinstaller..tools/Examples of code to use data migrated. We offer scripts in MATLAB, Python, R.data/Examples of output produced by AK_FRAEX, data extracted from recorded video...Python environment files:FilesDescriptionOSactivate_env.batActivate environments in WindowsWINclean_files.batClean files under CMD.WINcreating_env_ak_frame_extractor.shAutomatically creates Python environmentsLinuxak_sm_recorder_main.batExecuting main scriptWINak_frame_extractor_start.shExecuting main scriptLinux/ak_frame_extractor_main.pyPython main functionSupported by PythonPyinstaller files:FilesDescriptionOSbuild_win.batBuild .EXE for distributionWIN/src/ak_frame_extractor/main.pyMain function used in package compilationSupported by Python/ak_frame_extractor_main.pyPython main functionSupported by PythonPypi.org PIP packages files:FilesDescriptionOSbuild_pip.batBuild PIP package to distributionWIN/src/ak_frame_extractor/main.pyMain function used in package compilationSupported by Pythonsetup.cfgPackage configuration PIPSupported by Pythonpyproject.tomlPackage description PIPSupported by Python5. Development tools, environment, build executablesSome development tools are needed with this package, listed below:Pyinstaller.Opencv.Curses for Pythonpip install windows-curses.7zip.5.1 Notes for developersYou can use themain.py for execute as first time in src/ak_frame_extractor/_ _ main _ _.py Configure the path of
the project, if you use Pycharm, put your folder root like this:5.2 Creating virtual environment Linuxpython3 -m venv ./venv
source ./venv/bin/activate
pip install --upgrade pip
pip install -r requirements_linux.txt5.3 Creating virtual environment  Windows%userprofile%"\AppData\Local\Programs\Python\Python38\python.exe" -m venv ./venv
venv\Scripts\activate.bat
pip install --upgrade pip
pip install -r requirements_windows.txt** If there are some problems in Windows, followthis**pip install pyk4a --no-use-pep517 --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.4.1\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\lib"5.4 Building PIP packageWe are working to offer Pypi support for this package. At this time this software can be built by scripts automatically.5.4.1 Build packagespy -m pip install --upgrade build
build_pip.bat5.4.2 Download PIP packagepip install package.whl5.4.3 Run ak_frame_extractorpython -m ak_frame_extractor.py5.4 Building .EXE for Windows 10build_win.batAfter the execution of the script, a new folder will be generated inside the project"/dist". You can copy **
ak_frame_extracted_f/** or a compressed file"ak_frame_Extractor_f.zip"to distribute.5.6 Package distribution formatExplain about packages distribution.Package typePackageUrlDescriptionWindows.EXE.EXEExecutables are stored under build/Linux.deb.debNOT IMPLEMENTED YETPIP.whl.whlPIP packages are stored in build/AuthorshipThis project is contributed byGRAP-UdL-AT. Please contact authors to report
bugsjuancarlos.miranda@udl.catCitationIf you find this code useful, please consider citing:@article{MIRANDA2022101231,
title = {AKFruitData: A dual software application for Azure Kinect cameras to acquire and extract informative data in yield tests performed in fruit orchard environments},
journal = {SoftwareX},
volume = {20},
pages = {101231},
year = {2022},
issn = {2352-7110},
doi = {https://doi.org/10.1016/j.softx.2022.101231},
url = {https://www.sciencedirect.com/science/article/pii/S2352711022001492},
author = {Juan Carlos Miranda and Jordi Gené-Mola and Jaume Arnó and Eduard Gregorio},
keywords = {RGB-D camera, Data acquisition, Data extraction, Fruit yield trials, Precision fructiculture},
abstract = {The emergence of low-cost 3D sensors, and particularly RGB-D cameras, together with recent advances in artificial intelligence, is currently driving the development of in-field methods for fruit detection, size measurement and yield estimation. However, as the performance of these methods depends on the availability of quality fruit datasets, the development of ad-hoc software to use RGB-D cameras in agricultural environments is essential. The AKFruitData software introduced in this work aims to facilitate use of the Azure Kinect RGB-D camera for testing in field trials. This software presents a dual structure that addresses both the data acquisition and the data creation stages. The acquisition software (AK_ACQS) allows different sensors to be activated simultaneously in addition to the Azure Kinect. Then, the extraction software (AK_FRAEX) allows videos generated with the Azure Kinect camera to be processed to create the datasets, making available colour, depth, IR and point cloud metadata. AKFruitData has been used by the authors to acquire and extract data from apple fruit trees for subsequent fruit yield estimation. Moreover, this software can also be applied to many other areas in the framework of precision agriculture, thus making it a very useful tool for all researchers working in fruit growing.}
}AcknowledgementsThis work is a result of the RTI2018-094222-B-I00 project(PAgFRUIT)granted by MCIN/AEI and by the European Regional
Development Fund (ERDF). This work was also supported by the Secretaria d’Universitats i Recerca del Departament
d’Empresa i Coneixement de la Generalitat de Catalunya under Grant 2017-SGR-646. The Secretariat of Universities and
Research of the Department of Business and Knowledge of theGeneralitat de Catalunyaand Fons Social Europeu (FSE) are
also thanked for financing Juan Carlos Miranda’s pre-doctoral fellowship(2020 FI_B 00586). The work of Jordi Gené-Mola
was supported by the Spanish Ministry of Universities through a Margarita Salas postdoctoral grant funded by the
European Union - NextGenerationEU. The authors would also like to thank the Institut de Recerca i Tecnologia
Agroalimentàries(IRTA)for allowing the use of their experimental fields, and in particular Dr. Luís Asín and Dr. Jaume
Lordán who have contributed to the success of this work.