|
A simple, naive approach is to collect as many (R, G, B, Depth) tuples as you can get, then do multiple linear regression with Depth as the dependent variable.
If the linear assumption doesn't give satisfactory results, you can try multiple polynomial regression, or splitting the data set into two partitions, and using regression separately on each.
|
|
|
|
|
Many thanks for the help.
I'm pretty sure that linear regression won't work because I have an image that has large Green values at both high and low depth.
If I understand it right, Polynomial regression for R, G or B may sometimes work but I think that often the depth can be an unknown function of all three colours.
I wonder if it makes sense to combine the best Polynomial regression fit for each one somehow?
|
|
|
|
|
"...I have an image that has large Green values at both high and low depth."
I suspected this, which is why I suggested dividing the space into separate partitions and solving them independently. Statisticians call this "elaboration".
|
|
|
|
|
Is it possible that converting from RGB to HLS color representation might give values mre amenable to regression? Just a thought.
|
|
|
|
|
1-How to make a sandbox that sandboxing and preventing Malicous Java script at URL address bar with such permissions like never change the title page , never change the images or flash or any other multimedia from outside in the page and never excute a code from outside ?
2-after detecting and preventing through Sandbox , how to take the piece of code which causes the problem from a big malicious script ? e.g. eval() is the responsible for making the problem so i want the program to catch for the 3rd step
3-if for example eval() is the bad function which causes the trouble then how to REPLACE it -mapping- with a safe function? -lets say only a mapping for eval() ,execScript , SetTimeOut , SetTimeInterval
innerHTML , outerHTML document.cookies, location.replace , location.assign , script.src href , src , Iframe -
I red many articles but i didnt find safe mapping for unsafe functions
What are the safe mapping for those unsafe functions or properties??
I red this it was helpful but not complete:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval[^]
Note:
Though I hope to make this Algorithm implemented with c# -I posted this question there- but any help to solve this queston with any language will be welcomed.
|
|
|
|
|
|
Am working on a robotic arm, and I intend using an algorithm to generate the shortest route to a given point in3D space. Its kind of like optimization .Stuff for shortest route . etc....Am to use C# and genetic .Algorithm. Please help out . .
|
|
|
|
|
You need to define classes for Route (which will contain an array of genes), and Population (which will contain an array of Routes. Then write an evaluation function for class Route that gives the "value" of the Route's gene list; the length of the route seems appropriate.
Initialize the genes of each Route in the Population to small random values. Then:
Evaluate each Route. Delete the Routes with the highest scores (e.g. keep the 10% with the shortest routes). Refill the population with combinations of genes from pairs of Routes in the shortest 10%, with random "mutations" (altering one or more genes).
Repeat until a short enough route evolves.
|
|
|
|
|
|
Hi,
I need to write a pesudocode about InvertRelation function for 2-level Binary Decision diagrams.
InvertRelation takes as input a 2L-level quasi-reduced BDD rooted at r encoding a relation R : B^L → 2^{B^L} and returns the 2L-level quasi-reduced BDD rooted at s encoding the relation R^{−1} :B^L →2^{B^L},that is, j ∈ R(i) iff i ∈ R^{−1}(j).
the input BDD r uses the variable order x′1, x1, ..., x′L, xL and that the result BDD s uses the variable order x1,x′1,...,xL,x′L. Thus r is at level L and its children are at level L′, while s is at level L′ and its children are at level L.
Any help is appreciated.
compengr
|
|
|
|
|
Funny, I was just looking for that.
I couldn't find anything though.
yes this post is useless..
|
|
|
|
|
If you want some help, try explaining what you need without cryptic terms you haven't defined.
|
|
|
|
|
I'm currently studying cryptography implementation in depth. To that end I'm reading various RFCs and trying to implement the algorithms so I can get a better understanding of them and hopefully make my applications more secure when cryptography is used. Right now I'm reading the TLS RFC 5246.
The first algorithm in the document is a pseudorandom function (PRF) that takes a secret, a seed, and a label and produces an output of a specified length. This is Section 5 (Page 14 in the PDF) of the document. It defines a function called P_hash(secret, data) that uses a single hash function to expand a secret and seed to an arbitrary length:
Pseudo-code (Page 15):
P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) +
HMAC_hash(secret, A(2) + seed) +
HMAC_hash(secret, A(3) + seed) + ...
where + indicates concatenation.
A() is defined as:
A(0) = seed
A(i) = HMAC_hash(secret, A(i-1))
P_hash is iterated as many times as necessary to produce the required length. The example given in the RFC is if P_SHA256 is being used to create 80 bytes, it will be iterated three times (through A(3) ), creating 96 bytes of data where the last 16 bytes of the final iteration is discarded to leave the needed 80 bytes.
The PRF is created by applying P_hash to the secret as follows:
PRF(secret, label, seed) = P_<hash>(secret, label + seed)
I've defined the two functions (PRF & P_hash ) but added two additional parameters; the first if reqLength to set the output length and HmacLength which is an enum that will restrict the allowed hash function to SHA256, SHA384, or SHA512.
The code that follows I believe follows the RFC correctly, however I feel it is inefficient because of how I'm going back and forth between List(Of Byte) and Byte() 's, but I can't figure out how to simplify it; possibly because I've been programming all day or maybe because it is 1:30 AM. Either way I was hoping that someone could help simplify the code because everything I tried (like eliminating some of the loops) resulted in the code not compiling for various reasons.
The code I have so far is this:
Public Class PRF
Public Enum P_SHA
HMAC_256
HMAC_384
HMAC_512
End Enum
Public Function PRF(secret As Byte(), label As Byte(), seed As Byte(), reqLength As Integer, Optional HmacLength As P_SHA = P_SHA.HMAC_512)
Dim temporaryArray As New List(Of Byte)
temporaryArray.AddRange(label)
temporaryArray.AddRange(seed)
Return P_hash(secret, temporaryArray.ToArray, reqLength, HmacLength)
End Function
Private Function P_hash(secret As Byte(), seed As Byte(), reqLength As Integer, Optional HmacLength As P_SHA = P_SHA.HMAC_512) As Byte()
Dim data As New List(Of Byte)
Dim HMAC_hash As HMAC
Select Case HmacLength
Case P_SHA.HMAC_256
HMAC_hash = New HMACSHA256(secret)
Case P_SHA.HMAC_384
HMAC_hash = New HMACSHA384(secret)
Case Else
HMAC_hash = New HMACSHA512(secret)
End Select
Dim i As Integer = 1
Dim A As New List(Of Byte())
A.Add(seed)
Dim concatenateByte As New List(Of Byte())
Dim temporaryArray As New List(Of Byte)
Do Until data.Count >= reqLength
concatenateByte.Clear()
concatenateByte.Add(A(i - 1))
concatenateByte.Add(seed)
For Each byt As Byte() In concatenateByte
For Each b As Byte In byt
temporaryArray.Add(b)
Next
Next
data.AddRange(HMAC_hash.ComputeHash(temporaryArray.ToArray))
Loop
If data.Count = reqLength Then
Return data.ToArray
Else
Return data.GetRange(0, reqLength).ToArray
End If
End Function
End Class
The arrows indicate the parts of the code that I imagine there is a way to eliminate although I can't see it.
Any suggestions or advice would be greatly appreciated. Thanks in advance.
|
|
|
|
|
I pass Event mechanism in MS, locking send / publish notification .I do not pass Concurrent Collection yet.
Consider, as definition ask, Events as a certain particular type of Delegates.When invoke declared Delegate,the correspondent method is invoked.Assume that invocation is made for Annonymous Methods, but - code for method is recommanded to be expressed much more as Lambda Expression, Closures and Functors.- .So,I consider evaluating Closures with SystemReflection namespace.Intuitvly seems that
SystemReflection offer all need stuff for this.Can Closures be somehow different evaluated?
modified 10-Aug-13 7:51am.
|
|
|
|
|
Does anyone know of a paid or free C# implementation of GARCH?
I have thumbed thru few Excel spreadsheet samples and C++ code in Boost as well as statistics based library source ... but that implementation seems too complicated because I want something for educational purposes. May eventually move to the same industrial versions found in those library but it is difficult to start from there.
GARCH stands for Generalized AutoRegressive Conditional Heteroskedasticity. It is a statistical algorithm
|
|
|
|
|
How to find the shortest path between two nodes in a undigraph,but the constraints of this path is that it should via several given intermediate nodes. This uidigraph is a sparse graph and may not a connected graph.
The weight of every edge in the graph is the same. The number of nodes in the graph is about several thousand.
Do you have some ideas about it? Looking forward to your reply!
|
|
|
|
|
I think the best way of solving is using Divide and conquer/Dynamic Optimization. Just find the shortest path between the first node and the intermediate nodes using BFS until you find the first of these nodes. After that you get that found node and using BFS you look for the next intermediate node and so on until you find the last intermediate node. After that using BFS you find the path between the last visited intermediate node and the last given node.
Before all of that you can check in case your graph is not connected if the first , last and all of the intermediate nodes are in one subgraph.
Other way of solving the problem is using complete depletion algorithm. This means making all possible paths and looking for the min path which contains the intermediate nodes.
I hope this will help you
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
Thank you for your reply. But the problem is the order of the intermediate nodes are uncertain. We don't know which is the first and which is the next.
|
|
|
|
|
Thats why when you use BFS and start visiting the child nodes to the current node and check if they are one of these intermediate you will find the closest intermediate node. And from there you will determine their order.
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
But in some cases,the closest intermediate node can not be the first node of the path.If choose the closest intermediate node as the first node,some other intermediate node may not reach or access using a simple path.In other words,the path which we want to find should not have duplicate nodes.
|
|
|
|
|
Actually you can have in your path duplicate nodes. Consider the following possibility
A is your first node , B last and the P, Q, R are the intermediate, and you have the following edges
(A,P) (A,Q) (Q,R) (R,B). You cannot escape from duplicating A . Its impossible to make a path without it
If the algorithm creates path with duplication of some of the nodes that means you have similar situation. Normally using BFS you still have the visited nodes and you can filter the visited or better put them in different queue to be used only in case you don't find other path between the current 2 nodes
Node: if you filter them in some cases you wont find a path
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
The situation you have mentioned may indeed exist.In that case, we can confirm that no path meet the condition.If we find all the possible path between the 2 nodes using DFS or BFS and then choose the path which meet the condition,we will find that it too slow to comlpete for huge number of nodes.
|
|
|
|
|
You can use dijkstra's algorithm for finding the shortest distance between any two nodes. There is also one more method that is kruskal algorithm you can try that to. If you need any help I am ready to help.
______________________________________________
mobile application development company india
|
|
|
|
|
Image compression using half an coding or anyother.(algorithm
)
|
|
|
|
|
snehal122 wrote: half an coding What's that?
|
|
|
|