From: Shamane on 18 Feb 2010 14:03 Hi everyone, this is so urgent because I'm rushing for a deadline and I can't seem to solve it! :( Here's the background: Initially, I have an image X in Lab type which can be converted successfully from Lab to srgb using: srgb_image = applycform(X, makecform('lab2srgb')); However, I realised that the pixels in my Lab image were diagonally switched, which was the root cause of why my image colors were flipped diagonally. Hence, after making ammendments to my error and swapping my x and y coordinates, I tried to convert from Lab to srgb but this time to no avail. Here are the errors: ??? Error using ==> iptcheckinput Function APPLYCFORM expected its first input, IN, to be finite. Error in ==> applycform>check_inputs at 108 iptcheckinput(in,{'double','uint8','uint16'},{'real','nonsparse','finite'},... Error in ==> applycform at 58 check_inputs(in); Error in ==> test at 139 srgb_image = applycform(X, makecform('lab2srgb')); How come now my image X is not detected as finite by the function APPLYCFORM? Will really appreciate your help.
From: Steve Eddins on 18 Feb 2010 14:31 Shamane wrote: > Hi everyone, this is so urgent because I'm rushing for a deadline and I > can't seem to solve it! :( Here's the background: Initially, I have an > image X in Lab type which can be converted successfully from Lab to srgb > using: > srgb_image = applycform(X, makecform('lab2srgb')); > > However, I realised that the pixels in my Lab image were diagonally > switched, which was the root cause of why my image colors were flipped > diagonally. Hence, after making ammendments to my error and swapping my > x and y coordinates, I tried to convert from Lab to srgb but this time > to no avail. Here are the errors: > > ??? Error using ==> iptcheckinput > Function APPLYCFORM expected its first input, IN, to be finite. > > Error in ==> applycform>check_inputs at 108 > iptcheckinput(in,{'double','uint8','uint16'},{'real','nonsparse','finite'},... > > > Error in ==> applycform at 58 > check_inputs(in); > > Error in ==> test at 139 > srgb_image = applycform(X, makecform('lab2srgb')); > > How come now my image X is not detected as finite by the function > APPLYCFORM? Will really appreciate your help. Well, my initial guess is that some element of X is not finite. ;-) What do you get when you do this: any(~isfinite(X(:))) --- Steve Eddins http://blogs.mathworks.com/steve/
From: Shamane on 19 Feb 2010 04:25 Steve Eddins <Steve.Eddins(a)mathworks.com> wrote in message <hlk4j7$2an$1(a)fred.mathworks.com>... > Shamane wrote: > > Hi everyone, this is so urgent because I'm rushing for a deadline and I > > can't seem to solve it! :( Here's the background: Initially, I have an > > image X in Lab type which can be converted successfully from Lab to srgb > > using: > > srgb_image = applycform(X, makecform('lab2srgb')); > > > > However, I realised that the pixels in my Lab image were diagonally > > switched, which was the root cause of why my image colors were flipped > > diagonally. Hence, after making ammendments to my error and swapping my > > x and y coordinates, I tried to convert from Lab to srgb but this time > > to no avail. Here are the errors: > > > > ??? Error using ==> iptcheckinput > > Function APPLYCFORM expected its first input, IN, to be finite. > > > > Error in ==> applycform>check_inputs at 108 > > iptcheckinput(in,{'double','uint8','uint16'},{'real','nonsparse','finite'},... > > > > > > Error in ==> applycform at 58 > > check_inputs(in); > > > > Error in ==> test at 139 > > srgb_image = applycform(X, makecform('lab2srgb')); > > > > How come now my image X is not detected as finite by the function > > APPLYCFORM? Will really appreciate your help. > > Well, my initial guess is that some element of X is not finite. ;-) > > What do you get when you do this: > > any(~isfinite(X(:))) > > --- > Steve Eddins > http://blogs.mathworks.com/steve/ I tried, the answer is 1... so that means it's finite right? So how come it's not detected by the function APPLYCFORM?
From: Shamane on 19 Feb 2010 04:49 "Shamane " <tan.shamane(a)gmail.com> wrote in message <hllle2$p81$1(a)fred.mathworks.com>... > Steve Eddins <Steve.Eddins(a)mathworks.com> wrote in message <hlk4j7$2an$1(a)fred.mathworks.com>... > > Shamane wrote: > > > Hi everyone, this is so urgent because I'm rushing for a deadline and I > > > can't seem to solve it! :( Here's the background: Initially, I have an > > > image X in Lab type which can be converted successfully from Lab to srgb > > > using: > > > srgb_image = applycform(X, makecform('lab2srgb')); > > > > > > However, I realised that the pixels in my Lab image were diagonally > > > switched, which was the root cause of why my image colors were flipped > > > diagonally. Hence, after making ammendments to my error and swapping my > > > x and y coordinates, I tried to convert from Lab to srgb but this time > > > to no avail. Here are the errors: > > > > > > ??? Error using ==> iptcheckinput > > > Function APPLYCFORM expected its first input, IN, to be finite. > > > > > > Error in ==> applycform>check_inputs at 108 > > > iptcheckinput(in,{'double','uint8','uint16'},{'real','nonsparse','finite'},... > > > > > > > > > Error in ==> applycform at 58 > > > check_inputs(in); > > > > > > Error in ==> test at 139 > > > srgb_image = applycform(X, makecform('lab2srgb')); > > > > > > How come now my image X is not detected as finite by the function > > > APPLYCFORM? Will really appreciate your help. > > > > Well, my initial guess is that some element of X is not finite. ;-) > > > > What do you get when you do this: > > > > any(~isfinite(X(:))) > > > > --- > > Steve Eddins > > http://blogs.mathworks.com/steve/ > > I tried, the answer is 1... so that means it's finite right? So how come it's not detected by the function APPLYCFORM? Maybe is there a way to convert the image to finite or make it be detected by the function APPLYCFORM as finite?
From: Oleg Komarov on 19 Feb 2010 05:54 > > What do you get when you do this: > > > > any(~isfinite(X(:))) > > > > --- > > Steve Eddins > > http://blogs.mathworks.com/steve/ > > I tried, the answer is 1... so that means it's finite right? So how come it's not detected by the function APPLYCFORM? No it doesn't. 1. isfinite(X(:)) --> element by element the question is "are you finite"? 2. ~isfinite --> the question becomes "are you NOT finite?" 3. any(...) --> are there any NON finite elements 1 --> yes, there are NON finite elements. Oleg
|
Next
|
Last
Pages: 1 2 Prev: Concatenate problem Next: Help with removing points from a matrix of points |