Transform and Combine fileDatastores to Train CNN

조회 수: 7 (최근 30일)
Shahad Sabeeh
Shahad Sabeeh 2022년 4월 19일
답변: Jayanti 2025년 5월 14일
Hello
I have images obtained from lidar sensor with extension .ply and images from a RGB camera with a extension .png. I put them on the CNN deep learning network. I used PCA for the purpose of reducing the dimensions of the LiDAR images. How do I combine the converted images and RGB images together for the purpose of network training?
Note when using Instruct Combin the following error appears
The following error occurred converting from matlab.io.datastore.ImageDatastore to double:
Conversion to double from matlab.io.datastore.ImageDatastore is not possible.
The version used is 2018.

답변 (1개)

Jayanti
Jayanti 2025년 5월 14일
Hi Shahad,
In the provided code, “sf” is a numeric array used to store the lidar data after applying "PCA" and resizing. The issue arises because the “combine” function is being used to merge “sf” (a numeric array) with an “ImageDatastore”, which is not allowed. The “combine” function requires all inputs to be datastores.
To resolve this, convert the contents of “sf” into image files and save them to a folder using the “imwrite” function. After that, create a second “ImageDatastore” from this folder containing the saved lidar images.
Then combine this new datastore with your existing RGB image datastore for training. Assuming “lidarDatastore” is the datastore created from the folder containing the saved lidar images. Below code will combine the two datastores.
combinedData = combine(Datatest, lidarDatastore);
Please refer to below documentation link on "combine" for more information:

카테고리

Help CenterFile Exchange에서 Recognition, Object Detection, and Semantic Segmentation에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by