Questions tagged [rescale]

155 questions
0
votes
0 answers

Scale numeric vector to specified mean, min, and max

This should be an easy question... I'm looking to scale a numeric vector to a specified mean and range. For instance, I would like to scale a vector, x, to mean = 1, min = 0, and max = 2. Here's my vector x, with min = 0, max = 1: > x <- runif(100,…
0
votes
1 answer

rescale images of unknown bit depth to fixed range automatically

I want to create an algorithm that can take a dataset and check how each image is represented and change the scale to 0-255 or 0-1 automatically. I know how this is done manually if I know how my full dataset is represented. Lets say my dataset is…
Kalle
  • 364
  • 1
  • 2
  • 14
0
votes
1 answer

Add a rescaling layer to a keras model

Suppose I have an input image of shape (100, 100, 3) and I want to rescale the image, i.e., make it smaller and have a dimension say (50, 50, 3), i.e., rescaling it to half. Would be better if Gaussian smoothing is applied to the image within the…
Jimut123
  • 474
  • 5
  • 14
0
votes
4 answers

how to rescale a column based on weight of another column in R?

I have a dataframe which includes col1(Counts) and col2(Date) df<-data.frame(col1=c(1,2,3,4,16,0),col2=c('10-12-2019','11-12-2019','13-01-2020','14-02-2020','01-03-2020','01-04-2020')) I want to create another column range(0-100) based on col1 for…
asaha
  • 53
  • 5
0
votes
1 answer

skimage.transform.rescale adds an extra dimension to input image

When using skimage.transform.rescale() I get an output image array of which has 3 dimensions when my input image is just 2 dimensions. from skimage import io, color, transform image =…
0
votes
0 answers

how to take images from list resize and scale pixel value between 0 to 1 using open CV

I have the following code that I thought would resize and scale the pixel value between 0 to 1, but when I run the code the output image that I am getting is not the same as the original one after resizing, kindly refer to the image for the output…
shankar
  • 39
  • 4
0
votes
0 answers

R: reshaping velocity profile

I have the following velocity profile, which I have plotted using a velocity vector (y-axis) and a time vector (x-axis): What I am trying to do now is to reshape the velocity profile so that I can have a new velocity profile where peak velocity is…
Mardock
  • 13
  • 4
0
votes
1 answer

R rescale 2nd Y-axis according to a variable

I have been trying to get a histogram and a line graph into one graph. The histogram is for exact amount of an antibiotic prescription (left y-axis). The line graph is the percentage of how much that antibiotic is used (right axis). So far, I have…
Roontje
  • 7
  • 5
0
votes
1 answer

Python - How can I convert a 2D grayscale image to a 1D vector

I'm learning python and am trying to learn about manipulating images. I want to rescale (downscale) a 2D graysacle image to a 1D vector (array of single row/column). In my test code, when I rescale the image, the output values in the array are in…
0
votes
0 answers

How to change the starting value of the guide in a ggplot choropleth?

i just need a minor tweak. I am drawing a choropleth with ggplot. Everything works fine, except one ecstatically misleading aspect: as you can see in the figure here ggplot picks 0 as a starting value for the shading of the provinces, while the…
Manolo
  • 73
  • 8
0
votes
2 answers

How Can I Re-scale An Array To A Range Of Values in Javascript?

I'd like to re-scale a two dimensional array with a function where the min and max input range and min and max output range can be specified. For example, we want to re-scale the values 0 to 8 to 0 to 1. const scale = (num, in_min, in_max, out_min,…
mmclean
  • 111
  • 1
  • 9
0
votes
2 answers

is there any difference in rescale 1./255 or 1/255 or 1/255. preprocess image data?

lot of image process program we use preprocess on data before it go for process and use rescale on data for…
GursimranSe
  • 99
  • 2
  • 8
0
votes
1 answer

Convert length of time to minute format

I am currently passing arguments to gnuplot via shell. I am extracting data that has a timescale in milliseconds (just a raw length) The x axis is displayed with these raw values (ie 6000, 120000, 18456...) I would like to convert it to minutes or…
trexgris
  • 362
  • 3
  • 14
0
votes
1 answer

Python: Remap and reduce the range of numbers

I have some large unique numbers that are some sort of identity of devices clusteringOutput[:,1] Out[140]: array([1.54744609e+12, 1.54744946e+12, 1.54744133e+12, ..., 1.54744569e+12, 1.54744570e+12, 1.54744571e+12]) even though the numbers…
Alex P
  • 137
  • 1
  • 13
0
votes
0 answers

How to rescale and save image in MATLAB?

I am reading an 'MHD' file which it's giving me info like below: Filename: 'patient0001_2CH_ED_gt.mhd' Format: 'MHA' CompressedData: 'false' ObjectType: 'image' NumberOfDimensions: 3 BinaryData: 'true' …
AI_NA
  • 336
  • 2
  • 5
  • 20