Octave: How to load grayscale images in double format? -


i using imread function in octave load image:

image = imread ("data/images/image1.jpg")(:); 

this apparently loading image matrix of integers values 0-255.

i want load matrix of doubles values 0.0-1.0. can convert this.

doubleimage = double(image) / 255.0; 

however, converting pretty slow, lot of images. there way load image directly matrix of doubles?

no, there no way directly read doubles. doesn't make sense anyway, because image integer in file, integers have read first. if conversion type done, makes sense done separated. or maybe, use file format stores images in double floating point precision.

however, there better way doing convert double.

pkg load image; img = imread ("image1.jpg"); img = im2double (img); 

using im2double won't make faster (the operation performs same yours) save if in future image read uint16, , if image of class double.

also, don't see how conversion double slow. fast operation.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -