Nowadays I am using Honeywell IP camera for image processing application.But unfortunately I couldn't manage to open it using opencvsharp in c# programming.
So, I would like to share some part of my code and I am using ethernet cable to connect it directly(cable from my notebook to Ip camera).I defined static ip to my laptop and I am able to connect it using default ip configuration via internet explorer.But I am not able to connect and open this camera using c# programming.
I tried all relevant links to make it work as below.Any help would be highly apreciated.
string v2 = #"http://192.168.0.101:5060/h264";
CvCapture camera = new CvCapture(v2)
string v2 = #"http://admin:admin#192.168.0.101:564/h264";
string v2 = #"rtsp://admin:admin#192.168.0.101:564/h264";
string v2 = #"http://192.168.0.101:564/img/video.mjpeg";
string v2 = #"http://admin:admin#192.168.0.101:564/img/video.mjpeg";
string v2 = #"http://192.168.0.101:564/img/video.mjpeg";
string v2 = #"http://192.168.0.101:564/img/video.asf";
string v2 = #"http://192.168.0.101:564/img/video.mjpeg";
All these methods are defined according to related link below(I tried almost all but I couldn be successful
http://www.camera-sdk.com/p_183-how-to-connect-to-your-honeywell-ip-camera-onvif.html``
related image
You can use http://www.aforgenet.com/framework/docs/html/dbf7400d-fbe9-e770-57aa-f63bc507c917.htm JPGStream to capture your video.
_videoSource = new JPEGStream(ConnectionString);
_videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
_videoSource.Start();
And after capture you can process you images with opencv.
you can use ONVIF DEVICE MANAGER
then you can find the url of your ip camera
like:
rtsp://192.168.1.188/media?stream=0
Related
Have been working on WPF application where users current location had to be identified (it is configurable in settings = no anonymous tracking for private data). Several solutions has been tested.
Alternative number 1 - works fine on different computers, also with VPN is on. Location is tracked based on IP address and everything seems to be good. However downside of this is that it uses external sources, like third party websites for getting IP address and then read that IP address to get the location.
public string GetPublicIP()
{
String direction = string.Empty;
WebRequest request = WebRequest.Create("http://website/");
using (WebResponse response = request.GetResponse())
using (StreamReader stream = new StreamReader(response.GetResponseStream()))
{
direction = stream.ReadToEnd();
}
//Search for the ip in the html
// code here
return direction;
}
Alternative number 2 - C# Geolocator class. This works fine with additional JSON file with geolocation coordinates and location data. However on corporate computer PositionChanged event is not firing for some reason. Not sure is it blocked somehow. No exceptions, but location is not recognized due to event is not firing. On my personal computer same solution works fine (same Windows version - Windows 10). Geolocator.ReportInterval = 1000; is also not force firing event every 1 second.
private void RunGeoTracker()
{
if (Geolocator == null)
{
Geolocator = new Geolocator();
Geolocator.DesiredAccuracy = PositionAccuracy.High;
Geolocator.MovementThreshold = 100; // The units are meters.
Geolocator.ReportInterval = 1000;
Geolocator.PositionChanged += this.PositionChanged;
}
}
private async void PositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
await Dispatcher.InvokeAsync(() =>
{
// code here
}
}
Are there are any alternatives, preferably without using any REST API or websites. Preferably using JSON or database for getting location data. I heard there is some PowerShell solution? Can't find examples. I mean basically Latitude and Longitude are needed. All the rest can be already achieved.
The Windows-native Geolocator API is limited by the wide variety of states a Windows laptop can be in - airplane mode, location settings disabled in common Windows settings, disabled in application-specific settings, or merely that no data providers are available to the OS (GPS satellites, WiFi triangulation, internet connectivity, OEM hardware and firmware etc.). So, any strategy to use OS-specific Geolocator API is contingent on your application (a) needing high-accuracy GPS fix, (b) involving mobility - e.g a worker driving with their open laptop in a car, or (c) ability to guide the user through UX that helps them get a location fix.
That said, do check if your Geolocator object initialization is done correctly via the steps in Microsoft's documentation - they matter!
IP geolocation has its limitations around VPN users, but it has much fewer ways of failing once you ship the software to real-world PCs and laptops. The following REST API for example will not only auto-detect the device's public IP but also respond with the approximate city-level location, including coarse latitude+longitude.
https://ep.api.getfastah.com/whereis/v1/json/auto?fastah-key=<trial_key>
The JSON response may look as follows, where the public IP is echoed back to your client application:
{
"ip": "146.75.209.1",
"isEuropeanUnion": false,
"locationData": {
"countryName": "Australia",
"countryCode": "AU",
"cityName": "Canberra",
"cityGeonamesId": 2172517,
"lat": -35.28,
"lng": 149.13,
"tz": "Australia/Sydney",
"continentCode": "OC"
}
}
The trick is to use IP location APIs that constantly update themselves as the internet and mobile landscape evolve fast.
Disclaimer: I am the developer of the above Fastah API service, so I may be a bit biased here :)
I've been building a program to easily configure newly imaged computers (setting DNS servers, IP address, gateway, adding to AD, adding optional printers, etc). I had it working in PowerShell, but I've been trying to port it to C#, mainly to combine lots of small scripts in one, add a nice user interface, and as practice to get better at C#. It's been going well so far, but I've been having some trouble with adding a printer.
Here's the PowerShell script I was using to configure the network printer:
Add-PrinterPort -name ESDPRT500 -PrinterHostAddress $ReceiptPrinterIP
Set-Printer -Name "EPSON TM-T88IV Receipt" -PortName ESDPRT500
I've been looking at the following C# code, but it appears to only set a printer by TCP/IP port, whereas I believe my port is under "EPSON Port Handler"?
ManagementClass portClass = new ManagementClass("Win32_TCPIPPrinterPort");
ManagementObject portObject = portClass.CreateInstance();
portObject["Name"] = portName;
portObject["HostAddress"] = "174.30.164.15";
portObject["PortNumber"] = portNumber;
portObject["Protocol"] = 1;
portObject["SNMPCommunity"] = "public";
portObject["SNMPEnabled"] = true;
portObject["SNMPDevIndex"] = 1;
PutOptions options = new PutOptions();
options.Type = PutType.UpdateOrCreate;
portObject.Put(options);
Could anyone point me in the right direction given how my printer is configured? I've found examples for installing drivers and adding printers via TCP/IP port #s, but haven't had much luck with this. Thanks!
I am using Lecia Disto e7100i which basically measures distance and area using laser. This device has bluetooth and can be paired with windows.
I am trying to develop an wpf app that reads the mesaured data using c#
There is no sdk that comes along with the device.
I have tried to use 32feet.Net but since there is no proper documentation I don't know where to start.
Is there any way that I can do to solve my problem?
This is not a full response, instead its more of a guideline on how to resolve your issue:
Pair the device with your Computer
Run the included software that displays the data somehow
Use WireShark to analyze the traffic
see if it is a standard protocol type or something custom
understand the protocol and reimplement it using c# and BluetoothSockets
To get started, you can try:
var client = new BluetoothClient();
// Select the bluetooth device
var dlg = new SelectBluetoothDeviceDialog();
DialogResult result = dlg.ShowDialog(this);
if (result != DialogResult.OK)
{
return;
}
BluetoothDeviceInfo device = dlg.SelectedDevice;
BluetoothAddress addr = device.DeviceAddress;
Console.WriteLine(device.DeviceName);
BluetoothSecurity.PairRequest(addr, "PIN"); // set the pin here or take user input
device.SetServiceState(BluetoothService.HumanInterfaceDevice, true);
Thread.Sleep(100); // Precautionary
if (device.InstalledServices.Length == 0)
{
// handle appropriately
}
client.Connect(addr, BluetoothService.HumanInterfaceDevice);
Also make sure that
Device appears in "Bluetooth devices" in the "Control panel".
Device is HID or change code accordingly.
Hope it helps. Cheers!
Try this demo project, and the following articles after that one.
Try to follow this tutorial
Here you can see a direct answer by the mantainer of 32feet, with which you can get in touch
Check also this answer
I have problem when connect IP of camera like http://192.168.1.101.
I've seen in emgu document the url must like:
Capture cap = new Capture("rtsp://username:password#[IP Address]/mpeg4/media.amp");
But my camera use in LAN.
How to connect camera with IP http://? If it impossible, I hope anybody can say any solution for that.
Like convert http:// protocol to rtsp:// protocol.
Thank you very much!!!
One thing I would suggest is make sure you are using Emgu CV V3 not any of the lower versions.
If you are using it in lan it will still have an IP address and an RTSP port,
All I type in for my camera is:
Capture cap = new Capture("rtsp://username:password#cameraIP:RtspPort");
cap.ImageGrabbed += ProcessFrame;
cap.Start();
Then my ProcessFrame looks like this:
private void ProcessFrame(object sender, EventArgs e)
{
Mat image = new Mat();
_capture.Retrieve(image);
imageBox1.BackgroundImage = image.Bitmap;
}
So I have spent the whole night looking like a zombie in the morning trying to figure out how the OS handles an NFC tap for an NDEFLaunchApp Record and I have known the following.
I'm pretty sure that there is a workaround which lets you launch a system app / third party app (if you know the product Id / GUID) from your app. As there are apps in the Windows Phone Store which I have somehow figured out what I've been trying to.
I have come up with the following code:
NdefLaunchAppRecord appLaunchRecord = new NdefLaunchAppRecord();
appLaunchRecord.AddPlatformAppId("WindowsPhone", "{App GUID}");
appLaunchRecord.Arguments = "_default";
// Creating a new NdefMessage from the above record.
var message = new NdefMessage { appLaunchRecord };
// Getting the record from the message that we just created
foreach (NdefLaunchAppRecord record in message)
{
var specializedType = record.CheckSpecializedType(false);
if (specializedType == typeof(NdefLaunchAppRecord))
{
var x = String.Join(" ", record.Payload);
// Getting the payload by GetString gets a formatted Uri with args
string result = System.Text.Encoding.UTF8.GetString(record.Payload, 0, record.Payload.Length);
// result = "\0\fWindowsPhone&{5B04B775-356B-4AA0-AAF8-6491FFEA5630}\0\b_default";
// result = "(null)(form feed)WindowsPhone&{App GUID}(null)(backspace)_default
// So this will be sent to the OS and I believe the OS will then launch the specified app by an unknown protocol
// like xxx://result
// and the app will be launched?
// So is it then possible to somehow call the following:
await Windows.System.Launcher.LaunchUriAsync(new Uri("OUR MAGIC RESULT?", UriKind.RelativeOrAbsolute));
If anyone has / can figure out a way for this, it would be a REAL Service to the WP Community as developers are restricted by Microsoft to open certain settings / apps which are actually needed by those apps. For instance (speech settings, audio settings, about settings, alarms, region settings, date+time);
APPS that possibly have a workaround:
Music Hub Tile (Launches the old Music+Videos Hub)
http://www.windowsphone.com/en-gb/store/app/music-hub-tile/3faa2f9e-6b8d-440a-bb60-5dd76a5baec1
Tile for Bing Vision
http://www.windowsphone.com/en-gb/store/app/tile-for-bing-vision/05894022-e18c-40a4-a6cc-992383aa7ee8
There are reserved uri schemes for bing and zune.
See: http://msdn.microsoft.com/en-us/library/windows/apps/jj207065(v=vs.105).aspx
Those two apps propably use these and have found some undocumented use of the scheme.
If there is an uri scheme that launches any app by guid from within your app, it is hidden well.
Currently you can only launch apps that registered for an uri scheme or file association.