com.supermap.ar.areffect.utils
Class VideoDatasetVectorHelper
- java.lang.Object
-
- com.supermap.ar.areffect.utils.VideoDatasetVectorHelper
-
public class VideoDatasetVectorHelper extends java.lang.ObjectVideo data set AssistantFor converting CSV + MP4 into video data set
SampleCode: // Create instance, parameters (context, Datasource) VideoDatasetVectorHelper videoDatasetVectorHelper = new VideoDatasetVectorHelper(this, datasources.get(0)); try { videoDatasetVectorHelper.readVideo(SD_CARD+"/UAVSurvey/Common/2022_05_16_15_51_51.mp4"); } catch (FileNotFoundException e) { e.printStackTrace(); } try { videoDatasetVectorHelper.readCsv(SD_CARD+"/UAVSurvey/Common/2022_05_16_15_51_51.csv"); } catch (IOException e) { e.printStackTrace(); } DatasetVector datasetVector = videoDatasetVectorHelper.createDatasetVector("NewVideoDatasetVector");
-
-
Constructor Summary
Constructors Constructor and Description VideoDatasetVectorHelper(android.content.Context context, Datasource ds)The constructor The fields in CSV are /UniqueIdentifier/UnixTimeStamp/SensorLongitude/SensorLatitude /PlatformHeight/PlatformYaw/PlatformPitch/PlatformRoll /VerticalFOV/HorizontalFOV/FocalLength35mmEq /CameraRelativeYaw/CameraRelativePitch/CameraRelativeRoll/CameraRelativeHeight /Yaw/Pitch/Roll/Date/VideoDatasetVectorHelper(android.content.Context context, Datasource ds, UAVCsvReader.OnReadUpdateListener onReadUpdateListener)Constructor The read CSV does not require the order of the fields public void onUpdate(UAVRecordParameter currentPara, String[] value) { try { currentPara.setUniqueIdentifier(String.valueOf(index++)); currentPara.setUnixTimeStamp(Long.parseLong(value[1])); //...
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringconvertToXmlStr(java.util.ArrayList<UAVRecordParameter> uavRecordParameters)DatasetVectorcreateDatasetVector(java.lang.String datasetVectorName)Create a video dataset set the width and height of the videoDatasetVectorcreateDatasetVector(java.lang.String datasetVectorName, java.lang.String videoName)Create a video datasetvoidreadCsv(java.lang.String sdcardPath)Read the CSV file from the SD card pathvoidreadVideo(java.lang.String sdCardPath)Set the width and height of the video
-
-
-
Constructor Detail
-
VideoDatasetVectorHelper
public VideoDatasetVectorHelper(android.content.Context context, Datasource ds)The constructorThe fields in CSV are /UniqueIdentifier/UnixTimeStamp/SensorLongitude/SensorLatitude /PlatformHeight/PlatformYaw/PlatformPitch/PlatformRoll /VerticalFOV/HorizontalFOV/FocalLength35mmEq /CameraRelativeYaw/CameraRelativePitch/CameraRelativeRoll/CameraRelativeHeight /Yaw/Pitch/Roll/Date/- Parameters:
context-ds-
-
VideoDatasetVectorHelper
public VideoDatasetVectorHelper(android.content.Context context, Datasource ds, UAVCsvReader.OnReadUpdateListener onReadUpdateListener)ConstructorThe read CSV does not require the order of the fields public void onUpdate(UAVRecordParameter currentPara, String[] value) { try { currentPara.setUniqueIdentifier(String.valueOf(index++)); currentPara.setUnixTimeStamp(Long.parseLong(value[1])); //... Date date = dateFormat.parse(value[18]); currentPara.setDateTime(date); } catch (Exception e) { Log.e(VideoDatasetVectorHelper.class.getSimpleName(), "onUpdate: ", e); }- Parameters:
context-ds-onReadUpdateListener-
-
-
Method Detail
-
readCsv
public void readCsv(java.lang.String sdcardPath) throws java.io.IOExceptionRead the CSV file from the SD card path- Parameters:
sdcardPath-- Throws:
java.io.IOException
-
readVideo
public void readVideo(java.lang.String sdCardPath) throws java.io.FileNotFoundExceptionSet the width and height of the video- Parameters:
sdCardPath-- Throws:
java.io.FileNotFoundException
-
createDatasetVector
public DatasetVector createDatasetVector(java.lang.String datasetVectorName)
Create a video dataset set the width and height of the video- Parameters:
datasetVectorName-- Returns:
-
createDatasetVector
public DatasetVector createDatasetVector(java.lang.String datasetVectorName, java.lang.String videoName)
Create a video dataset- Parameters:
datasetVectorName-videoName-- Returns:
-
convertToXmlStr
public java.lang.String convertToXmlStr(java.util.ArrayList<UAVRecordParameter> uavRecordParameters)
-
-