Questions tagged [rescale]

155 questions
2
votes
3 answers

Scaling a 2D polygon with the mouse

I develop a Python-based drawing program, Whyteboard (https://launchpad.net/whyteboard) I'm developing features to allow the user to rotate and scale a polygon that they draw. Here's my problem: I have a Polygon class containing a list of all…
Steven Sproat
  • 4,398
  • 4
  • 27
  • 40
2
votes
2 answers

fit image to screen properly in javascript

I need to resize image from its natural size to fit the screen the same way as Chrome does with opened images in it, I wrote a rescale() function for this purpose (below). It works mostly fine but for big landscape-oriented images (example where…
Owyn
  • 663
  • 2
  • 8
  • 17
2
votes
2 answers

Resizing image using its data

I have a C++ program which reads in an image file, deals with the header, and then stores the image's colour data in a pointer to a pointer of chars unsigned char** pixelData = new unsigned char*[header.width*header.height]; for(int…
cool mr croc
  • 725
  • 1
  • 13
  • 33
1
vote
1 answer

Rescale column in dataframe?

I have a dataframe called data where I would like to rescale the values in the 4th field to a range of 0-1000 and round the scaled value to the nearest integer. I'm trying to use ddply, round and rescale: scaled_data <- ddply(data,…
drbunsen
  • 10,139
  • 21
  • 66
  • 94
1
vote
1 answer

R: Get values from separate dataframes based on the running values of a group_by function

I have the following dataframe. Col1 = c("A1", "A1", "A2", "A2") Col2 = c("B1", "B1", "B2", "B2") Value = c(10, 20, 30, 40) df = data.frame(Col1, Col2, Value) This is a dataframe with various observations. Two factor columns and a value column.…
vic
  • 359
  • 4
  • 18
1
vote
0 answers

Vector size reduction preserving dot product

I have Vectors with size n=1000..3000 which have a mean=0 and std-dev=1/sqrt(n) and length/norm=1. My question is what formula, algorithm I can use to reduce the vectors size but preserve the DOT product similarity i.e. after re-scaling the dot…
sten
  • 7,028
  • 9
  • 41
  • 63
1
vote
4 answers

Rescaling numbers between 0 and 1

I have the following list of numbers: 3.16, 4.72, 6.44, 8.25, 3.76, 4.87, 5.76, 6.5, 7.32 I have to rescale the numbers between (0, 1) such that: 1)The smallest number gets a value closest to 0 but not 0. 2) The largest number gets a value closest…
Rahul Rakshit
  • 13
  • 1
  • 3
1
vote
0 answers

Does ImageDataGenerator changes (preprocess) all data or only the new ones?

I created a mobileNetv2 cnn model and using the imageDataGenerator with the preprocess parameter. Now I am asking myself whether it it enough for resclaling or does imageDataGenerator only modify the new images, which would mean I need to rescale…
deny
  • 11
  • 2
1
vote
1 answer

Multiple Features in MinMaxScaler in R

I have a dataframe with 7 different features. I need to scale the values but for for each isolated feature. I am currently using the "rescale". However, I can only fit it to one column and transform all the data with these min and max values for 1…
1
vote
1 answer

Plotly animated Sankey rescaling R

I've created a large animated sankey diagram with Plotly in R. At each step in the animation Plotly rescales the the height of the links, whereas the height should be constant over time. That is, a link with a constant value should always have the…
Julian
  • 11
  • 3
1
vote
3 answers

rescale the selective range into 0 - 1?

I have a data frame like this: df <- data.frame(FC=c(1, 2, 4, 2, 1, -4, -2)) And I'm trying to rescale the positive values between 0-1 and negative values also between 0- -1 so the output would be: FC 0.25 0.5 1 0.5 0.25 -1 -0.5 I have…
SUMIT
  • 563
  • 4
  • 12
1
vote
1 answer

How can i resize the video bytes to smaller resolution in java?

I am currently using REST API. I have been trying to resize the video bytes received to me to a smaller resolution through java. I am able to resize the image using BufferedImage and ImageIO in java but am not able to do the same for video…
Srikanth
  • 21
  • 7
1
vote
1 answer

How can I resize a rectangular image to a square image while maintaining aspect ratio in Java?

I need to resize rectangular images (400x600) into square images (600x600) while keeping aspect ratio of the original image. The newly added pixels need to be transparent. Like this. I need it in java or kotlin code. But if that's not possible then…
Haris
  • 13
  • 5
1
vote
1 answer

Rescaling vegetation index in R

I am having some trouble integrating a rescaling method within a function that is calculating a vegetation index for a raster. I tried using a formula from this solution. The code would run, but I would get two warning messages and my image would be…
Binx
  • 382
  • 7
  • 22
1
vote
1 answer

Using rescale function after grouping data in R

I have a data frame that measures vertical movement of multiple objects with unique ID's. I want to rescale the X,Y coordinates from pixels to cm by using the rescale package. Each object has a minimum value of 0cm and maximum of 12.5cm, but the…
Emily
  • 13
  • 3
1 2
3
10 11