Skip to main content

Setting embedding from Matlab

Answered

Comments

10 comments

  • Official comment
    TDY_Demos
    Community team
    Expert (Gold)

    Hello Andrew,

    Just to summarize our findings here, the issue here is the older IIDC based camera has features which are not supported via genicam nodes, so genicam software such as Matlab can not access those nodes.

    There are a couple of options available to you.  These are not publicly available features, so for future viewers, if you need this functionality, please contact the Teledyne or Mathworks support teams accordingly:

    1.  You can make your changes in FlyCapture2 and override your cameras factory default memory channel.  This is not a publicly disclosed as we really don't want people overwriting their factory backup settings, as it could permanently brick the camera.  For users who need this functionality, please create a support ticket.

    2.  You could also use the Flycapture2 adapter in Matlab, and enable embedded information.  This is also not a public feature, but for users who need this feature, you can contact Mathworks support.

    If you can help confirm that both of these solutions have worked for you to embed metadata into your images in Matlab, that would be great.

    Thank you,
    Demos

  • TDY_Manuel
    Community team
    Expert (Gold)

    Hi Andrew,

    The GenTL adapter should use the GenICam node names. Do you see chunk data nodes in the camera settings?  

    Best regards,

    Manuel 

    0
  • Andrew Peters

    Hi Manuel - 

    Here's the code we use to open the camera in Matlab: 

    cam_DeviceName = 'Point Grey Research Chameleon3 CM3-U3-13Y3M';
    vidObj = videoinput('gentl',cam_DeviceName);
    src = getselectedsource(vidObj);

    And then the properties of src are:

    {'AccessPrivilegeAvailable'             }
        {'AcquisitionFrameCount'                }
        {'AcquisitionFrameRate'                 }
        {'AcquisitionFrameRateAuto'             }
        {'AcquisitionFrameRateEnabled'          }
        {'AcquisitionStatusSelector'            }
        {'ActivePageNumber'                     }
        {'ActivePageOffset'                     }
        {'ActivePageValue'                      }
        {'AutoExposureTimeLowerLimit'           }
        {'AutoExposureTimeUpperLimit'           }
        {'AutoFunctionAOIHeight'                }
        {'AutoFunctionAOIOffsetX'               }
        {'AutoFunctionAOIOffsetY'               }
        {'AutoFunctionAOIWidth'                 }
        {'AutoFunctionAOIsControl'              }
        {'AutoGainLowerLimit'                   }
        {'AutoGainUpperLimit'                   }
        {'BalanceRatio'                         }
        {'BalanceRatioSelector'                 }
        {'BalanceWhiteAuto'                     }
        {'BinningControl'                       }
        {'BinningHorizontal'                    }
        {'BinningVertical'                      }
        {'BlackLevel'                           }
        {'BlackLevelAuto'                       }
        {'BlackLevelClampingEnable'             }
        {'DataFlashPageCount'                   }
        {'DataFlashPageSize'                    }
        {'DecimationHorizontal'                 }
        {'DecimationVertical'                   }
        {'DeviceFamilyName'                     }
        {'DeviceFirmwareVersion'                }
        {'DeviceGenCPVersionMinor'              }
        {'DeviceGenCpVersionMajor'              }
        {'DeviceLinkThroughputLimit'            }
        {'DeviceMaxThroughput'                  }
        {'DeviceModelName'                      }
        {'DeviceSVNVersion'                     }
        {'DeviceScanType'                       }
        {'DeviceSerialNumber'                   }
        {'DeviceTemperature'                    }
        {'DeviceUserID'                         }
        {'DeviceVendorName'                     }
        {'DeviceVersion'                        }
        {'EndianessRegistersSupported'          }
        {'ExposureActiveMode'                   }
        {'ExposureAuto'                         }
        {'ExposureMode'                         }
        {'ExposureTime'                         }
        {'FamilyRegisterAvailable'              }
        {'Gain'                                 }
        {'GainAuto'                             }
        {'GainSelector'                         }
        {'Gamma'                                }
        {'GammaEnabled'                         }
        {'Hue'                                  }
        {'HueAuto'                              }
        {'HueEnabled'                           }
        {'LineDebouncerTimeRaw'                 }
        {'LineInverter'                         }
        {'LineMode'                             }
        {'LineSelector'                         }
        {'LineSource'                           }
        {'LineStatus'                           }
        {'LineStatusAll'                        }
        {'MessageChannelSupported'              }
        {'OnBoardColorProcessEnabled'           }
        {'ParameterSelector'                    }
        {'Parent'                               }
        {'PixelColorFilter'                     }
        {'PixelDynamicRangeMax'                 }
        {'PixelDynamicRangeMin'                 }
        {'RemoveLimits'                         }
        {'ReverseX'                             }
        {'ReverseY'                             }
        {'SBRMSupported'                        }
        {'Saturation'                           }
        {'SaturationAuto'                       }
        {'SaturationEnabled'                    }
        {'Selected'                             }
        {'SensorShutterMode'                    }
        {'Sharpness'                            }
        {'SharpnessAuto'                        }
        {'SharpnessEnabled'                     }
        {'SingleFrameAcquisitionMode'           }
        {'SourceName'                           }
        {'StringEncoding'                       }
        {'StrobeDelay'                          }
        {'StrobeDuration'                       }
        {'Tag'                                  }
        {'TestPattern'                          }
        {'Timestamp'                            }
        {'TimestampIncrement'                   }
        {'TimestampSupported'                   }
        {'TransmitFailureCount'                 }
        {'TransmitFrameCount'                   }
        {'TriggerActivation'                    }
        {'TriggerDelay'                         }
        {'TriggerDelayEnabled'                  }
        {'TriggerMode'                          }
        {'TriggerOverlap'                       }
        {'TriggerSelector'                      }
        {'TriggerSource'                        }
        {'Type'                                 }
        {'U3VCPCapability'                      }
        {'U3VCPEIRMAvailable'                   }
        {'U3VCPIIDC2Available'                  }
        {'U3VCPSIRMAvailable'                   }
        {'U3VCurrentSpeed'                      }
        {'U3VMaxAcknowledgeTransferLength'      }
        {'U3VMaxCommandTransferLength'          }
        {'U3VMessageChannelID'                  }
        {'U3VNumberOfStreamChannels'            }
        {'U3VVersionMajor'                      }
        {'U3VVersionMinor'                      }
        {'USB3LinkRecoveryCount'                }
        {'UserDefinedValue'                     }
        {'UserDefinedValueSelector'             }
        {'UserNameAvailable'                    }
        {'UserOutputSelector'                   }
        {'UserOutputValue'                      }
        {'V3_3Enable'                           }
        {'VideoMode'                            }
        {'WrittenLengthFieldSupported'          }
        {'pgrAutoExposureCompensationLowerLimit'}
        {'pgrAutoExposureCompensationUpperLimit'}
        {'pgrCurrentCorrectedPixelCount'        }
        {'pgrCurrentCorrectedPixelIndex'        }
        {'pgrCurrentCorrectedPixelOffsetX'      }
        {'pgrCurrentCorrectedPixelOffsetY'      }
        {'pgrDefectPixelCorrectionEnable'       }
        {'pgrDefectPixelCorrectionTestMode'     }
        {'pgrDefectPixelCorrectionType'         }
        {'pgrDevicePowerSupplySelector'         }
        {'pgrDeviceUptime'                      }
        {'pgrExposureCompensation'              }
        {'pgrExposureCompensationAuto'          }
        {'pgrHDRImageSelector'                  }
        {'pgrHDRModeEnabled'                    }
        {'pgrHDR_ExposureTimeAbs'               }
        {'pgrHDR_GainAbs'                       }
        {'pgrPowerSourcePresent'                }
        {'pgrPowerSupplyCurrent'                }
        {'pgrPowerSupplyEnable'                 }
        {'pgrPowerSupplyVoltage'                }
      {'pgrSensorDescription'                 }

    We see that there is a 'Timestamp' property, but when we try to set it we get an error saying it's read-only. We also don't see an option to enable embedding of the GPIO pin state, which is the main thing we need.

    Do you know if one of these options enables that, or if there's something else we need to do?

    0
  • TDY_Manuel
    Community team
    Expert (Gold)

    Hi Andrew, 

    Yes, timestamp can only be read and returns the current timestamp on the camera. 
    What firmware version are you using on the camera? 

    Best regards,
    Manuel 

    0
  • Andrew Peters

    Our firmware is: 1.13.3.0

    0
  • TDY_Manuel
    Community team
    Expert (Gold)

    That's too bad. That firmware does support chunk data. I think Matlab doesn't support it. 
    Unfortunately it doesn't seem to support user sets either, so you cannot save to a memory channel in Flycap2 and restore in Matlab. 

    The only option I can think of is to start the camera in Matlab and then enable embedded image data in FlyCap2. Maybe somebody else has a better idea. Let me ask around. 

    0
  • Andrew Peters

    Ok - thanks for asking around to see if there's an option to enable this. 

    Could I flash the camera to update the firmware if a newer version supports it?

    0
  • TDY_Manuel
    Community team
    Expert (Gold)

    No, I'm afraid your firmware already supports it. It seems to be Matlab that doesn't support this feature. 

    0
  • TDY_Demos
    Community team
    Expert (Gold)

    Hello Andrew,

    To summarize where we are at:

    1.  The CM3 camera is one of our older IIDC based cameras.  As such, some of the IIDC based features such as embedded image information do not have Genicam nodes.

    2.  The GenTL adapter in Matlab is a Genicam adapter, and as such, cannot access the CM3's non-exposed registers.

    3.  One option should be to run the camera in FlyCap2, enable your embedded information that you want, and save it to memory channel.  Then, when you start Matlab, the settings are kept.  However, I believe Matlab loads the factory default memory channel on startup, which overwrites your saved changes.  The UserSet nodes are also not exposed in Matlab, so you can not load the memory channel you saved your settings to.

    4.  Since CM3 is IIDC based, it does not have the genicam chunk data either, so that would not be an option for you to use either.

    So in summary, this is due to the camera having an IIDC feature that can only be set via register writes, and Matlab using GenTL which should not be writing direct registers.  So it is not really a firmware or software problem, but an issue of compatibility between standards.

    We are checking what kind of solutions we have to help you out, such as:
    - Is there a way to write registers in Matlab using a non-GenTL adapter (like the Flycapture2 matlab adapter)
    - Is there a way for us to overwrite the default memory channel of your camera to embed the image data, therefore Matlab will boot with that option enabled.

    We will check this out and get back to you on what we find.  Thank you for your patience.

    Demos

    0
  • Andrew Peters

    Hi Demos - thanks for all your help, I can confirm that I was able to successfully embed information in data collected via Matlab with both 1) the hardware memory override and 2) the undocumented Matlab adapter command. For my purposes, I'll use the second method to avoid causing hardware issues on the camera.

    0

Please sign in to leave a comment.

Powered by Zendesk