Unibrain Fire-i.net SDK manual Programmer’s Manual & Reference
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
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
12 Camera = Manager.GetCameraFromGUID(guid); Next, we need to connect the Camera object to our FireiPreviewControl object. This is done with a singl
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
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
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
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
17 Camera. GetFeatures(true, FireiFeatureGroup.All). ForEach(f => FeaturesList.Items.Add(f.Name)); This takes care of the listbox population. Now
18 Next, we assign that method to the FrameReceived event. A good place for that would be immediately before calling Camera.Run: Camera.FrameReceived
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
2 Table of ContentsTABLE OF CONTENTS ... 2 INTRODUCTION ...
20 operation, by using a derivative of the FireiStreamFormat object, called FireiUserDefinedStreamFormat (as opposed to the FireiFixedStreamFormat).
21 of FireiStreamFormat. This identifier can be used to retrieve this specific stream format from the camera, using its RetrieveStreamFormatFromIdent
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
23 C# syntax string StringGUID = Guid.ToString(); InitFromString method Prototype public void InitFromString(string guidString) Comments The InitFrom
24 FireiManager The FireiManager object is the starting point for the selection and construction of cameras. It itself can be constructed directly. B
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
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
27 C# syntax FireiGUID guid; if (Manager.SelectCamera(out guid)) Camera = Manager.GetCameraFromGUID(guid); FireiRegister The FireiRegister object is
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
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
3 MaxValueString property ... 62 Unit property ... 62 AbsoluteValu
30 C# syntax Reg.SwapEndianess(); FireiTrigger The FireiTrigger object encapsulates all the Trigger functionality that the camera may support. An ins
31 Visual Basic syntax Dim On As Boolean On = Trigger.Enabled 'get Trigger. Enabled = True 'set C# syntax bool On; On
32 Value property Prototype public bool Value Comments This property reads/sets the Trigger_Value field of the camera trigger control register (bit 1
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
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
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
36 Reload method Prototype Reload() Comments This method reloads the values of the trigger control register from the camera, so effectively it acts a
37 C# syntax Trigger.Save(); FireiStreamFormat The FireiStreamFormat object encapsulates the video format settings relevant to a given camera. A Fir
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
39 Visual Basic syntax Dim Resolution As FireiResolution Resolution = StreamFormat.Resolution C# syntax FireiResolution Resolution = StreamFormat.Re
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
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
41 RawModeOverride property Prototype FireiRawMode RawModeOverride Comments This is a read/write property that allows the programmer to establish if
42 Height property Prototype ushort Height Comments This is a read only property that returns the resolution height of the streaming format. This is
43 Visual Basic syntax StreamFormat.Save() C# syntax StreamFormat.Save();
44 FireiFixedStreamFormat The FireiFixedStreamFormat object is derived from FireiStreamFormat. It carries any additional functionality that pertains
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
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
47 Visual Basic syntax Dim Supported As Boolean Supported = Fixed.IsFrameRateSupported(FireiFrameRate.fps30) C# syntax bool Supported = Fixed.IsFrame
48 FireiUserDefinedStreamFormat The FireiUserDefinedStreamFormat object is derived from FireiStreamFormat. It carries any additional functionality th
49 Visual Basic syntax Dim Top As UShort Top = UserDefined.Top C# syntax ushort Top = UserDefined.Top; Bottom property Prototype ushort Bottom Commen
5 Technical Details Architecture The following illustration shows how the various Unibrain APIs interact with each other, and how they are abstracted
50 Visual Basic syntax Dim Height As UShort Height = UserDefined.Height C# syntax ushort Height = UserDefined.Height; MaxWidth property Prototype ush
51 HPosUnit = UserDefined.HorizontalPositionUnit C# syntax ushort HPosUnit = UserDefined.HorizontalPositionUnit; VerticalPositionUnit property Protot
52 C# syntax ushort HUnit = UserDefined.HeightUnit; MaxPacketSize property Prototype ushort MaxPacketSize Comments This is a read only property that
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,
54 SetROI method Prototype SetROI(ushort left, ushort top, ushort width, ushort height) Comments This method is used to set the desired coordinates a
55 FireiFeature The FireiFeature object encapsulates all functionality related to a camera feature. It contains all the information available through
56 Supported = Feature.IsSupported C# syntax bool Supported = Feature.IsSupported; HasAbsolute property Prototype Boolean HasAbsolute Comments This i
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
58 HasManual property Prototype Boolean HasManual Comments This is a read-only property that will return whether this FireiFeature supports setting i
59 Absolute property Prototype Boolean Absolute Comments This is a read/write property that will retrieve or set whether this FireiFeature will use “
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
60 Visual Basic syntax Dim Auto As Boolean Auto = Feature.AutoMode 'get Feature.AutoMode = True 'set C# syntax bool Aut
61 C# syntax bool HasSoftAbsolute = Feature.HasSoftAbsolute; SoftAbsolute property Prototype Boolean SoftAbsolute Comments This is a read/write prope
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
63 Visual Basic syntax Dim Unit As FireiFeatureUnit Unit = Feature.Unit C# syntax FireiFeatureUnit Unit = Feature.Unit; AbsoluteValue property Protot
64 MaxAbsoluteValue property Prototype float MaxAbsoluteValue Comments This is a read-only property that will return the maximum value that can be se
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
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
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
68 If for some reason the operation is unsuccessful, an exception will be thrown. Visual Basic syntax Frame.SaveToFile("c:\Frame1.bmp") C#
69 ToBitmap method Prototype System.Drawing.Bitmap ToBitmap() Comments This method will return the frame data as a System.Drawing.Bitmap object. Any
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
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
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,
72 Visual Basic syntax Frame.DrawStringRGB("Foo", 0, 0, Me.Font, 0, 0, 0) C# syntax Frame.DrawStringRGB("Foo", 0, 0, this.Font, 0
73 FireiCamera The FireiCamera object encapsulates all functionality pertaining to the camera itself; therefore it could be considered to be the “cen
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
75 Trigger property Prototype FireiTrigger Trigger Comments This is a read-only property that will retrieve the currently selected FireiTrigger of th
76 Gain property Prototype FireiFeature Gain Comments This is a read-only property that can be used to retrieve directly the FireiFeature object for
77 ColorVR property Prototype FireiFeature ColorVR Comments This is a read-only property that can be used to retrieve directly the FireiFeature objec
78 Focus property Prototype FireiFeature Focus Comments This is a read-only property that can be used to retrieve directly the FireiFeature object fo
79 Sharpness property Prototype FireiFeature Sharpness Comments This is a read-only property that can be used to retrieve directly the FireiFeature o
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
80 The three implemented algorithms are ordered “Best Performance → Best Quality”. BilinearInterpolation is the default setting. Please note that the
81 C# syntax FireiRegister Register = Camera.ReadRegister(0x404); WriteRegister method Prototype void WriteRegister(uint offset, FireiRegister regist
82 C# syntax FireiRegister Register = Camera.ReadCommand(&H504); WriteCommand method Prototype void WriteCommand(uint offset, FireiRegister regis
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
84 GetFeature method Prototype FireiFeature GetFeature(string featureName) Comments This is a method that can be used to retrieve the FireiFeature ob
85 Comments This method when called will bring up a “Stream Format Selector” dialog, as constructed and maintained internally by the APIs. Through th
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
87 C# syntax Camera.AttachPreviewCtrl(FireiPreviewCtrl1); Run method Prototype Run() Comments This method will start the streaming of the camera. If
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
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
9 This will bring up the “Choose Control Items” dialog of Visual Studio. On the “.NET Framework Components” tab, select and mark the FireiPreviewCont
90 bool supportedOnly, FireiFeatureGroup featureGroup ) Comments This method will construct and return a generic list of FireiFeatures. It will cont
91 ushort edgeSize, byte red, byte green, byte blue, byte alpha ) Comments This method constructs and returns a System.Drawing.Bitmap object, that co
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
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:
94 Visual Basic syntax Dim Identifier As UInteger Identifier = Camera.StreamFormat.Identifier Dim StreamFormat As FireiStreamFormat StreamFormat = Ca
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