Live View – Does a manufacturer's EVF camera (or alternative firmware) implement multicolored / incorrect focus points and / or histogram positions?

It would be logical and helpful to use wrong colors (possibly superimposed on a b / w EVF display) to indicate how strong a peak contrast is. Alternatively, this could be a more precise way to For example, to display zone system zones at selected exposure (not just zone 9/10, as the usual "zebra" feature does).

Has a manufacturer already implemented such a function? Could it be realistically implemented in eg Magic Lantern?

SQL Server – Cardinality Estimation outside the histogram

I'm using the 2010 version of the Stack Overflow database on SQL Server 2017 with the new CE (compatibility level 140) and created this process:

USE StackOverflow2010;

    @CommentCount int
    SELECT * 
    FROM dbo.Posts p
        p.CommentCount = @CommentCount

There are no non-clustered indexes or statistics too dbo.Posts Table (there is a clustered index for Id).

If you ask for an estimated plan, the "estimated lines" will be output dbo.Posts is 1,934.99:

EXEC #sp_PostsByCommentCount @CommentCount = 51;

The following statistic object was automatically created when I asked for the estimated plan:

DBCC SHOW_STATISTICS('dbo.Posts', (_WA_Sys_00000006_0519C6AF));

Screenshot of statistics output in SSMS

The highlights are:

  • The statistics have a fairly low sample rate of 1.81% (67,796 / 3,744,192).
  • Only 31 histogram steps were used
  • The value for "All Density" is 0.03030303 (33 different values ​​were scanned)
  • The last RANGE_HI_KEY in the histogram is 50, with EQ_ROWS from 1

If you pass a value above 50 (up to and including 2,147,483,647), the row estimate is set to 1,934.99. Which calculation or which value is used to create this estimate? Incidentally, the legacy cardinality estimator generates an estimate of 1 line.

Here are some theories I had, things I tried, or additional information that I could dig up when I was doing it.

density vector

At first I thought it was the density vector, as if I had used it OPTION (OPTIMIZE FOR UNKNOWN), However, the density vector for this statistic object is 3.744.192 * 0.03030303 = 113.460, so that's not it.

Extended events

I tried to run an advanced event session in which the query_optimizer_estimate_cardinality Event (from which I learned in Paul White's blog contribution Cardinality Estimation: Combining Density Statistics) and contains the following interesting treat:



So it seems the CSelCalcAscendingKeyFilter The calculator was used (the other says he failed, whatever that means). This column is not a key or unique or unconditionally ascending, but whatever.

When I googled that term, I came up with some blog posts:

These contributions indicate the new CE values ​​that these estimates outside the histogram are based on a combination of the density vector and the statistic change counter. Unfortunately, I have already excluded the density vector (I think so!) And the change counter is zero (per sys.dm_db_stats_properties anyway).

Trace flags

Forrest suggested that TF 2363 be turned on for more information about the estimation process. I think the most relevant thing about this issue is this:

Plan for computation:

  CSelCalcAscendingKeyFilter(avg. freq., QCOL: (p).CommentCount)

Selectivity: 0.000516798

This is a breakthrough (thanks, Forrest!): That 0.000516798 Number (which seems to be unrounded in the XE) Selectivity="0.001" Attribute above) multiplied by the number of rows in the table is the estimate I was looking for (1,934.99).

I probably miss something obvious, but I could not reverse how this selectivity value is generated within CSelCalcAscendingKeyFilter Calculator.

Automatically bound histogram areas?

For a given histogram of some data, e.g. in the following example

I can create a histogram:

Histogram[sample, 100]

Enter image description here

I'm looking for ways to automatically find boundaries for histogram distributions, as I've manually added in the following image:

Enter image description here

Note that the borders are slightly out of focus, just outside the distribution, if the edge is sharp and high, but slightly within the distribution if the drop has a soft "tail".

Can this be done in Mathematica? What would be a good approach?

Labels of the r-X axis bound to histogram bars instead of following separate rules

If you use a histogram with x as the POSIXct value, I'm not sure how to align the ticks with the binsize of the chart.

If you set the tick size to the same size as the binsize, the line will shift slightly, but the offset will add up until it is no longer accurate.

until the month <- ggplot () +
scale_x_datetime ("", breaks = date_breaks ("60 days"), labels = date_format ("% m-% y")) +

Many geom_rects for background colors

theme (legend.title = element_blank ()) +

geom_histogram (data = dat, aes (x = iso, fill = name), binwidth = 30 * 24 * 60 * 60, position = & dodge & # 39;)

I've tried experimenting with annotate () as well as the tick distance, but I think my approach here could be wrong by itself

This will cause a graph to look something like this

Graphic with staggered checkmark
Picture link ^

Which is pretty annoying

raw – Why do cameras not show an "exact" histogram?

Why cameras do not show a histogram based on the RAW data instead
on the JPG preview?

If you shoot raw and know what you are doingA raw histogram is a great thing. Otherwise, the JPEG histogram will be a better approximation of what you are getting and less confusing to the end user because there may be more clipping during processing.

If you're using programs like RawDigger, you've probably noticed that displaying raw histograms in one direction may not be enough. The complexity of the implementation may be another reason why we often do not see crude histograms in cameras.

But every camera I've worked with shows me the histogram based on that
JPG preview and the picture style and tells me that these areas are
cut off.

Is there no way to see the actual dynamic range captured by the camera?
Sensor? Why does not a camera manufacturer do this? That should not be
to be difficult.

Some Leica models have a raw histogram or an approximation of it. Magic Lantern hacks for Canon firmware appear to display a raw histogram as well.

Interpolation – How can I fit a function into a histogram?

Update 2: Extract information about tank center and height histogram Edition and use interpolation:

datafromrectangles = cases[histogram, 
   Rectangle[a_, b_, ___] :> {Mean[{a[[1]]b[[1]]}]b[[2]]}, Everything];
intF = interpolation[datafromrectangles];

Quiet @ Plot[intF[x], {x, 0, 15}, PlotStyle -> directive[Blue, Thick], Filling -> axis]]

To update: An alternative with WeightedData on histogram bin boundaries and heights combined with interpolation:

{binlims, heights} = HistogramList[SampleData];
wd = WeightedData[MovingAverage[binlims, 2], Heights];
bw = binlims[[2]]- Binlims[[1]];
iF = (1 / bw) interpolation[Transpose[wd["EmpiricalPDF"]]][#] &;
show[Histogram[SampleData, Automatic, PDF].
Quiet @ Plot[iF[x], {x, 0,
15}, PlotStyle -> directive[Blue, Thick], Filling -> axis]]

Enter image description here

Original answer:

You can use Smooth kernel distribution With example data Use the input for a distribution object as its input PDF:

SampleData = RandomVariate[RayleighDistribution[3], 5000];
dist = SmoothKernelDistribution[SampleData];

show[Histogram[SampleData, Automatic, PDF].
plot[Evaluate@PDF[dist][x], {x, 0, 15},
PlotStyle -> directive[Blue, Thick], Filling -> axis]]

Enter image description here

Create a histogram of the number of edges in a digraph

I have the following code This calculates the number of edges in a range theta1 and theta2, Seen that way Manipulateyou can choose for any lower and upper limit mm and just see the associated digraph as well as the total number of edges in it. Basically, this is a histogram of edges, but a very unpleasant one.

clear[mm, vLabels, selectBetween, subgraphBetween];
mm = RandomReal[0.5, {10, 10}];
vLabels = {1 -> AGR, 2 -> FIS, 3 -> CO1, 4 -> CO2, 5 -> MA1, 6 -> MA2,
7 -> EGW, 8 -> CST, 9 -> WHS, 10 -> HOT};
select between[[Theta]1_, [Theta]2_]: =
BoolEval[[Theta]1 <= mm <= [Theta]2];
subgraphBetween[[Theta]1_, [Theta]2_] := 
AdjacencyGraph[selectBetween[[Theta]1, [Theta]2],
PlotLabel -> [Theta]1 <= subscripted[m, ij] <= [Theta]2, 
VertexSize ->    0.3, VertexLabels -> vLabels, ImagePadding -> 20,
ImageSize -> 150];
{{"Digraph within the range for !(*SubscriptBox[(m), 
(ij)]) ",
"Total number of edges in the interval"}, {subgraphBetween[
[Theta]1, [Theta]2].
EdgeCount[subgraphBetween[subgraphBetween[subgraphBetween[subgraphBetween[[Theta]1, [Theta]2]]}} // Transpose
{{[Theta]1, 0.00001,
"Threshold [Theta]1 <!  ( * SubscriptBox[(m), (ij)]} "},
0.00001, 0.5, 0.01},
{{[Theta]2, 0.00001,
"!  ( * SubscriptBox[(m), (ij)]) <Threshold [Theta]2 "},
0.00001, 0.5, 0.01}

I like to have a histogram of the edges in mm where each prohibition is defined by an area of theta1 to theta2, I would also like to see the number of edges above each bar in the histogram, so that the reader can immediately see how many edges there are in the bar.

Thank you for your help.

Photo Editing – What does the gamma histogram mean?

A good way to analyze an image is to measure different locations (densities or intensities) and then draw these measurement points using graph paper. When done, the diagram resembles a half bell curve. We divide this curve into regions. The lower part is called "toe". This graph graphically indicates that the image is starting to form slowly. Next, the area of ​​the straight line will be referred to. This part of the graph graphically shows a proportional response to the exposure light. We can measure the angle of the straight line with a protractor. When the image contrast is low, the angle of the straight line is pressed. If the image has a high contrast, the straight line shows that fact. Its angle will be 45 ° or larger.
Historically, we have transformed this angle into a tangent (TAN) using trigonometry. Most images with sufficient contrast have a straight line with an angle of about 40 °. The tan of 40 = about 0.8. This is traditionally the target contrast for images that show a respectable contrast. We're talking about the science of sensitometry – taking test shots and the science of densitometry – measuring photographic images. It is common to call the TAN of the angle of the straight line "gamma".

The following graphic refers to the film – digital images are a subset of the film when it comes to the determination. we also draw these.

35 = gamma 0.7 = flat 45 = gamma 1.0 = contrast

Enter the image description here

Exposure – Is this posterization? How do I avoid stretching the histogram?

Last weekend I took pictures in the mountains, where I can not control the light or the movement of the motives.

Some of the photos had very little contrast and brightness and were slightly underexposed.

I edited the raw images with Darktable and stretched the histogram with the exposure tool.

This picture has a good contrast and a good brightness, but some flaws. I believe in posterization, but not sure.

is it the posterisation?

What is the "right way" in this case? Do not stretch the histogram? Not as much? Other darktable module?

I took the photos in the mountains in cloudy weather. Some topics moved as I left. ISO and shutter speed in car. So, probably I can be better with more experience and skill and avoid bad exposure in the first place.