RGBD alignment without explicit transformation between RGB and depth

I have a set of RGB-D scans of the same scene, corresponding camera poses, intrinsics and extrinsics for both color and depth cameras. RGB’s resolution is 1290×960, depth’s is 640×480.

Depth is pretty accurate, but still noisy, the same with camera poses. However, both intrinsics and extrinsics are not very accurate: for example, intrinsics does not introduce any distortion terms, while images are definitely distorted. Extrinsics tell that both cameras take place exactly at the same point, since they are just identity matrices. It could be decent approximation though.

When I try to compute a point cloud from a frame by downsampling RGB, unprojecting depth, transforming it with RGB extrinsics and projecting with RGB’s intrinsics, it looks like RGB frame is shifted by a few cm from depth – for example, an object’s border could be colored as background.

One might assume that such artifacts could be eliminated by aligning depth to RGB with improved extrinsics. Is there a way to estimate more accurate transformation between RGB and depth in such scenario?

I’m familiar with pretty relevant question, but there you have required Rt matrix for both cameras.

In case of well-performing monocular depth estimation, one could align two point clouds (computed from depth and estimated from RGB) directly and determine required transformation.

Am I missing something and there is well-known approach for this problem?

Solve recurrence relation that depends on depth of recursion

The specific problem I’m working on is the puzzle presented in this video. For those who don’t want to watch the video, my summary of the puzzle is:

A frog is sitting on the edge of a pond facing the opposite bank. In front of the frog, running along the pond’s diameter, is a line of $ N$ lilypads. This is a very athletic frog: it is able in a single leap to land on any of the $ N$ lilypads in the pond or on the opposite bank (for a total of $ N + 1$ possible destinations). The frog first considers all $ N+1$ positions in front of it, chooses one randomly with uniform probability, and then jumps to this location. It then repeats the process of choosing a new random position from those remaining in front of it (never jumping backwards). This goes on until the frog eventually reaches the opposite bank.

The puzzle is twofold: First, if $ N=10$ , what is the expectation value of the number of jumps the frog will take to reach the other side of the pond? Second, find an explicit formula (NOT a recurrence relation!) for the expectation value of the number of jumps in general for $ N$ lilypads.

(It’s a great puzzle; if you haven’t yet given it a shot, I’d highly recommend doing so before reading any possible spoilers in the rest of this post!).

To attempt this puzzle, I first calculated the first few terms by hand and then tried to generalize my result. I eventually came up with a recursive algorithm for the expectation value $ f$ :

def f(n, depth=1):     if n == 0:         return depth     else:         return (n * f(n - 1, depth) + f(n - 1, depth + 1)) / (n + 1) 

However, the second part of the puzzle explicitly disallows recurrence relations as solutions, so I am trying to un-roll/solve the recurrence relation. There are already several questions on strategies for solving recurrence relations (see this and this), but none I can find on solving recurrence relations which are dependent on the depth of recursion. Any help on how to do this is appreciated.

wordpress custom menu – show parents, siblings, children depending on depth

looking and trying for hours to find a solution for the following output of a wordpress custom menu. Hope you can help. I do not know where to start: custom menu walker, css, functions.php

I have a custom menu with “individual links” (so no pages or posts or categories) with Link and Link-Text. Right now depth is 5 (could be 6,7.. in the future).

Example menu:

Sport    Bike      Bikeparts        Seats          Mountainbike          Roadbike        Breaks          Break Levers          Adapters      Bike Add Ons        Bottle Holder    Water      Stand Up Paddling        Paddel        Boards    Air      Wingsuits  Automotive   car   motorbike Tools 

What should it be: See following scenarios: Default View on main page (depth 0):

Sport Automotive Tools 

Click on “Sport”:

Sport (bold)    Bike    Water    Air Automotive Tools 

Click on “Bike”:

Sport (bold)    Bike (bold)      Bikeparts      Bike Add Ons    Water    Air Automotive Tools 

Click on “Bikeparts”:

Sport (bold)    Bike (bold)      Bikeparts (bold)        Seats        Breaks      Bike Add Ons Automotive Tools 

Click on “Breaks”:

Sport (bold)    Bike (bold)      Bikeparts (bold)        Seats        Breaks (bold)          Break Levers          Adapters Automotive Tools 

Click on “Break Levers”:

Sport (bold)    Bike (bold)      Bikeparts (bold)        Breaks (bold)          Break Levers (bold)          Adapters Automotive Tools 

So you see from Depth 1 if you start depth at 0 (step: click on Bike) and deeper you will always see all depth 0 menu items (sport, automotive, Tools), all siblings from this active menu item (bike) under active parent (sport) and all children of active menu item (bike).

What i have right now is the solution from https://christianvarga.com/how-to-get-submenu-items-from-a-wordpress-menu-based-on-parent-or-sibling/ where i replaced:

} else if ( ! ( isset( $  args->show_parent ) && in_array( $  item->ID, $  menu_item_parents ) ) ) { 


} else if ( ! empty( $  item->menu_item_parent ) ) { 

So right now it works only with the first level. if i click on sport i do not see submenu from automotive.

I hope anybody can help.

Thanks in advance

SEO Keyword Research And In Depth Competitor Analysis for $10

SEO Keyword Research is important because it helps you create pages based on the Right Keywords and carry out proper On Page SEO. If you’re not targeting the right words, you won’t get much traffic. What you get with this gig: ★ I will do niche research and find the best 100 / 200 / 300 keywords to target for your business or category based upon the package you select. ★ The Report will include Average Monthly Search Volume for Organic KWs, Keyword Difficulty Score, and the Cost Per Click price for each KW. ★ Reports will be delivered in .csv Excel format. NOTE: This gig is only suitable for English KWs. Google is blocking data for Marijuana and Cannabis products, so I won’t be able to provide data for Cannabis and related terms. Competitor Analysis will include: (Standard and Premium Package only) ★ Competitor Backlinks Report (includes both nofollow and dofollow backlinks) ★ Top Competitor Pages with the most traffic. ★ Organic and Paid KWs targeted by your Competitors.

by: ArbazButt
Created: —
Category: Onsite SEO & Research
Viewed: 255

How to do a reverse topological sort using depth first search?

I’m doing a replacement for the venerable make utility that will support, among other things, automatic cleaning. The utility figures out automatically what files and directories are targets, and then deletes those, if the user wishes to do a clean operation. However, a file may reside in an automatically created directory, meaning I should do a topological sort for the targets, where every file has an arc towards the parent directory, and every directory has an arc towards its parent. So, for example:

  • objhierarchy/obj/foo.o has an arc towards objhierarchy/obj
  • objhierarchy/obj has an arc towards objhierarchy

What complicates the things is that the files need to be deleted in the reverse order. So, in the example given, you need this order: (1) objhierarchy/obj/foo.o, (2) objhierarchy/obj, (3) objhierarchy.

Topological sort seems like a good solution, but it gives the opposite order. So, a topological sort of the directory parent graph would yield (1) objhierarchy, (2) objhierarchy/obj, (3) objhierarchy/obj/foo.o.

A solution could be a buffer of pointers that is reversed in-place (or just iterated in the reverse order), but I would like to avoid allocating extra memory.

What is the best way to get the files deleted in the reverse order? Can the topological sort algorithm based on depth first search be modified to call some callback function in a reverse order?

is it always true that the depth of BFS is $\leq$ DFS?

I have a simple theoretical question in very basic algorithms, as the title mentions, is it always true that the depth of BFS is $ \leq$ DFS?

From what I understand, the tricky part here is the possible cycles in the graph. Even though that I believe that the depth of BFS will always be less or equal to the depth of DFS.

In each iteration of BFS, from what I understand, the depth might grow by one, but DFS’s grows in each vertex it can not reach, sometimes above the maximal value of BFS.

So, is it always true that the depth of BFS is $ \leq$ DFS?

Optimized Depth First Search?

I’m trying to solve this question:

Each New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint all the n its vertices, so that the i-th vertex gets color ci.

Now it’s time for Timofey birthday, and his mother asked him to remove the tree. Timofey removes the tree in the following way: he takes some vertex in hands, while all the other vertices move down so that the tree becomes rooted at the chosen vertex. After that Timofey brings the tree to a trash can.

Timofey doesn’t like it when many colors are mixing together. A subtree annoys him if there are vertices of different color in it. Timofey wants to find a vertex which he should take in hands so that there are no subtrees that annoy him. He doesn’t consider the whole tree as a subtree since he can’t see the color of the root vertex.

A subtree of some vertex is a subgraph containing that vertex and all its descendants.

Your task is to determine if there is a vertex, taking which in hands Timofey wouldn’t be annoyed.

Input The first line contains single integer n (2 ≤ n ≤ 105) — the number of vertices in the tree.

Each of the next n - 1 lines contains two integers u and v (1 ≤ u, v ≤ n, u ≠ v), denoting there is an edge between vertices u and v. It is guaranteed that the given graph is a tree.

The next line contains n integers c1, c2, …, cn (1 ≤ ci ≤ 105), denoting the colors of the vertices.

Output Print “NO” in a single line, if Timofey can’t take the tree in such a way that it doesn’t annoy him.

Otherwise print “YES” in the first line. In the second line print the index of the vertex which Timofey should take in hands. If there are multiple answers, print any of them.

I have come up with a solution that works but times out on large inputs.

 from collections import defaultdict  n = int(input()) graph = defaultdict(list) colors = defaultdict(lambda: -1) for i in range(n-1):     (u, v) = [int(i) for i in input().split()]     graph[u].append(v)     graph[v].append(u)  c = [int(i) for i in input().strip().split()] colors = {i+1: v for (i, v) in enumerate(c)} bad = set()   def start(start):     nebs = graph[start]     return all(dfs(n, set([start]), colors[n]) for n in nebs)   def dfs(start, visited, want):     visited.add(start)     if colors[start] != want:         return False     for neb in graph[start]:         if neb not in visited:             if not dfs(neb, visited, want):                 return False     return True   found = False ans = -1  for i in range(1, n+1):     if start(i):         found = True         ans = i         break     else:         bad.add(i)  if not found:     print("NO") else:     print("YES")     print(ans)  

I’d love some guidance on how I can make this faster — thank you!

Merge sort and quciksort recursion tree depth

1) I need to determine recursion tree depth for strings composed of 10, 100 and 1000 elements when using merge sort. For the 10 elements one I can do it on a paper, just drawing tree, but what about 100 or 1000 elements? How do I determine recursion tree depth for them? Is there any pattern that I cannot see? What if someone would ask me for recursion tree depth for a string composed of one million elements?

And the second thing is:

2) I need to determine the biggest and the smallest recursion tree depth for strings composed of 10, 100 and 1000 when using quicksort. So it’s kind of similar but those could be any strings, so is there even constant number that defines the smallest and the biggest? How to count this?

And the third thing is:

3) I need to provide a recursive dependency which value for the given n is the number of recursion tree levels of recursive calls of merge sort for an n-element string.

Constructing a 3D virtual map from 2D Depth Maps and $x, y, z, \theta$ coordinates

Context: I intend on building a quadrotor which can generate a 3D virtual map of an area of which it captures photos with a 2D camera.

I plan on first training a Convulational NN to return a depth map from a 2D image, then use the information from that depth map along with the x, y, z coordinates and angular displacement of the quadrotor to generate this 3D map.

What do I need to learn in order to do something on this scale?

Any ways to make this easier?

Thanks, -ShreyJ