Constructor
new Calibration()
- Source:
Methods
(async) deleteCalibrationImages(documentDb, input) → {Promise.<Object>}
- Description:
- returns a success message along with invalid input and deleted calibration images.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let calibrationObject = new mdx.Services.Calibration();
let result = await calibrationObject.deleteCalibrationImages(elastic,{calibrationImages:[{sensorId:"abc", view:"warped-camera-view"}]});
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Description |
calibrationImages |
Array.<{sensorId: ?string, place: ?string, view: ("camera-view"|"warped-camera-view"|"plan-view")}>
|
Each item in the array can contain either sensorId or place |
|
Returns:
A success message is returned
-
Type
-
Promise.<Object>
(async) deleteSensors(documentDb, messageBroker, input) → {Promise.<Object>}
- Description:
- returns a success message along with invalid input and deleted sensors once the sensors in calibration have been deleted and kafka message is sent.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
const kafka = new mdx.Utils.Kafka({brokers: ["kafka-broker-url"]}, kafkaConfigMap);
let calibrationObject = new mdx.Services.Calibration();
let result = await calibrationObject.deleteSensors(elastic,kafka,{sensorIds:["abc","xyz"]});
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
messageBroker |
MessageBroker
|
MessageBroker Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Description |
sensorIds |
Array.<string>
|
|
|
Returns:
A success message is returned
-
Type
-
Promise.<Object>
(async) getCalibration(documentDb, inputopt) → {Promise.<Object>}
- Description:
- returns an object containing calibration and the timestamp associated with it.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let calibrationObject = new mdx.Services.Calibration();
let {calibration, timestamp} = await calibrationObject.getCalibration(elastic);
Parameters:
Name |
Type |
Attributes |
Default |
Description |
documentDb |
Database
|
|
|
Database Object |
input |
Object
|
<optional>
|
{}
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
sensorId |
string
|
<optional>
<nullable>
|
null
|
|
|
Returns:
Calibration Object along with timestamp is returned
-
Type
-
Promise.<Object>
getCalibrationMaps(calibration) → {Promise.<Object>}
- Description:
- returns an object containing calibration maps.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
let calibrationObject = new mdx.Services.Calibration();
let calibrationMaps = calibrationObject.getCalibrationMaps(calibration);
Parameters:
Name |
Type |
Description |
calibration |
Object
|
|
Returns:
An object containing calibration maps is returned
-
Type
-
Promise.<Object>
(async) getImage(documentDb, input) → {Promise.<string>}
- Description:
- returns the path of calibration image.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let calibrationObject = new mdx.Services.Calibration();
let result = await calibrationObject.getImage(elastic,{sensorId:"abc", view:"warped-camera-view"});
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Description |
sensorId |
string
|
<optional>
|
Either sensorId or place should be present. |
place |
string
|
<optional>
|
Either sensorId or place should be present. |
view |
"camera-view"
|
"warped-camera-view"
|
"plan-view"
|
|
|
|
Returns:
Path of calibration image is returned
-
Type
-
Promise.<string>
- Description:
- returns the calibration image metadata.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let calibrationObject = new mdx.Services.Calibration();
let result = await calibrationObject.getImageMetadata(elastic,{sensorId:"abc"});
Parameters:
Name |
Type |
Attributes |
Default |
Description |
documentDb |
Database
|
|
|
Database Object |
input |
Object
|
<optional>
|
{}
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
sensorId |
string
|
<optional>
<nullable>
|
null
|
sensorId is an optional param. Either sensorId or place can be present. |
place |
string
|
<optional>
<nullable>
|
null
|
place is an optional param. Either sensorId or place can be present. |
view |
null
|
"camera-view"
|
"warped-camera-view"
|
"plan-view"
|
<optional>
|
null
|
|
|
Returns:
Object containing image metadata is returned
-
Type
-
Promise.<Object>
(async) upload(documentDb, messageBroker, inputopt) → {Promise.<Object>}
- Description:
- returns a success message once the calibration file is uploaded and kafka message is sent.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
const kafka = new mdx.Utils.Kafka({brokers: ["kafka-broker-url"]}, kafkaConfigMap);
let calibrationObject = new mdx.Services.Calibration();
let result = await calibrationObject.upload(elastic,kafka,{fileDetails:req.files, fieldName:"configFiles"});
Parameters:
Name |
Type |
Attributes |
Default |
Description |
documentDb |
Database
|
|
|
Database Object |
messageBroker |
MessageBroker
|
|
|
MessageBroker Object |
input |
Object
|
<optional>
|
{}
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
fileDetails |
Object
|
<optional>
<nullable>
|
null
|
|
fieldName |
string
|
<optional>
<nullable>
|
null
|
|
|
Returns:
A success message is returned
-
Type
-
Promise.<Object>
(async) uploadImages(documentDb, inputopt) → {Promise.<Object>}
- Description:
- returns a success message once the calibration images are uploaded.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let calibrationObject = new mdx.Services.Calibration();
let result = await calibrationObject.uploadImages(elastic,{fileDetails:req.files, imageFieldName:"images", metadataFieldName: "imageMetadata"});
Parameters:
Name |
Type |
Attributes |
Default |
Description |
documentDb |
Database
|
|
|
Database Object |
input |
Object
|
<optional>
|
{}
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
fileDetails |
Object
|
<optional>
<nullable>
|
null
|
|
imageFieldName |
string
|
<optional>
<nullable>
|
null
|
|
metadataFieldName |
string
|
<optional>
<nullable>
|
null
|
|
|
Returns:
A success message is returned
-
Type
-
Promise.<Object>
(async) upsert(documentDb, messageBroker, inputCalibration) → {Promise.<Object>}
- Description:
- returns a success message once the input calibration is updated/inserted and kafka message is sent.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
const kafka = new mdx.Utils.Kafka({brokers: ["kafka-broker-url"]}, kafkaConfigMap);
let calibrationObject = new mdx.Services.Calibration();
let result = await calibrationObject.upsert(elastic,kafka,inputCalibration);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
messageBroker |
MessageBroker
|
MessageBroker Object |
inputCalibration |
Object
|
|
Returns:
A success message is returned
-
Type
-
Promise.<Object>