我是图像分析的新手.你知道如何以这种方式将这种图像二值化以获得光纤吗?

我尝试了不同的门限技术等,但我没有成功.我不介意我应该使用什么工具,但我更喜欢.NET或Matlab.
PS:我不知道在哪里提出答案,所以我把它放在StackOverflow上.
我有一个在Windows Server 2008 SE和64个处理器上运行的多进程.NET(F#)科学模拟.模拟的每个时间步长从1.5秒振荡到2秒.由于每个进程必须等待其他进程,因此总速度是最慢进程的速度(2秒*迭代次数).因此,我需要尽可能地减少过程的振荡.
有没有办法如何强制一组进程为他们的计算提供完全相同的"计算时间"?
Visual Studio 2012中的代码覆盖工具将所有inline功能标记为未覆盖,即使它们被覆盖.
有什么方法可以使代码覆盖inline功能适用于函数吗?
为什么fail值会抛出异常?fine价值有效.如果我删除inline或如果我转换't为float然后它的工作原理.
[<Struct>]
type Test<'t> =
val x: 't
val y: 't
new (x,y) = { x = x; y = y }
static member inline (+) ((x,y), a: _ Test) = 0
static member inline (-) ((x,y), a: _ Test) = 0
let a = 1.,2.
let b = Test(1.,2.)
let fine = a - b
let fail = a + b
Run Code Online (Sandbox Code Playgroud)
错误信息:
未处理的异常:System.TypeInitializationException:类型初始值设定项'AdditionDynamicImplTable
3' threw an exception. ---> System.NotSupportedExcep …
我已经从http://monodevelop.com/Download在Windows 8 x64上安装了Xamarin Studio 4.0.1 .当我运行Xamarin时,它已更新到4.0.3.我已经安装了F#绑定.我创建了新的F#控制台项目.当我运行它,它工作正常.当我设置一个断点并运行它时,我得到以下错误.任何想法,为什么会这样?
System.Runtime.InteropServices.COMException(0x80070032):不支持该请求.(从HRESULT异常:0x80070032)在Microsoft.Samples.Debugging.CorDebug.NativeApi.ICorDebug.CreateProcess(字符串lpApplicationName,字符串lpCommandLine,SECURITY_ATTRIBUTES lpProcessAttributes,SECURITY_ATTRIBUTES lpThreadAttributes,的Int32 bInheritHandles,UInt32的dwCreationFlags,IntPtr的lpEnvironment,字符串lpCurrentDirectory,STARTUPINFO lpStartupInfo,PROCESS_INFORMATION lpProcessInformation,CorDebugCreateProcessFlags debuggingFlags,ICorDebugProcess&ppProcess)at Microsoft.Samples.Debugging.CorDebug.CorDebugger.CreateProcess(String applicationName,String commandLine,SECURITY_ATTRIBUTES processAttributes,SECURITY_ATTRIBUTES threadAttributes,Boolean inheritHandles,Int32 creationFlags,IntPtr environment,String currentDirectory,STARTUPINFO startupInfo,PROCESS_INFORMATION&processInformation ,CorDebugCreateProcessFlags debuggingFlags)在Microsoft.Samples.Debugging.CorDebug.CorDebugger.CreateProcess(String applicationName,String commandLine,String currentDirectory,ID 在Mono.Debugging.Client.DebuggerSession的MonoDevelop.Debugger.Win32.CorDebuggerSession.OnRun(DebuggerStartInfo startInfo)中的ictionary`2环境,Int32标志.<> c__DisplayClassc.b__a()
在F#中有什么方法可以获取传递给函数的变量的名称吗?
例:
let velocity = 5
let fn v = v.ParentName
let name = fn velocity // this would return "velocity" as a string
Run Code Online (Sandbox Code Playgroud)
先感谢您
编辑:
为什么这段代码不起作用?它匹配为值,因此我无法检索"变量"名称.
type Test() =
let getName (e:Quotations.Expr) =
match e with
| Quotations.Patterns.PropertyGet (_, pi, _) -> pi.Name + " property"
| Quotations.Patterns.Value(a) -> failwith "Value matched"
| _ -> failwith "other matched"
member x.plot v = v |> getName |> printfn "%s"
let o = new Test()
let display () =
let variable …Run Code Online (Sandbox Code Playgroud) 尝试在F#interactive中运行它:
#r "System.ServiceModel"
#r "System.Runtime.Serialization"
open System.ServiceModel
[<ServiceContract>]
type IWCF =
[<OperationContract>]
abstract Ping: float -> unit
type WCF () =
interface IWCF with
member o.Ping a = printfn "Hello, %g" a
let svh = new ServiceHost (typeof<WCF>)
Run Code Online (Sandbox Code Playgroud)
你可能会成功.尝试制作新的解决方案.
参考:
将以下代码粘贴到Program.fs:
open System.ServiceModel
[<ServiceContract>]
type IWCF =
[<OperationContract>]
abstract Ping: float -> unit
type WCF () =
interface IWCF with
member o.Ping a = printfn "Hello, %g" a
let svh = new ServiceHost (typeof<WCF>)
Run Code Online (Sandbox Code Playgroud)
并运行它.我收到以下错误:
构成服务合同的操作中使用的所有参数名称都不能为空.参数名称:名称 …
这个功能:
let convert (v: float<_>) =
match v with
| :? float<m> -> v / 0.1<m>
| :? float<m/s> -> v / 0.2<m/s>
| _ -> failwith "unknown"
Run Code Online (Sandbox Code Playgroud)
产生错误
类型'float <'u>'没有任何正确的子类型,不能用作类型测试或运行时强制的源.
有没有办法如何模式匹配度量单位?
我的电脑上有VS 2010 + NET 4.我为Windows下载了Monodevelop和Monodevelop 2.8.6.4的F#绑定.
我跑了install.bat其复制FSharpBinding.dll并FSharpBinding.Gui.dll到c:\Program Files (x86)\MonoDevelop\AddIns\BackendBindings\.
我在Monodevelop中打开了新的解决方案,但那里没有F#解决方案.你知道我应该做的下一步是让F#与Monodevelop一起工作吗?我还检查了加载项管理器,但我没有看到安装任何F#绑定.
如果我正确理解ES6模块导入,则不允许以下操作:
import { background, border, foreground } as colors from "./colors";
use(colors.background);
use(colors.border);
use(colors.foreground);
Run Code Online (Sandbox Code Playgroud)
看到
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/import
有什么解释吗?
我喜欢明确列出要导入的内容的想法。所以我不喜欢,import * as colors from "./colors";因为它不清楚我使用的是什么。
另一方面,这对我来说太冗长了:import { background as backgroundColor, border as borderColor, foreground as foregroundColor } from "./colors";。
有什么主意如何变得明确而不不必要地冗长吗?
f# ×9
monodevelop ×2
.net ×1
c# ×1
ecmascript-6 ×1
exception ×1
function ×1
hpc ×1
inline ×1
javascript ×1
matlab ×1
module ×1
operators ×1
parameters ×1
quotations ×1
struct ×1
typescript ×1
wcf ×1
windows ×1
xamarin ×1