Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
With this sample, you can obtain and save the depth-source 2D image.
*/

using System;
using MMind.Eye;

class CaptureDepthSource2DImage
{
static int Main()
{
var camera = new Camera();
if (!Utils.FindAndConnect(ref camera))
return -1;

Frame2D frame = new Frame2D();
var errorStatus = camera.CaptureDepthSource2D(ref frame);
if (!errorStatus.IsOK())
{
Utils.ShowError(errorStatus);
Console.WriteLine("Press any key to exit ...");
Console.ReadKey();
return -1;
}

switch (frame.GetColorType())
{
case Frame2D.ColorTypeOf2DCamera.Monochrome:
var gray = frame.GetGrayScaleImage();
string grayScaleFile = "DepthSourceGrayScale2DImage.png";
gray.Save(grayScaleFile);
Console.WriteLine("Capture and save the depth-source gray scale 2D image: {0}", grayScaleFile);
break;
case Frame2D.ColorTypeOf2DCamera.Color:
var color = frame.GetColorImage();
string colorFile = "DepthSourceColor2DImage.png";
color.Save(colorFile);
Console.WriteLine("Capture and save the depth-source color 2D image: {0}", colorFile);
break;
default:
Console.WriteLine("The acquired depth-source 2D image has an unsupported color type.");
break;
}

camera.Disconnect();
Console.WriteLine("Disconnected from the camera successfully.");
Console.WriteLine("Press any key to exit ...");
Console.ReadKey();
return 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3C9D8BA2-9B0E-4E1F-A3E9-BD095D4F28C1}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>CaptureDepthSource2DImage</RootNamespace>
<AssemblyName>CaptureDepthSource2DImage</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>$(SolutionDir)/Build_debug/$(AssemblyName)</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>$(SolutionDir)/Build/$(AssemblyName)</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>$(SolutionDir)/Build_debug/$(AssemblyName)</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>$(SolutionDir)/Build/$(AssemblyName)</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CaptureDepthSource2DImage.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CaptureDepthSource2DImage Sample

With this sample, you can obtain and save the depth-source 2D image.

This sample is only applicable to camera models that provide the depth-source 2D image, such as Mech-Eye ULTRA M.

If you have any questions or have anything to share, feel free to post on the [Mech-Mind Online Community](https://community.mech-mind.com/). The community also contains a [specific category for development with Mech-Eye SDK](https://community.mech-mind.com/c/mech-eye-sdk-development/19).
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ private void Calibrate()
SaveExtrinsicParameters(cameraToBase.ToString());
}
break;
case "F":
var corner = new PointXYZ();
var status = calibration.ExtractCurrentImageFirstCorner(ref camera, ref corner);
Utils.ShowError(status);

if (status.IsOK())
Console.WriteLine("The first corner is: {0}, {1}, {2}", corner.X, corner.Y, corner.Z);
break;
default:
Console.WriteLine("Unknown command.");
break;
Expand All @@ -231,6 +239,7 @@ private string InputCommand()
Console.WriteLine("T: Obtain the 2D image with feature recognition result");
Console.WriteLine("A: Enter the current robot pose");
Console.WriteLine("C: Calculate extrinsic parameters");
Console.WriteLine("F: Obtain the first corner of current image");
return Console.ReadLine();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MechEyeApiNet">
<Version>2.5.2</Version>
<Version>2.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Loading