This function converts GeoJSON code containing bounding box information to polygon regions of interest (ROIs). Bounding boxes are used in deep learning object detection.
This routine is part of ENVI Deep Learning, which requires a separate license and installation.
Note: The ENVI API provides a task called GeoJSONToROI. That task supports ROIs of all types with spatial references. The ENVIDeepLearningGeoJSONToROI object supports polygon ROIs only with both spatial references and pixel-based coordinates.
Example
Sample data files are available on our ENVI Tutorials web page. Click the "Deep Learning" link in the ENVI Tutorial Data section to download a .zip file containing the data. Extract the contents of the .zip file to a local directory. Files are located in the object_detection folder.
e = ENVI()
GeoJSONFile = 'C:\MyTutorialFiles\Handicap_Parking_Spots_BoundingBoxes.json'
inputGeoJSON = JSON_PARSE(GeoJSONFile)
rois = ENVIDeepLearningGeoJSONToROI(inputGeoJSON)
File = 'C:\MyTutorialFiles\DRCOG_AerialImage1.dat'
Raster = e.OpenRaster(File)
View = e.GetView()
Layer = View.CreateLayer(Raster)
roiLayers = OBJARR(N_ELEMENTS(rois))
FOR i=0, N_ELEMENTS(rois)-1 DO roiLayers[i] = Layer.AddROI(rois[i])
Syntax
Result = ENVIDeepLearningGeoJSONToROI(InputGeoJSON [, ERROR=value])
Return Value
This function returns a list of one or more ENVIROI objects.
Arguments
InputGeoJSON
Specify an input GeoJSON FeatureCollection of Geometry types that contain bounding box information. See the Bounding Boxes Background topic for details on the specific GeoJSON format that is required.
Methods
None
Properties
None
Keywords
ERROR (optional)
Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.
When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.
See the Manage Errors topic in ENVI Help for more information on error handling.
Version History
See Also
ENVIDeepLearningROIToGeoJSON, BuildObjectDetectionRasterFromROI Task, ENVIBoundingBoxSet::GetENVIGeoJSON