| Environments | PYTHON :: EASI |
| Quick links | Description :: Parameters :: Parameter descriptions :: Return Value :: Details :: Example :: Related |
| Back to top |
| Back to top |
gcpcand(mfile, dbic, srcbgd, loclmask, smplsrc, distrib, distnum, trials, proc, filo)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| MFILE * | str | Input file name, folder, or text file | 1 - | |
| DBIC | List[int] | Reference image channel(s) | 0 - | |
| SRCBGD | str | Source background value | 0 - | Default: FILE |
| LOCLMASK | str | Local exclusion mask | 0 - | Default: NONE |
| SMPLSRC | str | Candidate samples source | 0 - | SUSAN | GRID Default: GRID |
| DISTRIB | str | Distribution unit | 0 - | MAPSPACING | PIXELSPACING | ENTIRE Default: MAPSPACING |
| DISTNUM | str | Distribution number | 0 - | |
| TRIALS | List[int] | Number of trials per candidate | 0 - 1 | 1 - 8 Default: 1 |
| PROC | str | Processing algorithm | 0 - | |
| FILO | str | Output file or folder | 0 - |
| Back to top |
MFILE
The name of a folder, image file, or text file that contains the reference images from which to produce candidates. If necessary, you can use a wildcard (*) in the string.
If the MFILE you specify does not have a list of channels to process, the value of the DBIC (Input Channels) parameter is used.
When specifying file channels, you can specify individual channels or channel sequences. An individual channel index is a single positive integer (for example, "1"). A channel sequence is a positive integer followed by a comma and a negative number (for example, "1,-3"). In this example, "1,-3" means to process channels 1 through 3 inclusive; it is expanded internally to "1,2,3". The second channel number in the sequence must be greater than the first channel number.
If the MFILE you specify does not have the source background specification, the value of the SRCBGD parameter is used.
DBIC
The channel or channels in the reference-image file from which to extract the SUSAN corner features when using the SUSAN detector. When there are multiple channels, they are averaged together.
If the value of the DBIC parameter is in a text file (MFILE), this parameter is ignored.
If no value is specified for this parameter, the first channel is processed by default.
This parameter is ignored when the value of the SMPLSRC (Candidate samples source method) parameter is any option other than SUSAN.
SRCBGD
The pixels in the source image to consider as background (NoData) pixels. In general, if a pixel is considered NoData, GCPCAND processes the pixel in a specific manner.
FILE [, <value>]: same as FILE, but defines the NoData value for each channel, when metadata does not exist.
For example, the default value, "FILE, 0" specifies that GCPCAND uses metadata. If the metadata is unavailable, pixels with a value of 0 are considered NoData>.
LOCLMASK
Specify whether to apply a local mask to prevent points from being collected in those locations. If no value is specified for this parameter (default), or you specify a value, but one or more of the images do not contain a bitmap or vector segment, no local exclusion mask will be applied for those images.
LOCLMASK = (NONE | BIT | VEC | <n>)
This parameter is optional.
SMPLSRC
The source of sample points for the candidates
If no value is specified for this parameter, GRID is used by default.
The SUSAN and GRID options determine how to find the candidate positions in the reference image. AutoGCP will attempt to collect GCPs at these locations.
When collecting GCPs, the GRID option is preferred, because the SUSAN option finds candidates on building corners that may not be represented in the digital elevation model (DEM), leading to GCPs with higher residuals due to height errors.
DISTRIB
The unit of value to use for the DISTNUM parameter.
DISTNUM
TRIALS
The number of trials per candidate. Trials are backup candidates to try when the main candidate failed to match a given raw image. When there is an insufficient number of stereo GCPs, it is recommended that you use a denser distribution rather than more trials, as the backup trials are only collected if the main candidate failed to match for a particular image.
PROC
The amount of memory (in megabytes) used by GCPCAND.
If the host memory limit is not specified, the function uses a default of 1 gigabyte (GB) or half the available physical memory, whichever is less.
FILO
The vector segment GCPCAND creates will be named GCPCand and have a description of GCP candidate points.
| Back to top |
Returns: Vector segment number
Type: PCI_INT
Parameter: LASC
The segment number of the newly created vector segment is returned. When you have multiple input files, the segment number corresponds to the vector segment number in the last image.
When called from EASI, the return value is written to the LASC parameter in the PRM file.
This function returns a result only if it runs successfully; otherwise, processing stops, and an error message is displayed.
| Back to top |
GCPCAND generates candidates for automatic GCP collection by preprocessing reference images and writing a vector segment containing the generated candidates to a file. These candidates can be used by AUTOGCP to collect GCPs. The vector segment created by GCPCAND will be named GCPCand and have a description of GCP candidate points.
| Back to top |
The following example finds GCPs for an input image called "spotRaw.pix".
from pci.gcpcand import gcpcand
mfile = u"SPOT_MOSAIC.PIX"
dbic = [] # Integer
srcbgd = u""
loclmask = ""
smplsrc = u"GRID"
distrib = u"PIXELSPACING"
distnum = u"1000"
trials = [1] # Integer
proc = u""
filo = u"cSPOT_MOSAIC.PIX"
try:
gcpcand(mfile, dbic, srcbgd, loclmask, smplsrc, distrib, distnum, trials, proc, filo)
except Exception as e:
print(e)
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.