How to check only JPG in a folder using CLI

I am trying to achieve real-time photogrammetry somehow, referring to the CLI Sample Scripts (RealityCapture CLI Sample Scripts - Capturing Reality). However, I am having trouble with some parts, so I would be glad if you could help me.

I am using a tethered photography program to take pictures with a digital camera and import them to a designated folder on my PC in real time.

For a folder containing only jpg format files, one of the sample scripts, “Repetitively check for new images in the image folder and align them with the already imported images”, which is one of the sample scripts, worked fine for the case of a folder containing only jpg files.

However, if there are both jpg and raw (Sony’s ARW) images to be imported into the folder, an error message “unsupported file format” is displayed.

I think the problem can be solved by sequential checking of the folder and selecting only jpg format files for import. However, when I try to use one of the sample scripts, “Examples of how to select images using regular expressions”, I get an error message saying “unsupported file format”.

Please let me know if there is any solution to this problem.
Thank you in advance.

Hi @yamahiro,

I adjusted the alignAfterAddingImages.bat file a bit to fit your workflow better.

This:

:: If the amount of images in the folder has changed, and their count is larger than 5, images will be imported and aligned.
echo "The required amount of added images detected (%addedImages%). RealityCapture will align images."
%RealityCaptureExe% -delegateTo * -addFolder "%RootFolder%%imageFolder%" -align
timeout %delay%

was changed to this:

:: If the amount of images in the folder has changed, and their count is larger than 5, images will be imported and aligned.
echo "The required amount of added images detected (%addedImages%). RealityCapture will align images."

    for /f %%G in ("%RootFolder%%imageFolder%\*") do (
        
        :: Create an imagelist with the paths to the JPG images.
        dir /b /s %RootFolder%%imageFolder%\*.jpg > %RootFolder%\jpg.imagelist    
    )

%RealityCaptureExe% -delegateTo * -add "%RootFolder%\jpg.imagelist" -align
timeout %delay

Now it creates an image list that lists all of the JPG files in the specified folder and adds images with the help of that image list.
Alterations were done only for the JPG format.

alignAfterAddingImages.bat (2.4 KB)

1 Like

Thank you so much!
I immediately tried the script you created and it worked perfectly.
In this case, I understood that it is important to create an image list.

1 Like