com.supermap.ar.areffect.utils
类 VideoDatasetVectorHelper
- java.lang.Object
-
- com.supermap.ar.areffect.utils.VideoDatasetVectorHelper
-
public class VideoDatasetVectorHelper extends java.lang.Object
视频数据集助手用于将csv + mp4 转为视频数据集
SampleCode: //创建实例,参数(上下文,数据源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 { //读取csv资源(文件全路径) videoDatasetVectorHelper.readCsv(SD_CARD+"/UAVSurvey/Common/2022_05_16_15_51_51.csv"); } catch (IOException e) { e.printStackTrace(); } //创建视频数据集 DatasetVector datasetVector = videoDatasetVectorHelper.createDatasetVector("NewVideoDatasetVector");
-
-
构造器概要
构造器 构造器和说明 VideoDatasetVectorHelper(android.content.Context context, Datasource ds)
构造函数 csv中字段依次是 /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)
构造函数 读取的csv对字段顺序无要求,可通过OnReadUpdateListener实现读取字段 public void onUpdate(UAVRecordParameter currentPara, String[] value) { try { currentPara.setUniqueIdentifier(String.valueOf(index++)); currentPara.setUnixTimeStamp(Long.parseLong(value[1])); //...
-
方法概要
所有方法 实例方法 具体方法 限定符和类型 方法和说明 java.lang.String
convertToXmlStr(java.util.ArrayList<UAVRecordParameter> uavRecordParameters)
DatasetVector
createDatasetVector(java.lang.String datasetVectorName)
创建视频数据集DatasetVector
createDatasetVector(java.lang.String datasetVectorName, java.lang.String videoName)
创建视频数据集void
readCsv(java.lang.String sdcardPath)
从sd卡的路径读取csvvoid
readVideo(java.lang.String sdCardPath)
设置视频的宽高尺寸
-
-
-
构造器详细资料
-
VideoDatasetVectorHelper
public VideoDatasetVectorHelper(android.content.Context context, Datasource ds)
构造函数csv中字段依次是
/UniqueIdentifier/UnixTimeStamp/SensorLongitude/SensorLatitude
/PlatformHeight/PlatformYaw/PlatformPitch/PlatformRoll
/VerticalFOV/HorizontalFOV/FocalLength35mmEq
/CameraRelativeYaw/CameraRelativePitch/CameraRelativeRoll/CameraRelativeHeight
/Yaw/Pitch/Roll/Date/
- 参数:
context
-ds
-
-
VideoDatasetVectorHelper
public VideoDatasetVectorHelper(android.content.Context context, Datasource ds, UAVCsvReader.OnReadUpdateListener onReadUpdateListener)
构造函数读取的csv对字段顺序无要求,可通过OnReadUpdateListener实现读取字段
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);
}
- 参数:
context
-ds
-onReadUpdateListener
-
-
-
方法详细资料
-
readCsv
public void readCsv(java.lang.String sdcardPath) throws java.io.IOException
从sd卡的路径读取csv- 参数:
sdcardPath
-- 抛出:
java.io.IOException
-
readVideo
public void readVideo(java.lang.String sdCardPath) throws java.io.FileNotFoundException
设置视频的宽高尺寸- 参数:
sdCardPath
- 资源路径- 抛出:
java.io.FileNotFoundException
-
createDatasetVector
public DatasetVector createDatasetVector(java.lang.String datasetVectorName)
创建视频数据集- 参数:
datasetVectorName
- 数据集名称- 返回:
-
createDatasetVector
public DatasetVector createDatasetVector(java.lang.String datasetVectorName, java.lang.String videoName)
创建视频数据集- 参数:
datasetVectorName
- 数据集名称videoName
- 视频名称- 返回:
-
convertToXmlStr
public java.lang.String convertToXmlStr(java.util.ArrayList<UAVRecordParameter> uavRecordParameters)
- 参数:
uavRecordParameters
-- 返回:
-
-