Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Create range of bins counting values and add the percentage Post 303044540 by jiam912 on Tuesday 25th of February 2020 11:26:06 PM
Old 02-26-2020
Hi RudiC,,,

Tks a lot for the update it works fine...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to calculate the percentage for the values in column

Hi, I am having the file which contains the following two columns. 518 _factorial 256 _main 73 _atol 52 ___do_global_ctors 170 ___main 52 ___do_g How can calculate the percentage of each value in the first column ? first need to get the sum of the first column and... (3 Replies)
Discussion started by: saleru_raja
3 Replies

2. Shell Programming and Scripting

To Create range of values

Hi, I have a file with the below like values with integers only in sorted order (May or may not be in sequence) Eg: File1.txt ----------- 1 2 3 4 5 6 . . . . . 10000 My requirement here is to create a range of values out put to a temp k (4 Replies)
Discussion started by: shiva447
4 Replies

3. Shell Programming and Scripting

Howto: easy date range iteration/counting on GNU systems in the shell

Should work in any shell, but requires GNU date, although GNU date seems only to be happy for input dates between 1902 and 2037, inclusive (49673 days). Assume $a and $b hold two dates, e.g. set a=2010-03-27 set b=2010-04-04 Marginally faster: iterator: seq -f "$a +%1.0f days" 1 50000 |... (0 Replies)
Discussion started by: laddiebuck
0 Replies

4. UNIX for Dummies Questions & Answers

Working out the percentage between two values

Hi there, I am totally new to Unix, I am trying to work out the percentage between two values in a ksh shell script and assign the result to a variable. Value1=577 Values2=244 So the calculation would be as follows: ((Value1 - Value2) / Value1) * 100 How would I be able to achieve... (2 Replies)
Discussion started by: NextLevelAndi
2 Replies

5. Shell Programming and Scripting

return counting per hour percentage

We have a monitoring process for a load in unix box, during this process we are writing logs statements for each record, and during this process we are showing the counts per hour. Here is that how we are following log files statements: (just two lines printed here), these statements logged at... (1 Reply)
Discussion started by: skkuchipudi
1 Replies

6. Shell Programming and Scripting

Calculating frequency of values within bins

Hi, I am working with files containing 2 columns in which i need to come up with the frequency/count of values in col. 2 falling within specifics binned values of col. 1. the contents of a sample file is shown below: 15 12.5 15 11.2 16 0.2 16 1.4 17 1.6 18 4.5 17 5.6 12 8.6 11 7.2 9 ... (13 Replies)
Discussion started by: ida1215
13 Replies

7. Shell Programming and Scripting

Convert Column Values to a Range of Values

I have a list of columns with values that I need to transform into a row containing the range of each column. For example: "Column A" 1 2 3 4 10 12 14 15 16 17 18 "Column B" 1 4 5 6 (4 Replies)
Discussion started by: newbio
4 Replies

8. Shell Programming and Scripting

Delete row if both percentage values are equal to zero

Hello, I have compiled a script but I have stucked at one point. Each line contains two pcs of % value and what I want to do is to delete any line if both % values are zero. data: expected output: ow3 should be deleted as both percentage value in related line are equal to zero. ... (2 Replies)
Discussion started by: baris35
2 Replies

9. Shell Programming and Scripting

Create range of values and count values.

Gents, It is possible to generate a range of values according to column 1 and count the total of rows in the range. example input 15.3 15.5 15.8 15.9 16.0 16.1 16.8 17.0 17.5 18.0 output desired 15.0 - 15.9 = 4 (10 Replies)
Discussion started by: jiam912
10 Replies

10. UNIX for Beginners Questions & Answers

Create bins with totals and percentage

I would like to create bins to get histogram with totals and percentage, e.g. starting from 0. If possible to set the minimum and maximum value in the bins ( in my case value min=0 and max=20 ) Input file 8 5 10 1 11 4 12 4 12 4 13 5 16 7 18 9 16 9 17 7 18 5 19 5 20 1 21 7 (10 Replies)
Discussion started by: jiam912
10 Replies
mlib_ImageHistogram2(3MLIB)				    mediaLib Library Functions				       mlib_ImageHistogram2(3MLIB)

NAME
mlib_ImageHistogram2 - histogram SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageHistogram2(mlib_s32 **histo, const mlib_image *img, const mlib_s32 *numBins, const mlib_s32 *lowValue, const mlib_s32 *highValue, mlib_s32 xStart, mlib_s32 yStart, mlib_s32 xPeriod, mlib_s32 yPeriod); DESCRIPTION
The mlib_ImageHistogram2() function creates a histogram by scanning an image, counting the number of pixels within a given range for each channel of the image, and then generating a histogram. The image can have 1, 2, 3 or 4 channels. The data type of the image can be MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, or MLIB_INT. The histogram must have the same number of channels as the image has. One entry of the histogram, or a bin, is used to accumulate the number of pixels within a certain sub-range. The legal pixel range and the number of bins may be controlled separately. If binWidth is defined as (highValue - lowValue )/numBins then bin i counts pixel values in the following range: lowValue + i*binWidth <= x < lowValue + (i + 1)*binWidth The set of pixels scanned may furthermore be reduced by specifying xPeriod and yPeriod parameters that specify the sampling rate along each axis. The set of pixels to be accumulated may be obtained from the following equation: x = xStart + p*xPeriod; 0 <= p < (w - xStart)/xPeriod y = yStart + q*yPeriod; 0 <= q < (h - yStart)/yPeriod It is the user's responsibility to clear the histogram table before this function is called and to ensure that the histogram table supplied is suitable for the source image and the parameters. Otherwise, the result of this function is undefined. The range from lowValue[k] to (highValue[k] - 1) must be a valid subrange of the image type range. PARAMETERS
The function takes the following arguments: histo Pointer to histogram. The format of the histogram is histo[channel][index]. The index values for channel i can be 0, 1, ..., numBins[i]-1. img Pointer to source image. numBins The number of bins for each channel of the image. lowValue The lowest pixel value checked for each channel. highValue The highest pixel value checked for each channel. When counting the pixel values, highValue is not included. xStart The initial X sample coordinate. yStart The initial Y sample coordinate. xPeriod The X sampling rate. xPeriod >= 1. yPeriod The Y sampling rate. yPeriod >= 1. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageHistogram(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_ImageHistogram2(3MLIB)
All times are GMT -4. The time now is 05:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy