However, if I load the saved image and run that same for loop on the values, I get tons of numbers over 23. If I run a for loop to check this on the array, this remains true. Retain unchanged data when saving Numpy array to image with Scipy imsave Asked 3 Months ago Answers: 5 Viewed 58 times When saving a 2-dimensional Numpy array (of single values) with Scipy toimage or imsave the pixel values do not exactly match those in the Numpy array. These are the functions I'm using to create my disparity maps, given two pgm images that have been shifted along the x axis: def disp(i, j, winSize, leftIm, rightIm): #calculate disparity for a given point I thought that perhaps imsave was stretching the values so that the max value showed up as 255 in the image, but I have other images created with imsave that have a max below 255. Proposed solution Moving some to scipy.ndimage and others to scipy.io: scipy.mis. For example, in the array, none of the values are greater than 22, but in the image, I have a full range of values from 0 to 255. The issue imread is in scipy.ndimage and imshow and imsave are in scipy.misc This seems inconsistent / unlogical from a users perspective. I'm trying to write code that will produce disparity maps using numpy and scipy, but the values that I store in my numpy array for my images are completely different from the values that are actually showing up in my output images, saved with misc.imsave.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |