matcher.cross_instrument_matcher — Multi-imstrument Matching Methods

The matcher.cross_instrument_matcher module

New in version 0.1.0.

autocnet.matcher.cross_instrument_matcher.generate_ground_points(Session, ground_mosaic, nspts_func=<function <lambda>>, ewpts_func=<function <lambda>>, size=(100, 100))[source]
Parameters
  • ground_db_config (dict) –

    In the form: {‘username’:’somename’,

    ’password’:’somepassword’, ‘host’:’somehost’, ‘pgbouncer_port’:6543, ‘name’:’somename’}

  • nspts_func (func) – describes distribution of points along the north-south edge of an overlap.

  • ewpts_func (func) – describes distribution of points along the east-west edge of an overlap.

  • size (tuple of int) – (size_x, size_y) maximum distances on either access point can move when attempting to find an interesting feature.

autocnet.matcher.cross_instrument_matcher.propagate_control_network(Session, config, dem, base_cnet, size_x=40, size_y=40, match_func='classic', match_kwargs={'image_size': (39, 39), 'template_size': (21, 21)}, verbose=False, cost=<function <lambda>>)[source]

Loops over a base control network’s measure information (line, sample, image path) and uses image matching algorithms (autocnet.matcher.subpixel.geom_match) to find the corresponding line(s)/sample(s) in database images.

Parameters
  • Session (sqlalchemy.sessionmaker) – session maker associated with the database containing the images you want to propagate to

  • config (dict) –

    configuation file associated with database containing the images you want to propagate to In the form: {‘username’:’somename’,

    ’password’:’somepassword’, ‘host’:’somehost’, ‘pgbouncer_port’:6543, ‘name’:’somename’}

  • dem (surface) – surface model of target body

  • base_cnet (pd.DataFrame) – Dataframe representing the points you want to propagate. Must contain ‘line’, ‘sample’ location of the measure and the ‘path’ to the corresponding image

  • verbose (boolean) – Increase the level of print outs/plots recieved during propagation

  • cost (anonymous function) – determines to which image(s) the point should be propagated. x corresponds to a list of all match correlation metrics, while y corresponds to each indiviudal element of the x array. Example: cost = lambda x,y: y == np.max(x) will get you one result corresponding to the image that has the maximum correlation with the source image cost = lambda x,y: y > 0.6 will propegate the point to all images whose correlation result is greater than 0.6

Returns

ground – Dataframe containing pointid, imageid, image serial number, line, sample, and ground location (both latlon and cartesian) of successfully propagated points

Return type

pd.DataFrame

autocnet.matcher.cross_instrument_matcher.propagate_point(Session, config, dem, lon, lat, pointid, paths, lines, samples, size_x=40, size_y=40, match_func='classic', match_kwargs={'image_size': (39, 39), 'template_size': (21, 21)}, verbose=False, cost=<function <lambda>>)[source]

Conditionally propagate a point into a stack of images. The point and all corresponding measures are matched against database network (to which you are propagating), best result(s) is(are) kept.

Parameters
  • Session (sqlalchemy.sessionmaker) – session maker associated with the database you want to propagate to

  • config (dict) –

    configuation file associated with database you want to propagate to In the form: {‘username’:’somename’,

    ’password’:’somepassword’, ‘host’:’somehost’, ‘pgbouncer_port’:6543, ‘name’:’somename’}

  • dem (surface) – surface model of target body

  • lon (np.float) – longitude of point you want to project

  • lat (np.float) – planetocentric latitude of point you want to project

  • pointid (int) – clerical input used to trace point from generate_ground_points output

  • paths (list of str) – absolute paths pointing to the image(s) from which you want to try porpagating the point

  • lines (list of np.float) – apriori line(s) corresponding to point projected in ‘paths’ image(s)

  • samples (list of np.float) – apriori sample(s) corresponding to point projected in ‘paths’ image(s)

  • size_x (int) – half width of GeoDataset that is cut from full image and affinely transfromed in geom_match; must be larger than 1/2 template_kwargs ‘image_size’

  • size_y (int) – half height of GeoDataset that is cut from full image and affinely transfromed in geom_match; must be larger than 1/2 template_kwargs ‘image_size’

  • template_kwargs (dict) – kwargs passed through to control matcher.subpixel_template()

  • verbose (boolean) – If True, this will print out the results of each propagation, including prints of the matcher areas and their correlation map.

  • cost (anonymous function) – determines to which image(s) the point should be propagated. x corresponds to a list of all match correlation metrics, while y corresponds to each indiviudal element of the x array. Example: cost = lambda x,y: y == np.max(x) will get you one result corresponding to the image that has the maximum correlation with the source image cost = lambda x,y: y > 0.6 will propagate the point to all images whose correlation result is greater than 0.6

Returns

new_measures – Dataframe containing pointid, imageid, image serial number, line, sample, and ground location (both latlon and cartesian) of successfully propagated points

Return type

pd.DataFrame