Unibrain API-810 User Manual Page 1

Browse online or download User Manual for Firewire cables Unibrain API-810. Documentation

  • Download
  • Add to my manuals
  • Print
  • Page
    / 95
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
Unibrain
Fire-i.net SDK manual
Programmer’s Manual & Reference
Page view 0
1 2 3 4 5 6 ... 94 95

Summary of Contents

Page 1 - Fire-i.net SDK manual

Unibrain Fire-i.net SDK manual Programmer’s Manual & Reference

Page 2 - Table of Contents

10 Visual Studio automatically sets the name of the control to be “fireiPreviewControl1”, which for our purpose will do nicely. Now it’s time to edit

Page 3

11 The above code fragment will iterate through the connected cameras, and stop at the first camera that is made by Unibrain. With the additional che

Page 4 - Introduction

12 Camera = Manager.GetCameraFromGUID(guid); Next, we need to connect the Camera object to our FireiPreviewControl object. This is done with a singl

Page 5 - Technical Details

13 The available choice will of course vary depending on which camera this is called upon; only supported formats will be presented. Also, the above

Page 6 - Helpers

14 Running the program will show live video on our control on the form, after selecting the desired camera and streaming format. If only one camera i

Page 7

15 see the reference section of this manual) of the camera, checks whether they support Auto setting and if they do, sets it. A GUI-driven way to man

Page 8

16 Firstly, we enlarge our form, to make way for the new controls: Then, we add the two controls. It is also a good idea to change their correspondi

Page 9

17 Camera. GetFeatures(true, FireiFeatureGroup.All). ForEach(f => FeaturesList.Items.Add(f.Name)); This takes care of the listbox population. Now

Page 10

18 Next, we assign that method to the FrameReceived event. A good place for that would be immediately before calling Camera.Run: Camera.FrameReceived

Page 11

19 This is what the outcome looks like: NOTE: The aliasing of the drawn lines and text is due to the enlargement of the picture in order for it to f

Page 12

2 Table of ContentsTABLE OF CONTENTS ... 2 INTRODUCTION ...

Page 13

20 operation, by using a derivative of the FireiStreamFormat object, called FireiUserDefinedStreamFormat (as opposed to the FireiFixedStreamFormat).

Page 14

21 of FireiStreamFormat. This identifier can be used to retrieve this specific stream format from the camera, using its RetrieveStreamFormatFromIdent

Page 15

22 Reference In the following reference of all interfaces implemented, “Long” is defined as a 32-bit signed integer value, and “Integer” is defined a

Page 16

23 C# syntax string StringGUID = Guid.ToString(); InitFromString method Prototype public void InitFromString(string guidString) Comments The InitFrom

Page 17

24 FireiManager The FireiManager object is the starting point for the selection and construction of cameras. It itself can be constructed directly. B

Page 18

25 The dialog presented looks similar to: The method returns true if a selection was made by the user and false if “Cancel” was pressed (no selectio

Page 19

26 It is most useful when: • A single camera is connected (a call with 0 index is sufficient). • The order in which the cameras are created is not

Page 20

27 C# syntax FireiGUID guid; if (Manager.SelectCamera(out guid)) Camera = Manager.GetCameraFromGUID(guid); FireiRegister The FireiRegister object is

Page 21

28 It is the equivalent of using the SetField method with the FromIndex and ToIndex parameters being equal to Index. Visual Basic syntax Reg.SetBit(5

Page 22 - Reference

29 Visual Basic syntax Reg.SetField(5, 7, 6) C# syntax Reg.SetField(5, 7, 6); GetFieldLen method Prototype public uint GetFieldLen(byte fromIndex, by

Page 23 - InitFromString method

3 MaxValueString property ... 62 Unit property ... 62 AbsoluteValu

Page 24 - FireiManager

30 C# syntax Reg.SwapEndianess(); FireiTrigger The FireiTrigger object encapsulates all the Trigger functionality that the camera may support. An ins

Page 25 - GetCameraFromIndex method

31 Visual Basic syntax Dim On As Boolean On = Trigger.Enabled 'get Trigger. Enabled = True 'set C# syntax bool On; On

Page 26 - GetCameraFromGUID method

32 Value property Prototype public bool Value Comments This property reads/sets the Trigger_Value field of the camera trigger control register (bit 1

Page 27 - FireiRegister

33 Comments This is a read only property that reflects the Presence_Inq field of the camera trigger inquiry register (bit 0). This property can alway

Page 28 - GetField method

34 Comments This is a read only property that reflects the On/Off_Inq field of the camera trigger inquiry register (bit 5). It is a necessary require

Page 29 - SwapEndianess method

35 Comments This property reads/sets the Parameter field of the camera trigger control register (bits 20 to 31). Since this is an optional field for

Page 30 - FireiTrigger

36 Reload method Prototype Reload() Comments This method reloads the values of the trigger control register from the camera, so effectively it acts a

Page 31 - Source property

37 C# syntax Trigger.Save(); FireiStreamFormat The FireiStreamFormat object encapsulates the video format settings relevant to a given camera. A Fir

Page 32 - IsSupported property

38 Y_MONO, YUV_411, YUV_422, YUV_444, RGB_24, Y_MONO_16, RGB_48, S_Y_MONO_16, S_RGB_48, RAW_8, RAW_16 Visual Basic syntax Dim PixelFormat As FireiPix

Page 33 - HasOnOff property

39 Visual Basic syntax Dim Resolution As FireiResolution Resolution = StreamFormat.Resolution C# syntax FireiResolution Resolution = StreamFormat.Re

Page 34 - Parameter property

Introduction The Fire-i.net SDK is the latest addition to ubCore™ and the Unibrain APIs. It provides an entirely new and comprehensive way to interact

Page 35 - IsModeSupported method

40 Comments This is a read only property that returns a unique identifier, in the form of a uint value that can be stored for later usage (e.g., to r

Page 36 - Save method

41 RawModeOverride property Prototype FireiRawMode RawModeOverride Comments This is a read/write property that allows the programmer to establish if

Page 37 - FireiStreamFormat

42 Height property Prototype ushort Height Comments This is a read only property that returns the resolution height of the streaming format. This is

Page 38 - Resolution property

43 Visual Basic syntax StreamFormat.Save() C# syntax StreamFormat.Save();

Page 39 - Identifier property

44 FireiFixedStreamFormat The FireiFixedStreamFormat object is derived from FireiStreamFormat. It carries any additional functionality that pertains

Page 40 - UserDefined property

45 Comments This is a read/write property that can be used to retrieve or set the frame rate of the FireiFixedStreamFormat. It is represented by an e

Page 41 - Width property

46 Comments This is a read only property that returns the number of packets per frame for this streaming format. This will be constant between succes

Page 42 - ToString method

47 Visual Basic syntax Dim Supported As Boolean Supported = Fixed.IsFrameRateSupported(FireiFrameRate.fps30) C# syntax bool Supported = Fixed.IsFrame

Page 43

48 FireiUserDefinedStreamFormat The FireiUserDefinedStreamFormat object is derived from FireiStreamFormat. It carries any additional functionality th

Page 44 - FireiFixedStreamFormat

49 Visual Basic syntax Dim Top As UShort Top = UserDefined.Top C# syntax ushort Top = UserDefined.Top; Bottom property Prototype ushort Bottom Commen

Page 45 - PacketsPerFrame property

5 Technical Details Architecture The following illustration shows how the various Unibrain APIs interact with each other, and how they are abstracted

Page 46 - IsFrameRateSupported method

50 Visual Basic syntax Dim Height As UShort Height = UserDefined.Height C# syntax ushort Height = UserDefined.Height; MaxWidth property Prototype ush

Page 47

51 HPosUnit = UserDefined.HorizontalPositionUnit C# syntax ushort HPosUnit = UserDefined.HorizontalPositionUnit; VerticalPositionUnit property Protot

Page 48 - FireiUserDefinedStreamFormat

52 C# syntax ushort HUnit = UserDefined.HeightUnit; MaxPacketSize property Prototype ushort MaxPacketSize Comments This is a read only property that

Page 49 - Bottom property

53 Setting this value to 0 means the SDK will try and determine the correct packet size automatically, either by setting it to the maximum possible,

Page 50 - MaxHeight property

54 SetROI method Prototype SetROI(ushort left, ushort top, ushort width, ushort height) Comments This method is used to set the desired coordinates a

Page 51 - HeightUnit property

55 FireiFeature The FireiFeature object encapsulates all functionality related to a camera feature. It contains all the information available through

Page 52 - PacketSizeUnit property

56 Supported = Feature.IsSupported C# syntax bool Supported = Feature.IsSupported; HasAbsolute property Prototype Boolean HasAbsolute Comments This i

Page 53 - F7Offset property

57 If this property is false, the Value property of FireiFeature should not be read, otherwise an exception would be thrown. This does not mean it ca

Page 54 - SetROI method

58 HasManual property Prototype Boolean HasManual Comments This is a read-only property that will return whether this FireiFeature supports setting i

Page 55 - FireiFeature

59 Absolute property Prototype Boolean Absolute Comments This is a read/write property that will retrieve or set whether this FireiFeature will use “

Page 56 - HasOnePush property

6 MS 1394.sys driver, which is known to have various issues with popular operating systems (Windows XP Service Pack 2 and Windows Vista included). In

Page 57 - HasAuto property

60 Visual Basic syntax Dim Auto As Boolean Auto = Feature.AutoMode 'get Feature.AutoMode = True 'set C# syntax bool Aut

Page 58 - MaxValue property

61 C# syntax bool HasSoftAbsolute = Feature.HasSoftAbsolute; SoftAbsolute property Prototype Boolean SoftAbsolute Comments This is a read/write prope

Page 59 - AutoMode property

62 Comments This is a read-only property that will retrieve the minimum allowed value of the feature as a textual representation. The string will inc

Page 60 - HasSoftAbsolute property

63 Visual Basic syntax Dim Unit As FireiFeatureUnit Unit = Feature.Unit C# syntax FireiFeatureUnit Unit = Feature.Unit; AbsoluteValue property Protot

Page 61 - MinValueString property

64 MaxAbsoluteValue property Prototype float MaxAbsoluteValue Comments This is a read-only property that will return the maximum value that can be se

Page 62 - Unit property

65 This method is available only if HasOnePush is true; calling it otherwise will result in an exception. Visual Basic syntax Feature.OnePush() C# sy

Page 63 - MinAbsoluteValue property

66 FireiFrame The FireiFrame object contains a single camera frame, allowing the programmer to read and write the image data pixel by pixel. It also

Page 64 - OnePush method

67 GetRGB method Prototype GetRGB(ushort x, ushort y, out byte red, out byte green, out byte blue) Comments This method returns the color value as a

Page 65

68 If for some reason the operation is unsuccessful, an exception will be thrown. Visual Basic syntax Frame.SaveToFile("c:\Frame1.bmp") C#

Page 66 - FireiFrame

69 ToBitmap method Prototype System.Drawing.Bitmap ToBitmap() Comments This method will return the frame data as a System.Drawing.Bitmap object. Any

Page 67 - SaveToFile method

7 Usage Scenario I – Simple video viewer Let’s start Microsoft Visual Studio 2008. Create a new empty project, of the “Windows Forms Application” var

Page 68 - Negative method

70 Visual Basic syntax Frame.DrawLine(0, 0, 50, 50, Drawing.Color.Black) C# syntax Frame.DrawLine(0, 0, 50, 50, Drawing.Color.Black); DrawString meth

Page 69 - DrawLine method

71 Visual Basic syntax Frame.DrawRectangle(0, 0, 50, 50, Drawing.Color.Black, False) C# syntax Frame.DrawRectangle(0, 0, 50, 50, Drawing.Color.Black,

Page 70 - DrawRectangle method

72 Visual Basic syntax Frame.DrawStringRGB("Foo", 0, 0, Me.Font, 0, 0, 0) C# syntax Frame.DrawStringRGB("Foo", 0, 0, this.Font, 0

Page 71 - DrawStringRGB method

73 FireiCamera The FireiCamera object encapsulates all functionality pertaining to the camera itself; therefore it could be considered to be the “cen

Page 72 - DrawRectangleRGB method

74 Model property Prototype string Model Comments This is a read-only property that can be used to retrieve the model name of the camera, as a string

Page 73 - FireiCamera

75 Trigger property Prototype FireiTrigger Trigger Comments This is a read-only property that will retrieve the currently selected FireiTrigger of th

Page 74 - StreamFormat property

76 Gain property Prototype FireiFeature Gain Comments This is a read-only property that can be used to retrieve directly the FireiFeature object for

Page 75 - AutoExposure property

77 ColorVR property Prototype FireiFeature ColorVR Comments This is a read-only property that can be used to retrieve directly the FireiFeature objec

Page 76 - ColorUB property

78 Focus property Prototype FireiFeature Focus Comments This is a read-only property that can be used to retrieve directly the FireiFeature object fo

Page 77 - Saturation property

79 Sharpness property Prototype FireiFeature Sharpness Comments This is a read-only property that can be used to retrieve directly the FireiFeature o

Page 78 - Brightness property

8 This will bring up the reference selection dialog of VS. In the “.NET” tab, select “Firei.net” and click on OK: This will add the Fire-i.net assem

Page 79 - RawConversion property

80 The three implemented algorithms are ordered “Best Performance → Best Quality”. BilinearInterpolation is the default setting. Please note that the

Page 80 - ReadRegister method

81 C# syntax FireiRegister Register = Camera.ReadRegister(0x404); WriteRegister method Prototype void WriteRegister(uint offset, FireiRegister regist

Page 81 - ReadCommand method

82 C# syntax FireiRegister Register = Camera.ReadCommand(&H504); WriteCommand method Prototype void WriteCommand(uint offset, FireiRegister regis

Page 82 - WriteBlock method

83 Comments This is a method that can be used to write a block of registers (quadlets) on the camera, given its offset and a byte buffer as parameter

Page 83 - GetMemoryPresetsCount method

84 GetFeature method Prototype FireiFeature GetFeature(string featureName) Comments This is a method that can be used to retrieve the FireiFeature ob

Page 84 - SelectStreamFormat method

85 Comments This method when called will bring up a “Stream Format Selector” dialog, as constructed and maintained internally by the APIs. Through th

Page 85

86 If on the other hand the DirectShow mode is currently running, the dialog will look similar to: Upon the return of the method, the streaming forma

Page 86 - AttachPreviewCtrl method

87 C# syntax Camera.AttachPreviewCtrl(FireiPreviewCtrl1); Run method Prototype Run() Comments This method will start the streaming of the camera. If

Page 87 - IsRunning method

88 Comments This method will return whether the camera is currently running. Please note that IsRunning will return true even if the camera was not s

Page 88 - DisplayProperties method

89 The presented dialog is almost exactly the same in appearance, regardless if DirectShow or DLL is the currently selected underlying mode, and it l

Page 89 - GetFeaturesEnumerator method

9 This will bring up the “Choose Control Items” dialog of Visual Studio. On the “.NET Framework Components” tab, select and mark the FireiPreviewCont

Page 90 - GetCameraPhoto method

90 bool supportedOnly, FireiFeatureGroup featureGroup ) Comments This method will construct and return a generic list of FireiFeatures. It will cont

Page 91 - LoadFromMemory method

91 ushort edgeSize, byte red, byte green, byte blue, byte alpha ) Comments This method constructs and returns a System.Drawing.Bitmap object, that co

Page 92 - LoadFromXML method

92 Comments This method will load all current features from a memory preset channel of the camera. Since channel 0 is reserved for the camera default

Page 93 - RetrieveStreamFormat method

93 If for any reason the settings cannot be loaded or set to the camera, an exception will be thrown. Visual Basic syntax Camera.LoadFromXML("c:

Page 94 - BufferReceived event

94 Visual Basic syntax Dim Identifier As UInteger Identifier = Camera.StreamFormat.Identifier Dim StreamFormat As FireiStreamFormat StreamFormat = Ca

Page 95 - CameraRemoved event

95 CameraRemoved event Prototype event System.EventHandler CameraRemoved Comments This event is only ever fired once during the lifecycle of the Fire

Comments to this Manuals

No comments