![]() |
Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2025.
|
Provide image edition methods. More...
Public Types | |
enum | SImageType { ABSTRACT = 0 , PERSPECTIVE = 1 , SPHERICAL = 2 , ORTHO = 3 } |
The type of the SImage. More... | |
![]() | |
enum | VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 } |
Visible criteria. More... | |
Public Member Functions | |
Object | ClearMask () |
Clear the link between an SImage and its texture mask. | |
Object | CreateMaskAuto () |
Create an automatic mask from the SImage. | |
Object | GetCameraExternalParameters () |
Get the external camera parameters of perspective and spherical SImage. | |
Object | GetCameraInternalParameters () |
Get the internal camera parameters of a perspective SImage. | |
Object | GetImageType () |
Get the type of the SImage. | |
Object | GetOrthoParameters () |
Get the ortho SImage parameters. | |
Object | GoToCameraViewpoint () |
Go to the camera viewpoint. | |
boolean | HasMask () |
Return if the SImage has a mask or not. | |
Object | Save (string filePath, SMatrix coordinateSystemMatrix=SMatrix()) |
Save the image into a file. | |
Object | SetCameraExternalParameters (SCameraExternal externalParams) |
Set the external camera parameters for perspective and spherical SImage. | |
Object | SetCameraInternalParameters (SCameraInternal internalParams) |
Set the internal camera parameters for a perspective SImage. | |
Object | SetMaskFromFile (string maskFilePath) |
Set the texture mask of the SImage from a file. File extensions authorized: .bmp, .tif, .jpg, .png. The texture mask image must have the same size as the current image. | |
Object | SetOrthoParameters (SPoint position, number rotation, number pixelSize) |
Set the ortho SImage parameters. | |
SImage (SImage other, SImageType imageType=SImage.ABSTRACT) | |
Construct an SImage by copying the SImage other and setting the SImage.SImageType in input. If ABSTRACT type is set, the image type of the SImage other is used. | |
string | toString () |
Get the type of the variable. | |
![]() | |
AddToDoc () | |
Add the object to the document. | |
ApplyTransformation (SMatrix matrix) | |
Apply a geometric transformation to the current object by making a product with the given matrix. | |
Object | GetBoundingBox (SMatrix ucs=null) |
Calculate the bounding box of the object. | |
Object | GetColors () |
Get the colors of the object. | |
string | GetFolderName () |
Get the name of the folder containing the object. | |
string | GetName () |
Return the object's name. | |
string | GetPath () |
Return the full path of an SComp in the tree. | |
Invert () | |
Invert the normal of the object. | |
boolean | IsInDoc () |
Return if the object is in the document or not. | |
boolean | IsVisible () |
Get the visibility of the object. | |
MoveToGroup (string groupPath, boolean moveInsideTopParent=true) | |
Move the object to the document group represent by the given path. If some groups, in the path, don't exist, they will be created. | |
RemoveFromDoc () | |
Remove the object from the document. | |
SetClippable (boolean clipping) | |
Set clippable or not. | |
SetColors (number red, number green, number blue) | |
Set the colors of the object. | |
SetName (string objectName) | |
Set the object's name. | |
SetTransparency (number alpha) | |
Set the transparency of the object. | |
SetVisibility (boolean visible) | |
Set the object to be visible, or not visible. | |
string | toString () |
Get the type of the variable. | |
Translate (SVector vector) | |
Make a translation of the current object with an SVector. | |
Static Public Member Functions | |
static Array< SImage > | All (VisibilityEnum visCrit=SComp.ANY_VISIBILITY) |
Get all the SImage in the document. | |
static Object | EstimatePose (SImage imageToEstimate, Array< SPoint > crdModel3D, Array< SPoint > crdUVImage, Object options) |
Estimate the pose of an SImage using reference points. | |
static Object | EstimatePose (SImage imageToEstimate, string path, Object options) |
Estimate the pose of an SImage using reference points from a file. | |
static Object | ExportOrthoImage (string outputFilePath, SVector viewDirection, SVector horizontalNormal, SPoint upperLeftCorner, number backgroundColor, number widthInDocumentUnit, number heightInDocumentUnit, number pixelSize, number pointAndLineSize, number Quality=-1) |
Export an ortho SImage and create a georeferencing file. | |
static Object | FromFile (string fileName, number imageType=0) |
Import an image and create a new SImage from a file. The function automatically detects image type (spherical, ortho, perspective, abstract) and loads calibration or georeferencing information. The image type can also be forced by using the SImage.SImageType in input. If SImage.ABSTRACT type is set, the automatically detected image type won't be changed. File extensions authorized: .bmp, .tif, .jpg, .png. | |
static Array< SImage > | FromName (string name) |
Search all the SImage with the given name. | |
static Object | FromPix4DProject (string fileName) |
Import SImage from a Pix4D project. | |
static Array< SImage > | FromSel () |
Get all the selected SImage. | |
static SImage | New (SImage other, SImageType imageType=SImage.ABSTRACT) |
Construct an SImage by copying the SImage other and setting the SImage.SImageType in input. If ABSTRACT type is set, the image type of the SImage other is used. | |
static Object | SphericalFromPerspectiveImages (Array< SImage > images, number clusteringDistance, SCloud cloud=null) |
Convert perspective SImage to spherical SImage. | |
![]() | |
static Array< SComp > | All (VisibilityEnum visCrit=SComp.ANY_VISIBILITY) |
Get all the SComp in the document. | |
static Object | FromClick () |
Launch an interaction to select a SComp in the scene. | |
static Array< SComp > | FromName (string name) |
Search all the SComp with the given name. | |
static Array< SComp > | FromSel () |
Get all the selected SComp. | |
Provide image edition methods.
Requires the Survey license.
enum SImage::SImageType |
The type of the SImage.
Enumerator | |
---|---|
ABSTRACT | Abstract image. |
PERSPECTIVE | Perspective image. |
SPHERICAL | Spherical image. |
ORTHO | Ortho image. |
SImage::SImage | ( | SImage | other, |
SImageType | imageType = SImage.ABSTRACT ) |
Construct an SImage by copying the SImage other and setting the SImage.SImageType in input. If ABSTRACT type is set, the image type of the SImage other is used.
other | (SImage) The other SImage to copy |
imageType | (SImageType) The image type
|
|
static |
Get all the SImage in the document.
visCrit | (VisibilityEnum) Visible selection criteria
|
Object SImage::ClearMask | ( | ) |
Clear the link between an SImage and its texture mask.
ret.ErrorCode | (number) The error code
|
Object SImage::CreateMaskAuto | ( | ) |
Create an automatic mask from the SImage.
ret.ErrorCode | (number) The error code
|
|
static |
Estimate the pose of an SImage using reference points.
imageToEstimate | (SImage) The SImage to estimate the pose of. |
crdModel3D | (Array<SPoint>) The 3D coordinates. |
crdUVImage | (Array<SPoint>) The texture UV coordinates. |
options | (Object) Data structure containing computation options. This data structure have to contain the following fields:
|
ret.Value | (number) The sum of the residual re-projection errors. |
ret.ErrorCode | (number) The error code
|
ret.Image | (SImage) The SImage with its new estimated pose. |
|
static |
Estimate the pose of an SImage using reference points from a file.
imageToEstimate | (SImage) The SImage to estimate the pose of. |
path | (string) The path of the file where reference points are stored. |
options | (Object) Data structure containing computation options. This data structure have to contain the following fields:
|
ret.Value | (number) The sum of the residual re-projection errors. |
ret.ErrorCode | (number) The error code
|
ret.Image | (SImage) The SImage with its new estimated pose. |
|
static |
Export an ortho SImage and create a georeferencing file.
outputFilePath | (string) The file (with path) to save. |
viewDirection | (SVector) The view direction (perpendicular to the created picture). |
horizontalNormal | (SVector) The horizontal direction. |
upperLeftCorner | (SPoint) The upper left corner of the image. |
backgroundColor | (number) The background color -> backgroundColor = ColBlue * 2^16 + ColGreen * 2^8 + ColRed. |
widthInDocumentUnit | (number) The width of the image, in document unit. |
heightInDocumentUnit | (number) The height of the image, in document unit. |
pixelSize | (number) The size of a single pixel, in document unit. |
pointAndLineSize | (number) The line width, point size and font size are scaled by this factor. This factor applies to the resulting image pixels, and thus depends on pixelSize. |
Quality | (number) Quality level of the output picture. Supported for following formats: jpg/jpeg, png
|
ret.ErrorCode | (number) The error code
|
|
static |
Import an image and create a new SImage from a file.
The function automatically detects image type (spherical, ortho, perspective, abstract) and loads calibration or georeferencing information.
The image type can also be forced by using the SImage.SImageType in input. If SImage.ABSTRACT type is set, the automatically detected image type won't be changed.
File extensions authorized: .bmp, .tif, .jpg, .png.
fileName | (string) The path and name of the image file to import |
imageType | (number) The image type |
|
static |
|
static |
Import SImage from a Pix4D project.
fileName | (string) The path and name of the .p4d file to read |
|
static |
Object SImage::GetCameraExternalParameters | ( | ) |
Get the external camera parameters of perspective and spherical SImage.
ret.ErrorCode | (number) The error code
|
ret.CameraExternal | (SCameraExternal) The camera external parameters |
Object SImage::GetCameraInternalParameters | ( | ) |
Get the internal camera parameters of a perspective SImage.
ret.ErrorCode | (number) The error code
|
ret.CameraInternal | (SCameraInternal) The camera internal parameters |
Object SImage::GetImageType | ( | ) |
Get the type of the SImage.
ret.ImageType | (SImageType) The image type
|
Object SImage::GetOrthoParameters | ( | ) |
Object SImage::GoToCameraViewpoint | ( | ) |
Go to the camera viewpoint.
ret.ErrorCode | (number) The error code
|
boolean SImage::HasMask | ( | ) |
|
static |
Construct an SImage by copying the SImage other and setting the SImage.SImageType in input. If ABSTRACT type is set, the image type of the SImage other is used.
other | (SImage) The other SImage to copy |
imageType | (SImageType) The image type
|
Save the image into a file.
filePath | (string) The complete file path to save into |
coordinateSystemMatrix | (SMatrix) The matrix to define a UCS used for the export (or identity to use the WCS) |
ret.ErrorCode | (number) The error code
|
Object SImage::SetCameraExternalParameters | ( | SCameraExternal | externalParams | ) |
Set the external camera parameters for perspective and spherical SImage.
externalParams | (SCameraExternal) The camera external parameters |
ret.ErrorCode | (number) The error code
|
Object SImage::SetCameraInternalParameters | ( | SCameraInternal | internalParams | ) |
Set the internal camera parameters for a perspective SImage.
internalParams | (SCameraInternal) The camera internal parameters |
ret.ErrorCode | (number) The error code
|
Object SImage::SetMaskFromFile | ( | string | maskFilePath | ) |
Set the texture mask of the SImage from a file.
File extensions authorized: .bmp, .tif, .jpg, .png.
The texture mask image must have the same size as the current image.
maskFilePath | (string) The path of the file that contains the mask to apply. |
ret.ErrorCode | (number) The error code
|
Object SImage::SetOrthoParameters | ( | SPoint | position, |
number | rotation, | ||
number | pixelSize ) |
Set the ortho SImage parameters.
position | (SPoint) The insertion point (top left corner) |
rotation | (number) The rotation value in degrees |
pixelSize | (number) The pixel size of the ortho image in document unit |
ret.ErrorCode | (number) The error code
|
|
static |
Convert perspective SImage to spherical SImage.
images | (Array<SImage>) The table of SImage to convert. |
clusteringDistance | (number) The distance used to group images according to their positions. |
cloud | (SCloud) An optional cloud to improve image quality by computing a depth information. |
ret.ImageTbl | (Array<SImage>) The spherical images. |
ret.IndicesTbl | (Array<Array<number>>) The indices of the inputs images used to create each spherical image. |
ret.ErrorCode | (number) The error code:
|
string SImage::toString | ( | ) |
Get the type of the variable.