当前位置: 首页 > news >正文

达浒镇网站建设公司搭建网站需要学什么软件

达浒镇网站建设公司,搭建网站需要学什么软件,建设电影网站数据库脚本,网站做视频转流量Baumer工业相机堡盟工业相机如何通过BGAPI SDK直接实现Mono16位深度的图像保存#xff08;C##xff09; Baumer工业相机Baumer工业相机保存位深度12/16位图像的技术背景代码案例分享1#xff1a;引用合适的类文件2#xff1a;通过BGAPI SDK直接保存Mono12/16图像3#xf… Baumer工业相机堡盟工业相机如何通过BGAPI SDK直接实现Mono16位深度的图像保存C# Baumer工业相机Baumer工业相机保存位深度12/16位图像的技术背景代码案例分享1引用合适的类文件2通过BGAPI SDK直接保存Mono12/16图像3使用BGAPI SDK的图像直接转换Mono12/16图像并保存的功能 工业相机使用位深度12/16位图像的优点工业相机使用位深度12/16位图像的行业应用 Baumer工业相机 Baumer工业相机堡盟相机是一种高性能、高质量的工业相机可用于各种应用场景如物体检测、计数和识别、运动分析和图像处理。 Baumer的万兆网相机拥有出色的图像处理性能可以实时传输高分辨率图像。此外该相机还具有快速数据传输、低功耗、易于集成以及高度可扩展性等特点。 ​ Baumer工业相机通过使用BGAPI SDK进行开发时在C环境可以直接实现位深度为16的图像保存。 Baumer工业相机保存位深度12/16位图像的技术背景 工业相机通常用于需要高质量图像的分析和检查的专业环境中。这些相机被设计用来捕捉16比特的高比特深度的图像与低比特深度的图像相比可以捕捉到更大范围的色彩和细节。 保存位深16位图像的工业相机的技术背景涉及几个关键部分。首先相机的图像传感器必须能够捕捉到高比特深度的图像。这是通过使用高质量的图像传感器来实现的该传感器能够以每像素16比特的分辨率捕获数据。 其次相机的电子设备必须能够处理和存储高比特深度的图像数据。这意味着相机需要有一个高速处理器和足够的内存来处理所产生的大量图像数据。 第三相机的软件必须能够支持16位图像的保存。这意味着相机的固件和软件接口必须被设计成能够处理16位图像所产生的更大的文件尺寸并且还能与工业标准文件格式如TIFF和RAW兼容。 总的来说保存16位深度图像的工业相机的技术背景涉及高质量的图像传感器、强大的电子器件和专门的软件的组合这些都是为了处理捕捉和存储高位深度图像的独特需求。 这里主要描述如何在C#的平台下通过BGAPI SDK直接实现Mono16图像格式的保存功能的核心代码 代码案例分享 本文介绍使用BGAPI SDK对Baumer的工业相机进行开发时直接实现Mono12或者Mono16图像格式的保存功能 如下为核心代码实现步骤 1引用合适的类文件 C#环境下核心代码如下所示 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using System.IO; using CSCameraDemo.Properties; using System.Globalization; using WindowsFormsApplication1; using System.Threading.Tasks; using System.Threading; using System.Drawing.Imaging;using BGAPI2; 2通过BGAPI SDK直接保存Mono12/16图像 下面为在在C#环境开启相机连接相机后通过转换图像格式实现Mono12或者Mono16图像格式保存的核心代码。 如下所示 SystemList Open a System Get the InterfaceList and fill it Open an Interface Get the DeviceList and fill it Open a Devicevoid mDataStream_NewBufferEvent(object sender, BGAPI2.Events.NewBufferEventArgs mDSEvent) {try{BGAPI2.Buffer mBufferFilled null; mBufferFilled mDSEvent.BufferObj;if (mBufferFilled null){MessageBox.Show(Error: Buffer Timeout after 1000 ms!);}else if (mBufferFilled.IsIncomplete true){//MessageBox.Show(Error: Image is incomplete!);//queue buffer againmBufferFilled.QueueBuffer();}else{#region//获取当前FrameIDFrameIDInt (int)mBufferFilled.FrameID;OnNotifySetFrameID(FrameIDInt.ToString());#endregion//将相机内部图像内存数据转为bitmap数据System.Drawing.Bitmap bitmap new System.Drawing.Bitmap((int)mBufferFilled.Width, (int)mBufferFilled.Height, (int)mBufferFilled.Width,System.Drawing.Imaging.PixelFormat.Format8bppIndexed, (IntPtr)((ulong)mBufferFilled.MemPtr mBufferFilled.ImageOffset));#region//Mono图像数据转换。彩色图像数据转换于此不同System.Drawing.Imaging.ColorPalette palette bitmap.Palette;int nColors 256;for (int ix 0; ix nColors; ix){uint Alpha 0xFF;uint Intensity (uint)(ix * 0xFF / (nColors - 1));palette.Entries[ix] System.Drawing.Color.FromArgb((int)Alpha, (int)Intensity, (int)Intensity, (int)Intensity);}bitmap.Palette palette;#endregionlong currenttime (long)mBufferFilled.Timestamp; DateTime sdasd GetTime(currenttime, true);#region//回调函数保存图像功能if (bSaveImg){//使用bitmap自带函数保存string strtime DateTime.Now.ToString(yyyyMMddhhmmssfff);string saveimagepath pImgFileDir \\ strtime .jpg;// bitmap.Save(saveimagepath, System.Drawing.Imaging.ImageFormat.Bmp);//使用opencv进行保存图像if (mBufferFilled.PixelFormat Mono8){OpenCvSharp.Mat matgray OpenCvSharp.Extensions.BitmapConverter.ToMat(bitmap);//用bitmap转换为mat matgray.SaveImage(opencv_image.png);Cv2.ImWrite(opencvcv_image_Clone.png, matgray);Cv2.ImWrite(saveimagepath, matgray);} //将相机中原始图像数据通过BGAPI SDK直接保存为16位深度的图像if (mBufferFilled.PixelFormat.Contains(Mono12)){short[] mImageBuffer16Copy new short[(uint)((uint)mBufferFilled.Width * (uint)mBufferFilled.Height * 1)];Marshal.Copy((IntPtr)mBufferFilled.MemPtr, mImageBuffer16Copy, 0, (int)((int)mBufferFilled.Width * (int)mBufferFilled.Height * 1));//convert Mono12 to Mono16uint length (uint)((uint)mBufferFilled.Width * (uint)mBufferFilled.Height) * 1;for (uint l 0; l length; l){mImageBuffer16Copy[l] (short)(mImageBuffer16Copy[l] 4);}saveimagepath pImgFileDir \\ strtime -Mono16.png;saveMono16Tiff(saveimagepath , mImageBuffer16Copy, (int)mBufferFilled.Width, (int)mBufferFilled.Height * 1);}bSaveImg false;//变量控制单次保存图像}#endregion#region//bitmap的图像数据复制pBitmapBitmap clonebitmap (Bitmap)bitmap.Clone();BitmapData data clonebitmap.LockBits(new Rectangle(0, 0, clonebitmap.Width, clonebitmap.Height), ImageLockMode.ReadOnly, clonebitmap.PixelFormat);clonebitmap.UnlockBits(data);pBitmap clonebitmap;#endregion#region//将pBitmap图像数据显示在UI界面PictureBox控件上prcSource.X 0;prcSource.Y 0;prcSource.Width (int)mBufferFilled.Width;prcSource.Height (int)mBufferFilled.Height;System.Drawing.Graphics graph System.Drawing.Graphics.FromHwnd(pictureBoxA.Handle);graph.DrawImage(pBitmap, prcPBox, prcSource, GraphicsUnit.Pixel);#endregionclonebitmap.Dispose(); //清除临时变量clonebitmap所占内存空间mBufferFilled.QueueBuffer();}}catch (BGAPI2.Exceptions.IException ex){{string str2;str2 string.Format(ExceptionType:{0}! ErrorDescription:{1} in function:{2}, ex.GetType(), ex.GetErrorDescription(), ex.GetFunctionName());MessageBox.Show(str2);}}return; } 3使用BGAPI SDK的图像直接转换Mono12/16图像并保存的功能 下面为在在C#环境开启相机连接相机后通过BGAPI SDK直接实现Mono12或者Mono16图像格式保存的核心代码。 如下所示 public static void saveMono16Tiff(string fileName, short[] shortarray, int imagewidth, int imageheight) {FileStream FileST new FileStream(fileName, FileMode.Create);// Create the writer for data.BinaryWriter binWriter new BinaryWriter(FileST);// Write data to Test.data.ushort data16 0;uint data32 0;uint sizeX (uint)imagewidth;uint sizeY (uint)imageheight;int imagelength2 imagewidth * imageheight;// TIFF identifier and count of directory entries//data16 0x4949; // identifier II for little-endian byte orderbinWriter.Write(data16);data16 42; // tiff identifier 42binWriter.Write(data16);data32 8; // offset for the first IFDbinWriter.Write(data32);data16 12; // number of directory entriesbinWriter.Write(data16);// 1. entry: ImageWidth (number of columns)//data16 0x100; // tag: 100.HbinWriter.Write(data16);data16 4; // type: LONGbinWriter.Write(data16);data32 1; // count: 1binWriter.Write(data32);data32 sizeX; // value: horizontal image sizebinWriter.Write(data32);// 2. entry: ImageLength (number of rows)//data16 0x101; // tag: 101.H binWriter.Write(data16);data16 4; // type: LONGbinWriter.Write(data16);data32 1; // count: 1binWriter.Write(data32);data32 sizeY; // value: horizontal image sizebinWriter.Write(data32);// 3. entry: BitsPerSample//data16 0x102; // tag: 102.H binWriter.Write(data16);data16 3; // type: SHORTbinWriter.Write(data16);data32 1; // count: 1 SamplesPerPixel Mono16binWriter.Write(data32);data32 16; // SamplesPerPixel 1 value: 16 (16 bps NOT BASELINE!)binWriter.Write(data32);// 4. entry: Compression//data16 0x103; // tag: 103.H binWriter.Write(data16);data16 3; // type: SHORTbinWriter.Write(data16);data32 1; // count: 1 binWriter.Write(data32);data32 1; // value: 1 (no compression)binWriter.Write(data32);// 5. entry: PhotometricInterpretation//data16 0x106; // tag: 106.H binWriter.Write(data16);data16 3; // type: SHORTbinWriter.Write(data16);data32 1; // count: 1 binWriter.Write(data32);data32 1; // SamplesPerPixel 1 value: 1 (BlackIsZero)binWriter.Write(data32);// 6. entry: StripOffsets//data16 0x111; // tag: 111.H binWriter.Write(data16);data16 4; // type: LONGbinWriter.Write(data16);data32 1; // count: 1 StripsPerImagebinWriter.Write(data32);data32 174; // value 8 2 12*12 4 8 8 174binWriter.Write(data32);// 7. entry: SamplesPerPixel//data16 0x115; // tag: 115.H binWriter.Write(data16);data16 3; // type: SHORTbinWriter.Write(data16);data32 1; // count: 1 binWriter.Write(data32); ;data32 1; // SamplesPerPixel 1 Mono16binWriter.Write(data32);// 8. entry: RowsPerStrip//data16 0x116; // tag: 116.H binWriter.Write(data16);data16 4; // type: LONGbinWriter.Write(data16);data32 1; // count: 1binWriter.Write(data32);data32 sizeY; // value: vertical image size (one strip only)binWriter.Write(data32);// 9. entry: StripByteCounts (For each strip, the number of bytes in the strip after compression.)//data16 0x117; // tag: 117.H binWriter.Write(data16);data16 4; // type: LONGbinWriter.Write(data16);data32 1; // count: 1 StripsPerImagebinWriter.Write(data32);data32 2 * 1 * sizeX * sizeY; // value 2* 1 * SizeX * SizeYbinWriter.Write(data32);// 10. entry: XResolution (The number of pixels per ResolutionUnit in the ImageWidth direction.)//data16 0x11A; // tag: 11A.H binWriter.Write(data16);data16 5; // type: RATIONALbinWriter.Write(data16);data32 1; // count: 1 binWriter.Write(data32);data32 158; // offset to value 8 (2 12*12 4) 158binWriter.Write(data32);// 11. entry: YResolution (The number of pixels per ResolutionUnit in the ImageLength direction.)//data16 0x11B; // tag: 11B.H binWriter.Write(data16);data16 5; // type: RATIONALbinWriter.Write(data16);data32 1; // count: 1 binWriter.Write(data32);data32 166; // offset to value 8 (2 12*12 4) 8 166binWriter.Write(data32);// 12. entry: ResolutionUnit (The unit of measurement for XResolution and YResolution.)//data16 0x128; // tag: 128.H binWriter.Write(data16);data16 3; // type: SHORTbinWriter.Write(data16);data32 1; // count: 1 binWriter.Write(data32);data32 2; // value: 2 (Inch) dpibinWriter.Write(data32);data32 0; // offset of next IFD: nonebinWriter.Write(data32);// write IFD values longer than 4 byte//data32 72; // XResolution numerator: 72 72 dpi (a common value..)binWriter.Write(data32);data32 1; // XResolution denominator: 1binWriter.Write(data32);data32 72; // YResolution numerator: 72 72 dpi (a common value..)binWriter.Write(data32);data32 1; // YResolution denominator: 1binWriter.Write(data32);// end of header save to file// save image data (converted from Mono12 to Mono16) to filefor (int i 0; i imagelength2; i){data16 (ushort)shortarray[i];binWriter.Write(data16);}// close filebinWriter.Close();FileST.Close();return;} // end of saveMono16Tiff() 工业相机使用位深度12/16位图像的优点 更好的图像细节12/16位图像可以捕捉到更多的细节和颜色深度提供更高的图像质量。 更广泛的动态范围12/16位图像允许在明暗变化很大的场景中捕捉到更多的细节和颜色以及更好的光线控制。 更低的噪声采用12/16位图像可以减少噪声使得图像更加清晰。 更好的后期处理12/16位图像可以在后期处理中更灵活地进行平滑、增加对比度和其他调整。 因此工业相机使用12/16位图像可以提供更高质量的图像更好的细节和颜色控制并为后期处理提供更多的灵活性。 工业相机使用位深度12/16位图像的行业应用 医疗成像工业相机可用于各种医疗成像应用例如X射线成像MRI和CT扫描。这些应用需要16位图像位深度来提供高质量的成像结果。 汽车制造工业相机可以用于汽车制造中的各种应用例如质量控制和检查。这些应用需要高分辨率和16位图像位深度以检测并处理微小的缺陷或问题。 机器人视觉工业相机的高速度和高精度对于机器人视觉应用非常重要。机器人需要能够识别和定位目标同时能够处理16位图像位深度的高质量图像。 智能交通系统工业相机也可以用于智能交通系统中。例如交通监控摄像机需要高质量的图像以便能够识别和跟踪车辆行人和其他交通标志。 总之工业相机使用16位图像位深度的行业应用范围非常广泛它们可以用于各种不同的应用以提供高质量的成像结果和精确的图像处理功能。
http://www.dnsts.com.cn/news/20627.html

相关文章:

  • 西安网站建设有限公司做一手房有哪些网站比较好啊
  • 企业的网站建设费账务处理企业网站建设项目描述
  • 旅游网站开发说明书商业授权书
  • 涿州网站开发分销平台网站建设
  • 个人网站建设方案书例文企业微信app官网下载
  • 广州网站建设联系信科海珠西安有什么好玩的地方适合年轻人
  • 如何做幸运28网站代理二次元wordpress主题生成
  • 图书网站开发做h5商城网站
  • 规划设计导航网站如何建立一个视频网站
  • 湖北自适应网站建设价格wordpress 首页地址
  • 番禺手机网站建设平面设计专业哪个学校最好
  • 建设网站服务器怎么弄百度上海总部
  • 买国外域名 网站微信公众号用什么开发
  • 人工智能自动做网站wordpress导航栏文字大小不一
  • 兰州网站制作联系方式完全删除wordpress
  • 搭建源码下载站网站广州互联网公司排行榜
  • 厦门 网站建设公司肇庆做网约车
  • 淘宝刷单网站制作宁波网站推广方式
  • 建设网站要求有哪些小程序开发模板
  • 深圳龙华汽车网站建设图片免费设计在线生成
  • 做亳州旅游网站的目的网站名字备案
  • 建设一个网站价格eclipse 网站开发过程
  • 个人适合建什么网站太极seo
  • 东莞市住建局官网网站如何开通企业邮箱
  • 网站开发游戏程序开发什么叫专业建设
  • 做网站接口多少钱vps主机访问网站
  • 做交通分析的网站谷歌云宝塔搭建WordPress
  • 高端网站建设公司名称直播视频网站建设
  • 彩票网站 在哪里做代理网页浏览
  • php招聘网站建设网站开发兼职网站