joshdoe / gst-plugins-vision

GStreamer plugins related to the field of machine vision
Other
134 stars 50 forks source link

pylonsrc: duplicate feature names #48

Open mrstecklo opened 3 years ago

mrstecklo commented 3 years ago

Different models of Basler cameras have different names for similar features. For example AcquisitionFrameRateAbs and AcquisitionFrameRate. Plugin can be modified to try all possible aliases is those cases. Care must be taken though as some features are related but not equivalent. For example Gain and GainRaw, where Gain = f (GainRaw) and f() depends on a camera model.

Basler features documentation

I'll try to list all features with duplicate names. At least those already implemented in plugin. And then I'll develop a way to handle them. Any help is welcome

mrstecklo commented 3 years ago

Some of the features I've found

Name ------------------------- Alias-------------------------- Related not equivalent

ExposureTime ---------------- ExposureTimeAbs
AutoExposureTimeLowerLimit -- AutoExposureTimeAbsLowerLimit
AutoExposureTimeUpperLimit -- AutoExposureTimeAbsUpperLimit
WidthMax -------------------- IntegerFeatureMax(Width)
HeightMax ------------------- IntegerFeatureMax(Height)
AcquisitionFrameRate -------- AcquisitionFrameRateAbs
BalanceRatio ---------------- BalanceRatioAbs
BlackLevel --------------------------------------------------- BlackLevelRaw
GammaEnable ----------------- []
ColorAdjustmentEnable ------- []
ColorAdjustmentSelector ----- BslColorAdjustmentSelector
ColorAdjustmentHue ---------- BslColorAdjustmentHue ---------- ColorAdjustmentHueRaw
ColorAdjustmentSaturetion --- BslColorAdjustmentSaturation --- ColorAdjustmentSaturationRaw
Gain --------------------------------------------------------- GainRaw
AutoGainLowerLimit ------------------------------------------- AutoGainRawLowerLimit
AutoGainUpperLimit ------------------------------------------- AutoGainRawUpperLimit
CenterX ------------------------------------------------------ BslCenterX
CenterY ------------------------------------------------------ BslCenterY
LightSourceSelector ------------------------------------------ LightSourcePreset
mrstecklo commented 3 years ago

Some more features. And with the previous comment it is (almost) a complete list of features with duplicates already implemented in pylonsrc.

Name ------------------------- Alias-------------------------- Related not equivalent

FrameBurstStart ------------- Acquisition Start
DemosaicingMode ---------------------------------------------- PgiMode
NoiseReduction -------------- NoiseReductionAbs
SharpnessEnhancement -------- SharpnessEnhancementAbs
AutoTargetBrightness ----------------------------------------- AutoTargetValue
GainMinimum ----------------- MinimizeGain
ExposureMinimum ------------- MinimizeExposureTime
mrstecklo commented 3 years ago

At first I thought that feature name strings could be extended to an array of aliases. this would introduce a generic way to handle duplicates. But it also has a big overhead on features with no aliases. So I think that we should simply add required checks for proper names.

As for features like Gain and GainRaw that implement related feature but their values are not equivalent. Those are never both supported by a given camera. So I think they can be safely treated as aliases by the plugin. Assuming than user is aware of which version of a feature is implemented in their camera.

During my research I've also noticed that gst_pylonsrc_set_colour_transformation is probably erroneous. See code example in Basler documentation on color transformation

joshdoe commented 3 years ago

Thanks for gathering these, unfortunate that Pylon doesn't transparently handle changed names.

thiesmoeller commented 3 years ago

The difference on feature naming is encoded in SFNC version supported ( GetSfncVersion())

Check the Basler pylon c++ documentation regarding ( MigrationMode and "Migrating Existing Code for Using SFNC 2.x-Based Camera Devices" ) There we offer the tables of feature names that have direct counterparts, describe the automatic "MigrationMode" feature and the very advanced features, that are different in implementation, and need a different programming model.