iSensor APP 之 摄像头调试 OV5642

iSensor app 非常适合调试各种摄像头,已测试通过的sensor有:

l  OV7670、OV7725、OV9650、OV9655、OV9653、OV5642、OV5640、OV5620

l  MT9T001、MT9M001、MT9P031、MT9V032、MT9V034、MT9D001、MT9D112、MT9D111

 

今天又重新测试了下OV5642,特此留下文档,已说明整个isensor使用过程不同sensor。

先看OV5642,500w像素 首先可以查到该sensor设备地址为0x78,寄存器格式为地址16bit,数据8bit,于是按照ov7725配置文件模版,将5642配置寄存器粘贴到新建的配置文件中,加载成功后,点击开始采集:

 

对于isensor的使用可以参考此目录下的说明书。

http://pan.baidu.com/s/1sk171wh  iSensor APP云盘地址

然而对于ov5642 摄像头,寄存器若不进行正常配置,pclk将没有输出,所以必须进行配置才能保证sensor正常的工作,启动isensor,直接点击采集就可以采集到图像,只是图像设置和实际不对应,显示不对而已。

 

先参考下硬件设计图

其中PD0和PD1分别连接sensor的sclk和sdat,用于配置各sensor的寄存器配置。

68013工程可以预先针对某一款sensor进行配置,我们提供预先编译好的iic文件可以通过CyConsole.exe进行下载更新,重新上电即可,开始按照预定的方式进行采集。

对于ov5642,我们预先编译了

其中USB_Camera_Demo_5642_RAW_5M.iic 代表 ov5642  分辨率为5M 即2592*1944   格式为RAW

USB_Camera_Demo_5642_YUV_VGA.iic 代表 ov5642  分辨率为VGA 即640*480格式为YUV

USB_Camera_Demo_5642_RAW_VGA_15fps.iic  代表 ov5642  分辨率为VGA 即640*480格式为RAW

 

此板卡默认会下载此程序《USB_Camera_Demo_5642_RAW_VGA_15fps.iic  》,因为isensor app kit 默认启动分辨率配置也是如此。

下载对应IIC程序,必须重新上电,重新启动软件才能正常采集,在采集前,先按停止采集,然后设置对应分辨率进行采集。

硬件测试

 

可以看到当前分辨率为640*480  0.3M像素  帧率为15fps

 

然后下载USB_Camera_Demo_5642_RAW_5M.iic 

板卡重新上电,

先停止采集

然后设置分辨率为:5M  2592*1944  此时可以看到下面状态栏 分辨率是否设置正确。

然后再点击开始采集

此时可以看到:分辨率为5M  帧率为3.7fps

 

 

软件注册

参考图示:

1、说明当前软件未注册,按照说明手册,注册完毕,重启即可。

2、说明当前为设置的默认图像格式 640*480,0.3M像素。

软件注册:

复制REG_ID:ZCFJGKADADVYZCZCEHIM

发送至:shenyae86@163.com 邮箱,获取注册码

注册码:DE4CB9AD423C0248DF8086E27F9863(通过发送邮件获得此注册码)

 

然后软件执行目录下的iSensorInit.ini 文件,使用记事本打开

替换注册码,保存,重启软件即可。

 

iSensor App kit 上位机配置文件方式更新分辨率操作

若要使用isensor app kit  上位机配置修改sensor的配置信息,则必须下载《iSensor_FX2_OV5xxx_20150515.iic》固件,然后重新上电。

此时若点击开始采集,因为该固件没有默认配置任何寄存器,所以无法采集到图像。

可以通过如下操作

菜单: 工具-》系统配置-》配置

通过此按钮可以加载文本的 sc配置文件,下面可以看下sc文件格式

其中0x1a代表特殊命令:用于设置地址和其他参数,

0x32用于指定寄存器地址和值(代表16bit地址和8bit数据)

此加载参数为同步方式,加载完后,关闭此窗口,重新点击停止和开始即可采集(需要设置好对应分辨率,分辨率必须停止后才能设置生效。不能重新上电,此参数为实时配置并非固化)

 

目前已经做好两种分辨率得配置模版

可以参考此模版完成自己所需自定义分辨率参数的配置

 

通过上述操作,基本可以熟悉isensor的使用和各种sensor寄存器配置特征,

注意:0v5642 灵敏度低,白天的拍照效果相对于夜晚效果好很多,当然也依赖于寄存器的合理配置,请参考数据手册和我们提供的demo自行研究,

 

720p 拍照效果

 

 

 

转载于:https://www.cnblogs.com/xiheji/p/5255034.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是OpenHardwareMonitorLib.h文件的代码示例: ```csharp using System; using System.Runtime.InteropServices; namespace OpenHardwareMonitor.Hardware { public enum SensorType { Voltage, Clock, Temperature, Load, Fan, Flow, Control, Level, Factor, Power, Data, SmallData, Throughput, ClockMultiplier, Unknown } public enum HardwareType { Mainboard, SuperIO, CPU, RAM, GpuNvidia, GpuAti, TBalancer, Heatmaster, HDD, SSD, LCDScreen, Fans, Pump, TEC, Generic, Unknown } [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct Sensor { public string Name; public string Identifier; public float Value; public SensorType SensorType; public Hardware Hardware; public int Index; public bool IsDefaultHidden; } [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct Hardware { public string Name; public string Identifier; public HardwareType HardwareType; public int Index; public IHardware[] SubHardware; public ISensor[] Sensors; } public interface IComputer { string GetReport(); IHardware[] Hardware { get; } void Traverse(Action<IHardware> action); void Traverse(Action<IHardware, IHardware> action); void Open(); void Close(); bool IsOpen { get; } } public interface IHardware { string Name { get; } string Identifier { get; } HardwareType HardwareType { get; } IHardware[] SubHardware { get; } ISensor[] Sensors { get; } void Traverse(Action<IHardware> action); void Traverse(Action<IHardware, IHardware> action); void Update(); int Index { get; } } public interface ISensor { string Name { get; } string Identifier { get; } float Value { get; } SensorType SensorType { get; } IHardware Hardware { get; } int Index { get; } bool IsDefaultHidden { get; } } public interface ISettings { bool? GetValue(string id); void SetValue(string id, bool value); } public class UpdateVisitor : IVisitor { public void VisitComputer(IComputer computer) { computer.Traverse(new Action<IHardware>(VisitHardware)); } public void VisitHardware(IHardware hardware) { hardware.Update(); } public void VisitSensor(ISensor sensor) { } public void VisitParameter(IParameter parameter) { } public void VisitIdentifier(IIdentifier identifier) { } } public class Computer : IComputer { private readonly UpdateVisitor updateVisitor = new UpdateVisitor(); private readonly IdentifierVisitor identifierVisitor = new IdentifierVisitor(); private readonly HardwareVisitor hardwareVisitor = new HardwareVisitor(); private readonly SensorVisitor sensorVisitor = new SensorVisitor(); private readonly ParameterVisitor parameterVisitor = new ParameterVisitor(); private ISettings settings; private readonly IHardware[] hardware; public Computer() { hardware = new IHardware[0]; } public Computer(ISettings settings) { this.settings = settings; IntPtr ptr = IntPtr.Zero; try { ptr = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.Initialize(); hardware = CreateHardware(ptr); } finally { if (ptr != IntPtr.Zero) OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.Close(ptr); } } public IHardware[] Hardware { get { return hardware; } } public void Open() { IntPtr ptr = IntPtr.Zero; try { ptr = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.Initialize(); hardwareVisitor.Reset(); OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.Update(ptr); hardwareVisitor.VisitComputerNode(ptr); } finally { if (ptr != IntPtr.Zero) OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.Close(ptr); } } public void Close() { } public bool IsOpen { get { return true; } } public string GetReport() { IntPtr ptr = IntPtr.Zero; try { ptr = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.Initialize(); return Marshal.PtrToStringAnsi(OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetReport(ptr)); } finally { if (ptr != IntPtr.Zero) OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.Close(ptr); } } public void Traverse(Action<IHardware> action) { foreach (IHardware hw in hardware) action(hw); } public void Traverse(Action<IHardware, IHardware> action) { foreach (IHardware hw in hardware) Traverse(hw, action); } private void Traverse(IHardware hardware, Action<IHardware, IHardware> action) { foreach (IHardware subHardware in hardware.SubHardware) { action(hardware, subHardware); Traverse(subHardware, action); } } private IHardware[] CreateHardware(IntPtr ptr) { hardwareVisitor.Reset(); OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.TraverseComputer(ptr, hardwareVisitor, IntPtr.Zero); return hardwareVisitor.Hardware; } } internal class HardwareVisitor : IVisitor { private readonly IdentifierVisitor identifierVisitor = new IdentifierVisitor(); private readonly SensorVisitor sensorVisitor = new SensorVisitor(); private readonly Hardware root = new Hardware(); private Hardware current; public HardwareVisitor() { current = root; } public Hardware[] Hardware { get { return root.SubHardware; } } public void Reset() { current = root; root.SubHardware = new IHardware[0]; } public void VisitComputerNode(IntPtr data) { VisitHardwareNode(data); } public void VisitHardwareNode(IntPtr data) { IntPtr ptr = Marshal.ReadIntPtr(data); Hardware hardware = new Hardware { Name = Marshal.PtrToStringAnsi(OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetHardwareName(ptr)), Identifier = identifierVisitor.GetIdentifier(ptr), HardwareType = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetHardwareType(ptr), Index = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetHardwareIndex(ptr) }; current.SubHardware = ArrayExtensions.Add(current.SubHardware, hardware); current = hardware; OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.TraverseSubtree(data, this, data); sensorVisitor.Reset(); OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.TraverseSensors(data, sensorVisitor, data); current.Sensors = sensorVisitor.Sensors; } public void VisitSensorNode(IntPtr data) { throw new NotImplementedException(); } public void VisitParameterNode(IntPtr data) { throw new NotImplementedException(); } public void VisitParameter(IntPtr parameter) { throw new NotImplementedException(); } } internal class IdentifierVisitor { public string GetIdentifier(IntPtr ptr) { IntPtr identifierPtr = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetHardwareIdentifier(ptr); return identifierPtr == IntPtr.Zero ? null : Marshal.PtrToStringAnsi(identifierPtr); } } internal class SensorVisitor : IVisitor { private readonly IdentifierVisitor identifierVisitor = new IdentifierVisitor(); private readonly System.Collections.Generic.List<ISensor> sensors = new System.Collections.Generic.List<ISensor>(); public ISensor[] Sensors { get { return sensors.ToArray(); } } public void Reset() { sensors.Clear(); } public void VisitComputerNode(IntPtr data) { throw new NotImplementedException(); } public void VisitHardwareNode(IntPtr data) { throw new NotImplementedException(); } public void VisitSensorNode(IntPtr data) { IntPtr ptr = Marshal.ReadIntPtr(data); sensors.Add(new Sensor { Name = Marshal.PtrToStringAnsi(OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetSensorName(ptr)), Value = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetSensorValue(ptr), SensorType = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetSensorType(ptr), Identifier = identifierVisitor.GetIdentifier(ptr), Hardware = new Hardware { Identifier = identifierVisitor.GetIdentifier(OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetSensorParent(ptr)) }, Index = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetSensorIndex(ptr), IsDefaultHidden = OpenHardwareMonitor.Interop.OpenHardwareMonitorLib.GetSensorIsDefaultHidden(ptr) }); } public void VisitParameterNode(IntPtr data) { throw new NotImplementedException(); } public void VisitParameter(IntPtr parameter) { throw new NotImplementedException(); } } internal class ParameterVisitor : IVisitor { public void VisitComputerNode(IntPtr data) { throw new NotImplementedException(); } public void VisitHardwareNode(IntPtr data) { throw new NotImplementedException(); } public void VisitSensorNode(IntPtr data) { throw new NotImplementedException(); } public void VisitParameterNode(IntPtr data) { throw new NotImplementedException(); } public void VisitParameter(IntPtr parameter) { throw new NotImplementedException(); } public void Dispose() { throw new NotImplementedException(); } } } ``` 该代码定义了一些枚举类型和接口,并实现了硬件监视器的基本功能,包括读取并解析硬件和传感器信息。请注意,该代码涉及一些C#语言的特性和语法,需要在支持C#编译的IDE或环境中使用。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值