histogram

Optimizing SIMD histogram calculation

被刻印的时光 ゝ 提交于 2019-12-08 16:03:34
I worked on a code that implements an histogram calculation given an opencv struct IplImage * and a buffer unsigned int * to the histogram. I'm still new to SIMD so I might not be taking advantage of the full potential the instruction set provides. histogramASM: xor rdx, rdx xor rax, rax mov eax, dword [imgPtr + imgWidthOffset] mov edx, dword [imgPtr + imgHeightOffset] mul rdx mov rdx, rax ; rdx = Image Size mov r10, qword [imgPtr + imgDataOffset] ; r10 = ImgData NextPacket: mov rax, rdx movdqu xmm0, [r10 + rax - 16] mov rcx,16 ; 16 pixels/paq PacketLoop: pextrb rbx, xmm0, 0 ; saving the pixel

R histogram - too many variables

…衆ロ難τιáo~ 提交于 2019-12-08 14:05:13
问题 I am trying to illustrate a histogram of 33 different variables. Due to the number of variables I think "beside" different Colors I need to label each bar in a clear way, even using an arrow, if its doable. I was wondering about 1) How can I define 33 distinct color in R 2) How can I label them, say vertical below X axis with a certain distance from each other to make my figure more clear. I am using multhist function from Plotrix package, and for data you can image just 33 random vector with

Skip Error and Continue Function in R

…衆ロ難τιáo~ 提交于 2019-12-08 13:35:23
问题 I have a data set with p number of variables. I want a function that creates histograms of each variable, and when it encounters a problem it attempts to create a barplot instead. If it encounters a problem after attempting the barplot it skips that p, and continues to the next p. What I'm thinking (pseudocode): for (i in ncol(data)) { try( hist(data[i])) { if "error" try( barplot(data[i])) { if "error" print ("Error") } } continue to i # code executes through all columns of data } } I've

Using matplotlib how could I plot a histogram with given data in python

南笙酒味 提交于 2019-12-08 12:52:54
问题 here is the data: 111, 3 122, 4 155, 3 192, 5 11, 9 123, 10 120, 23 now how could I able to plot a histogram using this two set of data in matplotlib . please help. 回答1: You can create a barchart like this: from matplotlib.pyplot import * x = [111,122,155,192,11,123,120,] y = [3,4,3,5,9,10,23] bar(x,y) show() gives: Using hist() bins your data for you, so you would pass it your raw data, ie. it would look like this: data = [111, 111, 111, 122, 122, 122, 122, 155, ...] 来源: https:/

Align x-axis to plot for consistent use with grid

寵の児 提交于 2019-12-08 09:09:08
问题 I'm trying to build an histogram using data available from here. I'm using using the CSV version of this database to display the number of exoplantes discovered per year. A simple script would be bulkdata <- read.csv('file.csv',head=1,sep=',') pdf(file="yearcount.pdf",family="Times") bins <- seq(min(bulkdata$discovered,na.rm=T),max(bulkdata$discovered,na.rm=T),by=1) hist(bulkdata$discovered,breaks=bins,col='gray',ylab="Discovered",xlab="Year",main="",ylim=c(0,100),axes=FALSE) axis(1, at=seq

d3.js bar charts transitioning between multiple csv files

允我心安 提交于 2019-12-08 08:32:22
问题 I'm working on visualizing term frequencies for some Twitter data I've collected about the Winter Olympics. I'd like to make a histogram using d3 that will visualize these counts and allow users to toggle between datasets for each day of the games. I have an initial visualization I'm fairly happy with here, modified from this example. However, when clicking the "Update" button in the lower right corner, this simply overlays a new histogram on top of the existing one. Both datasets are CSV's,

Comparing pictures using Android - OpenCV

自闭症网瘾萝莉.ら 提交于 2019-12-08 07:20:50
问题 I want to compare two pictures similarity Code: Mat mat1=Highgui.imread("/mnt/sdcard/91.png"); Mat mat2=Highgui.imread("/mnt/sdcard/92.png"); double distance = Imgproc.compareHist(mat1, mat2, Imgproc.CV_COMP_CORREL); //(this line throws an exception) Exception information: 01-30 10:48:20.203: E/AndroidRuntime(3540): Caused by: CvException [org.opencv.core.CvException: /home/andreyk/OpenCV2/trunk/opencv/modules/imgproc/src/histogram.cpp:1387: error: (-215) H1.type() == H2.type() && H1.type() =

How to calculate image histogram of 32bit floating point image in OPenCV

梦想与她 提交于 2019-12-08 07:17:22
问题 I want to calculate histogram of an image hows pixels are of type 32F (32 bit floating point). What should be the parameter values of "calcHist" function for: - dims - bins - range 回答1: Well I've done this many times. Something like so: cv::Mat matSrc; // this is a CV_32FC1 normalised image int nHistSize = 65536; float fRange[] = { 0.0f, 1.0f }; const float* fHistRange = { fRange }; cv::Mat matHist; cv::calcHist(&matSrc, 1, 0, cv::Mat(), matHist, 1, &nHistSize, &fHistRange); As it says in the

geom_text works for histogram in R?

橙三吉。 提交于 2019-12-08 06:40:00
问题 Wondering if geom_text works for hist ? Tried following code and it seems no effect. I just want to show label (the number of elements belonging to a specific histogram bucket), when plotting each bar for each histogram bucket. Any solutions are appreciated. Thanks. p <- hist(df$foo, main="title",xlab="foo") p + geom_text() Edit 1 , tried geom_bar , here is my code and it seems not working well, since I expect a number labelled on each bar. In the diagram, it only shows 2.5, 5, 7.5 and 10, I

Histogram per hour - matplotlib

依然范特西╮ 提交于 2019-12-08 06:03:52
问题 I'm analyzing public data on transport accidents in the UK. My dataframe looks like this : Index Time 0 02:30 1 00:37 2 01:25 3 09:15 4 07:53 5 09:29 6 08:53 7 10:05 I'm trying to plot a histogram showing accident distribution by time of day, here is my code : import matplotlib import matplotlib.pyplot as plt import numpy as np import datetime as dt import matplotlib.dates as mdates df['hour']=pd.to_datetime(df['Time'],format='%H:%M') df.set_index('hour', drop=False, inplace=True) df['hour']