Is it possible to get the coordinates only for the Highlighted points from an image?

I would like to ask you if it is possible to get the coordinates or a couple of numbers that can give me the positions of the highlights points in an image. I know that there is the possibility to select “get coordinates” by clicking on the image, but what I am looking for something that can automate the selection/generation of the points and can remove the image once selected the highlights.

Any suggestion will be welcomed.

Creating a priority search tree to find the number of points in the range [-inf, qx] X [qy, qy’] from a set of points sorted on y-coordinates

A priority search tree can be constructed on a set of points P in O(n log(n)) time but if the points are sorted on the y co-ordinates then it takes O(n) time. I find algorithms for constructing the tree when the points are not sorted.

I figured out a way to do this as follows:

  1. Construct a BST on the points. Since the points are sorted then it will take O(n) time

  2. Min-Heapify the BST on the x-coordinates This will take theta(n) time

So total time complexity will be O(n)

Is this a valid approach to construct a Priority Search Tree in O(n) time??

Fitting a polynomial to a set of points or to a skeleton

Available data

Available to me is a set of points which can be represented as shown in image 1:

Original data

Also available to me is a non-continuous path derived from this data. It is not important how this non-continuous path is obtained. It is however important, that it roughly represents a curve I intent to approximate. This non-continuous path is shown in image 2:

Non-continuous path derived from original data


I want to approximate this data using a polynomial of either second or third degree. Examples of these approximations are shown in images 3, 4:

Fit curve to original data

Fit curve to non-continuous path

Problem / question

Now I am looking for a way to obtain the red curve. Some details confuse me, where my knowledge is likely to be simply lacking. For example, how to fit a polynomial, when technically what I require is not a function, at least not in this coordinate system, because there will be situations where an x value is being assigned two y values.

I thought of possibly using the ends of my path to define a new x-axis, but I consider this approach faulty. Another consideration are Splines.

How should I go about obtaining this red curve from the non-continuous path (preferred) or from original data? What sources should I look into?

Apologies if this is an already answered question which I suspect it might be. However I have been issuing search queries for this without success, hence my question.

Efficient algorithm to filter off points from a point cloud

I have a master point cloud, which essentially just a list of points with {x,y} coordinates.

The point cloud is HUGE ( like, it can contain more than 1 million points). The problem now is that I have another (sub)set of point clouds, and I need to check whether the points inside the second point clouds are the same with any of the points in the first point clouds, and then remove them from the list.

The characteristics of the second point cloud:

  1. The second point cloud points are usually clustered in a corner of the first point cloud ( but not always).
  2. None of the points from the second point cloud will lie outside of the first point cloud ( the first point cloud always contain every single point of the second point cloud)

The naive algorithm will be something like this:

   public static List<Point> FilterPoints(Lis<Point> master, List<Point> subset)    {         var FilteredPoints = new List<Point>();         for(int i=0; i< subset.Count; i++)      {         var isContained = false;         for(int j=0; j< master.Count; j++)         {           if(subset[i].X==master[j].X && subject[i].Y==master[j].Y)           {               isContained = true;               break;           }         }         if(!isContained)         {            FilteredPoints.Add( master[i]);         }          }       return FilteredPoints;  } 

But is there anyway to improve over the above naive algorithm in terms of speed, given the known characteristics of the both point clouds?

PS: I’ve also asked about how to make use of C# language characteristics( if any) in order to improve the speed for the above algorithm at SO.

Can a Wild Magic Sorcerer use their Tides of Chaos feature when taking damage while at 0 hit points?

There is already the question “Can a Wild Magic Sorcerer use Tides of Chaos while unconscious at 0 Hit Points?, but it is about death saves which occur at the start of your turn, not what happens if you only take damage.

The section on “Death Saving Throws” states:

Damage at 0 Hit Points. If you take any damage while you have 0 hit points, you suffer a death saving throw failure. If the damage is from a critical hit, you suffer two failures instead.

I’m unsure whether you simply gain one failed death saving throw or if you actually make a death saving throw but automatically fail it. If the latter is true then you could apply Tides of Chaos to the save, which states:

Starting at 1st level, you can manipulate the forces of chance and chaos to gain advantage on one attack roll, ability check, or saving throw. Once you do so, you must finish a long rest before you can use this feature again.

Any time before you regain the use of this feature, the DM can have you roll on the Wild Magic Surge table immediately after you cast a sorcerer spell of 1st level or higher. You then regain the use of this feature.

Though the advantage won’t do anything here (as you automatically fail) it does mean that your next spell is more likely to cause a Wild Magic Surge, which can be helpful especially once they get their Controlled Chaos feature:

At 14th level, you gain a modicum of control over the surges of your wild magic. Whenever you roll on the Wild Magic Surge table, you can roll twice and use either number.

Can a Sorcerer apply Tides of Chaos when taking damage while at 0 hit points?
Do you actually make a saving throw when you take damage while at 0 HP?

The answer to another question Can a Sorcerer use the Careful Spell Metamagic option on spells with optional saving throws? seems to say that you still actually make a saving throw against an effect even if you would automatically succeed or fail, but the case of death saves has different wording so I’m unsure what happens.

Can you add luck points to an opposed roll?

Specifically, an opposed POW roll, but presumably the answer would apply to other opposed rolls as well. The rules tell us that:

  1. Many types of roll can either be pushed or have luck points spent on them (if you’re using that optional rule) but never both.
  2. Opposed rolls cannot be pushed.

Does point (1) above imply that only rolls that can be pushed can have luck points spent on them — thereby suggesting that opposed rolls cannot? The rules seems silent on this matter.

In what ways can a creature have zero Hit Points, be conscious, and be unstable?

The section on “Stabalizing a Creature” states:

You can use your action to administer first aid to an unconscious creature and attempt to stabilize it, which requires a successful DC 10 Wisdom (Medicine) check. A stable creature doesn’t make Death Saving Throws, even though it has 0 Hit Points, but it does remain Unconscious. 

This method of stabalizing seems to require that the creature be unconscious. Perhaps this is not the case, but is there ever a time where it matters – a time where a creature has 0 Hit Points, is conscious, yet unstable? I would like answers to use “official” content, no Unearthed Arcana, Homebrew, or Twitter/Stream material should be considered.

I have only found one time where this matters, which is a Zealous Barbarian Raging Beyond Death. In this case you cannot stabalize this Barbarian using a Medicine check.

Put labels on points on the y-axis and on points on a column parallel to the y-axis

I want to put (to the left of the point) j = 1 to the point (0,0), j = 2 to the point (0,1/149), j = 3 to the point (0,2/149) and j = N to the point (0,3/149).

Also put (to the right of the point) j = 1 to the point (1,0), j = 2 to the point (1,1/149), j = 3 to the point (1,2/149) and j = N to the point (1,3/149).

Also put the three points “…” vertically instead of horizontally.

It doesn’t matter if it’s not framed.

I tried it as follows:

data = Transpose@Table[{i - 1, (j - 1)/149}, {i, 1, 2}, {j, 4}]; c1 = ListPlot[data, PlotStyle -> Black,PlotMarkers -> {"\[FilledCircle]", 7}, AspectRatio -> 1]; c2 = ListLinePlot[{{{0, 0}, {0, 1}}, {{1, 0}, {1, 1}}}, PlotStyle -> Black, AspectRatio -> 1]; c = Show[c1, c2, Ticks -> None, Frame -> True, FrameTicks -> {{{{0, "j=1"}, {1/149, "j=2"}, {2/149,     "j=3"}, {(2/149) + (1/298), "..."}, {3/149, "j=N"}},   Automatic}, {Automatic, Automatic}}] 

How can the initial “booting” state of a computer be different at different time points?

In my experience, sometimes a computer boots normally, and in a time span of days, the computer won’t boot, then again, it will boot normally again. I am not a computer science expert so I assume that if a computer boots normally one time and then it doesn’t, it must be due to any changes made into the computer between those time points.

My question has the motivation of understanding the booting process of a computer at a basic level as to know how to debug such a behavior.

For a concrete example, I got a new computer with Ubuntu 18.10 that presented this behavior, all the time without access to internet, so no updates/upgrades possible.

Can anything change in a computer without the user modifying something, also while not having internet connection?

How much on average does the Durable feat increase the number of Hit Points gained when spending Hit Dice?

There are other similarly mathy questions on this site such as “How much damage does Great Weapon Fighting add on average?” and “Are features that allow −5 to attack to get +10 to damage mathematically sound?” but I was wondering how the math pans out with the Durable Feat.

The feat states:

When you roll a Hit Die to regain hit points, the minimum number of hit points you regain from the roll equals twice your Constitution modifier (minimum of 2).

There are two interpretations for how the Durable feat could work “How does the Durable feat work?”, but for the purposes of this question I would like you to assume that “the roll” refers to the total of the die’s result and the Constitution modifier.

As the answers there explain, this means the feat is useless to those with a Constitution modifier of +1 but it prevents the alternative interpretation’s unusual case of a d6 Hit Die class with a +5 Constitution modifier gaining 15 Hit Points from spending a Hit Die whereas their normal maximum is 11.

This is also shown to be the intended way for the feat to work (thank to user @Rykara for finding this) as Jeremy Crawford has made this tweet:

If you have the Durable feat and spend a Hit Die to regain hit points, the minimum number of hit points you regain is equal to twice your Constitution modifier (minimum of 2 hit points). For example, if your modifier is +1, you regain a minimum of 2 hit points.

How much does this feat increase the average Hit Point gain?