histogram

iOS GLSL. Is There A Way To Create An Image Histogram Using a GLSL Shader?

走远了吗. 提交于 2019-11-27 19:10:15
Elsewhere on StackOverflow a question was asked regarding a depthbuffer histogram - Create depth buffer histogram texture with GLSL . I am writing an iOS image-processing app and am intrigued by this question but unclear on the answer provided. So, is it possible to create an image histogram using the GPU via GLSL? Yes, it is. It's not clearly the best approach, but it's indeed the best one available in iOS, since OpenCL is not supported. You'll lose elegance, and your code will probably not as straightforward, but almost all OpenCL features can be achieved with shaders. If it helps, DirectX11

Histogram equalization of grayscale images with NumPy

。_饼干妹妹 提交于 2019-11-27 18:45:31
问题 How to do histogram equalization for multiple grayscaled images stored in a NumPy array easily? I have the 96x96 pixel NumPy data in this 4D format: (1800, 1, 96,96) 回答1: Moose's comment which points to this blog entry does the job quite nicely. For completeness I give an axample here using nicer variable names and a looped execution on 1000 96x96 images which are in a 4D array as in the question. It is fast (1-2 seconds on my computer) and only needs NumPy. import numpy as np def image

Plotting histograms from grouped data in a pandas DataFrame

♀尐吖头ヾ 提交于 2019-11-27 18:42:58
I need some guidance in working out how to plot a block of histograms from grouped data in a pandas dataframe. Here's an example to illustrate my question: from pandas import DataFrame import numpy as np x = ['A']*300 + ['B']*400 + ['C']*300 y = np.random.randn(1000) df = DataFrame({'Letter':x, 'N':y}) grouped = df.groupby('Letter') In my ignorance I tried this code command: df.groupby('Letter').hist() which failed with the error message "TypeError: cannot concatenate 'str' and 'float' objects" Any help most appreciated. dreme I'm on a roll, just found an even simpler way to do it using the by

add horizontal line histogram gnuplot

核能气质少年 提交于 2019-11-27 16:30:01
问题 I would like to add a horizontal line in my histogram in gnuplot, is that possible? My histogram has on the x axis: alea1 alea 2 alea3 nalea1 nalea 2 nalea 3 and the y axis goes from 0 to 25. At 22, I want to add a horizontal line that goes all the way across from one end to the other end of the histogram. 回答1: Try adding , 22 title "" at the end of your plot command. Works for my test data (file "histo"): # Year Red Green Blue 1990 33 45 18 1991 35 42 19 1992 34 44 14 1993 37 43 25 1994 47

Formatting histogram x-axis when working with dates using R

眉间皱痕 提交于 2019-11-27 16:23:30
问题 I am in the process of creating an epidemic curve (histogram of number of cases of a disease per day) using R, and am struggling a little with formatting the x-axis. I am aware that ggplot gives very nice graphs and easily manipulatable axes ( Understanding dates and plotting a histogram with ggplot2 in R ), but in this case I prefer to use the hist() command, because I am describing 2 different patterns at the same time, as below (I don't think you can do something similar in ggplot): The

Multiple histograms in Pandas

青春壹個敷衍的年華 提交于 2019-11-27 15:50:46
问题 I would like to create the following histogram (see image below) taken from the book "Think Stats". However, I cannot get them on the same plot. Each DataFrame takes its own subplot. I have the following code: import nsfg import matplotlib.pyplot as plt df = nsfg.ReadFemPreg() preg = nsfg.ReadFemPreg() live = preg[preg.outcome == 1] first = live[live.birthord == 1] others = live[live.birthord != 1] #fig = plt.figure() #ax1 = fig.add_subplot(111) first.hist(column = 'prglngth', bins = 40,

How to compute “EMD” for 2 numpy arrays i.e “histogram” using opencv?

老子叫甜甜 提交于 2019-11-27 15:00:48
问题 Since I'm new to opencv, I don't know how to use the cv.CalcEMD2 function with numpy arrays. I have two arrays: a=[1,2,3,4,5] b=[1,2,3,4] How can I transfer numpy array to CVhistogram and from Cvhistogram to the function parameter signature ? I would like anyone who answers the question to explain any used opencv functions through the provided solution. "EMD" == earth mover's distance. Update:- also ,It will be helpful if anyone can tell me how to set the cv.CalcEMD2 parameter i.e "signature"

Methods to vectorise histogram in SIMD?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 14:23:14
I am trying to implement histogram in Neon. Is it possible to vectorise ? Histogramming is almost impossible to vectorize, unfortunately. You can probably optimise the scalar code somewhat however - a common trick is to use two histograms and then combine them at the end. This allows you to overlap loads/increments/stores and thereby bury some of the serial dependencies and associated latencies. Pseudo code: init histogram 1 to all 0s init histogram 2 to all 0s loop get input value 1 get input value 2 load count for value 1 from histogram 1 load count for value 2 from histogram 2 increment

python plot simple histogram given binned data

落花浮王杯 提交于 2019-11-27 12:42:37
I have count data (a 100 of them), each correspond to a bin (0 to 99). I need to plot these data as histogram. However, histogram count those data and does not plot correctly because my data is already binned. import random import matplotlib.pyplot as plt x = random.sample(range(1000), 100) xbins = [0, len(x)] #plt.hist(x, bins=xbins, color = 'blue') #Does not make the histogram correct. It counts the occurances of the individual counts. plt.plot(x) #plot works but I need this in histogram format plt.show() redrah If I'm understanding what you want to achieve correctly then the following

Plotting probability density function by sample with matplotlib [closed]

ⅰ亾dé卋堺 提交于 2019-11-27 12:31:33
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I want to plot an approximation of probability density function based on a sample that I have; The curve that mimics the histogram behaviour. I can have samples as big as I want. 回答1: If you want to plot a