Transform and Combine fileDatastores to Train CNN
6 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Jayanti
on 14 May 2025
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:
0 Comments
See Also
Categories
Find more on Recognition, Object Detection, and Semantic Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!