Jump to content

Accessing Additional exposures for each image


---
 Share

Recommended Posts

I've created a python scrip that access the image acquisition for each scan to extract a circular object. I'm doing this many times <100 for a part so this lends itself to automation. The issue is that the background changes across the part - while the object i'm extracting stays the same. 

From what i understand the image i'm accessing as the default exposure associated with it, or maybe the first. But the scans that i've taken have more than one. How do I access these additional images? 

I am using the way the scripting documentation shows how to access them to begin with: 

 

    left = gom.api.project.get_image_acquisition (measurement, 'left camera', [0])[0]
    right = gom.api.project.get_image_acquisition (measurement, 'right camera', [0])[0]

The measurements here are taken from one of the measurements in the series - generally more than 10 of them:
 

scanImages = gom.app.project.measurement_series[measurement_series_name].measurements

Can someone help point me in the direction if i'm going down the wrong path. ideally i'd like to use the different exposures to threshold out the object i'm looking for instead of forcing something from the base exposure. 

Link to comment
Share on other sites

I think you have to just iterate through scans and measurements.

I can not verify this but something similar should do the trick:

for mserie in gom.app.project.measurement_series:
  for measurement in mserie.measurements:
    left  = gom.api.project.get_image_acquisition (measurement, 'left camera', [0])[0]
    right = gom.api.project.get_image_acquisition (measurement, 'right camera', [0])[0] 

Also you can use numbers instead of names ( example: gom.app.project.measurement_series[0] instead ...measurement_series['Scan1'] )

I often checking results via print to see what is in there.

Edited
Link to comment
Share on other sites

 Share

×
×
  • Create New...