How can I validate that two chart images are identical? - computer-vision

I want to write a function to compare two images and tell whether they contain the same chart or not. For example, the charts shown below:
These two images are of the same chart. However, the charts have different colors, different sizes, different backgrounds, and won't be easily aligned together. How can I write a, preferably a javascript, function that can whether two passed images are of the same chart or not?
In other words, I want a function that tell whether the two chart line could be aligned together or not regardless of the actual points on the axes.

Related

How to overlap two label to make mask for segmentation in ITK-snap?

I'm annotating CT scan slices(Nifti format) with ITK-snap. One slice contains two labels(Subarachnoid and Intraparenchymal) in the same area. Here is the original annotated image link: https://ibb.co/FJpyVZF
Since two labels are overlapping, the intersection area in the slice should contain both labels. But it shows it only contains the label which has been drawn last. Since the Subarachnoid area was drawn last over the Intraparenchymal area, the final segmented image only shows it contains Subarachnoid in the intersection region. I'm attaching the annotated slice https://ibb.co/F3TrXtq and segmented slice https://ibb.co/sRgdndY to clear my point.
What can I do to make the intersection area contain two labels?
ITK-SNAP uses binary label maps. That approach does not allow label overlap. Your options are:
Use a different label map for each structure you are segmenting.
Use a different segmentation representation. This will require use of different software. I recommend 3D Slicer.

Is it possible to develop the line charts with multiple colors in powerbi?

I developed the few Line charts for BMP280 sensor data in powerbi. This is one of the line chart for displaying the temperature value by time and device id.
But I want same line chart with different Color like this below image, whenever temperature value suddenly changes.
Can you please tell me is it possible to develop the Line chart with multiple colors?
If you're willing to consider a vertical bar chart instead of a line chart, you would be able to create a calculation for each row that determines whether the change is significant, potentially by comparing an aggregate of recent measurements to specific thresholds.
Once you do that, you would use this column's value as a legend for your visualization. So if a row has a value of "Significant Positive Change" (or something like that), the bar or bars showing that change can be red.
Your other alternative is to use an R-based visual, of which there are surely examples of this type of visualization. I'll update this answer if I find one that looks promising.
Instead of tending 1 data series, you can split it into 2 data series e.g. one with normal temperatures and one with high temperatures. Then you can just plot these in different colours. Just make sure that the ranges are same i.e. cannot be 'Auto'.

Match corresponding peaks/valleys of similar histograms in OpenCV

I'm currently working on a project where I have to compare similar histograms of image intensity. These histograms are obtained from photos taken under different illumination conditions.
I know that OpenCV offers the compareHist function. However this function returns a metric of similarity and I'm looking for a method that matches corresponding peaks/valleys between similar histograms.
For instance, if we have two photos of the same subject, one underexposed and one with the "ideal" exposure, their histograms of intensity might look something like the image in the following URL:
http://i.stack.imgur.com/tLIGR.png
As shown by the arrows, the peaks in one histogram also exist in the other. Anyone has a suggestion on how to match corresponding peaks?
Thank you!
You can use an implementation of DTW (https://en.wikipedia.org/wiki/Dynamic_time_warping) to compare the histograms.
Using dynamic programming, you can create a matrix that calculates DTW. Then, you can trace back through the matrix to find the relations between different parts of the histograms.
After that, it's simply a matter of extracting only the peaks.

How do I specify multiple data sets to an XY-scatter plot using the Google Chart API?

Why doesn't this Google Chart API URL render both data sets on this XY scatter plot?
http://chart.apis.google.com/chart?cht=lxy&chd=t:10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200|0.10,0.23,0.33,0.44,0.56,0.66,0.79,0.90,0.99,1.12,1.22,1.33,1.44,1.56,1.68,1.79,1.90,2.02,2.12,2.22|0.28,0.56,0.85,1.12,1.42,1.68,1.97,2.26,2.54,2.84,3.12,3.40,3.84,4.10,4.53,4.80,5.45,6.02,6.40,6.80&chco=3072F3,ff0000,00aaaa&chls=2,4,1&chs=320x240&chds=0,201,0,7&chm=s,FF0000,0,-1,5|s,0000ff,1,-1,5|s,00aa00,2,-1,5
I've read the documentation over and over again, and I can't figure it out.
First a point of clarification. You talk about a "XY scatter plot", but these are actually 2 distinct chart types in the Google Chart API. Your URL refers to cht=lxy parameter which is an XY line chart.
The first problem with your URL is your data parameter (chd). Since it is an XY line chart, data sets must be defined in pairs but I see an odd number of data sets (3).
Christian D's response is incorrect. There is no percentage requirement.
You may be better off using a wrapper API which abstracts away many of these ugly details.
I think it actually does render both data sets, but you can only se one of them because there's only one scale on the y axis. (In other words, 0.10 is too small to show.)
And, you should really be using percentages. 100 is the highest accepted value:
Where chart data string consists of positive floating point numbers from zero (0.0) to one hundred (100.0)

How can I get Google Charts to display multiple colors in a scatter chart?

I would like to display multiple colors (and potentially shapes and sizes) of data points in a Google Chart scatter chart. Does anyone have an example of how to do so?
I answered my own question after waiting SECONDS for an answer here :-)
You can indeed have different colors for different data elements. For example:
http://chart.apis.google.com/chart?chs=300x200&cht=s&chd=t:1,2,3|6,5,4&chds=1,3,0,10&chxt=x,y&chxl=0:|0|1|2|1:|0|10&chm=d,ff0000,0,0,8,0|a,ff8080,0,1,42,0|c,ffff00,0,2,16,0
It's the chm= that does the magic. I was trying to have multiple chm= statements. You need to have just one, but with multiple descriptions separated by vertical bars.
You can only use one dataset in a scatter plot, thus only one color.
http://code.google.com/apis/chart/#scatter_plot
From the API description:
Scatter plots use multiple data sets differently than other chart types. You can only show one data set in a scatter plot.
You could effectively fake a multi-color scatter plot by using a line plot with white lines and colored shape markers at the points you want to display.
Here's another example: twitter charts. I'm hoping to do the same thing. Need to find out how to do the concentric circles.