f



please help help

hello,
please I faced a problem in dwt2 with color image .
y=imread('lenna.bmp');
t=dwt2(y,'db1')

the following message is appearing:

 ?? Error using ==> >
Matrix dimensions must agree.

Error in ==> D:\MATLAB6p5\toolbox\wavelet\wavelet\wkeep.m 
(GetFirstLast)
On line 48 ==> K = find(s>sx);

Error in ==> D:\MATLAB6p5\toolbox\wavelet\wavelet\wkeep.m
On line 35 ==> [first,last,ok] = GetFirstLast
(sx,begInd,varargin{:});

Error in ==> D:\MATLAB6p5\toolbox\wavelet\wavelet\dwt2.m 
(convdown)
On line 86 ==> y = wkeep(y,sizeKEPT);

Error in ==> D:\MATLAB6p5\toolbox\wavelet\wavelet\dwt2.m
On line 74 ==> a = convdown(z,Lo_D,sizeKEPT,shift);

thanks in advance,

0
halmamory (279)
2/8/2008 4:49:01 PM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

9 Replies
733 Views

Similar Articles

[PageSpeed] 15

On Feb 8, 11:49 am, "huda nawaf" <halmam...@yahoo.com> wrote:
> hello,
> please I faced a problem in dwt2 with color image .
> y=imread('lenna.bmp');
> t=dwt2(y,'db1')
>
> the following message is appearing:
>
>  ?? Error using ==> >
> Matrix dimensions must agree.
>
> Error in ==> D:\MATLAB6p5\toolbox\wavelet\wavelet\wkeep.m
> (GetFirstLast)
> On line 48 ==> K = find(s>sx);
>
> Error in ==> D:\MATLAB6p5\toolbox\wavelet\wavelet\wkeep.m
> On line 35 ==> [first,last,ok] = GetFirstLast
> (sx,begInd,varargin{:});
>
> Error in ==> D:\MATLAB6p5\toolbox\wavelet\wavelet\dwt2.m
> (convdown)
> On line 86 ==> y = wkeep(y,sizeKEPT);
>
> Error in ==> D:\MATLAB6p5\toolbox\wavelet\wavelet\dwt2.m
> On line 74 ==> a = convdown(z,Lo_D,sizeKEPT,shift);
>
> thanks in advance,

Maybe something went wrong with your read
of the image. Try this:

 y=imread('lenna.bmp');
 size(y)

                 - Randy
0
poespam-trap (1550)
2/8/2008 4:59:48 PM
Randy Poe <poespam-trap@yahoo.com> wrote in message 
<16e899a1-a0b9-4a62-b89a-
649baad11413@l1g2000hsa.googlegroups.com>...
> On Feb 8, 11:49 am, "huda nawaf" <halmam...@yahoo.com> 
wrote:
> > hello,
> > please I faced a problem in dwt2 with color image .
> > y=imread('lenna.bmp');
> > t=dwt2(y,'db1')
> >
> > the following message is appearing:
> >
> >  ?? Error using ==> >
> > Matrix dimensions must agree.
> >
> > Error in ==> D:\MATLAB6p5
\toolbox\wavelet\wavelet\wkeep.m
> > (GetFirstLast)
> > On line 48 ==> K = find(s>sx);
> >
> > Error in ==> D:\MATLAB6p5
\toolbox\wavelet\wavelet\wkeep.m
> > On line 35 ==> [first,last,ok] = GetFirstLast
> > (sx,begInd,varargin{:});
> >
> > Error in ==> D:\MATLAB6p5
\toolbox\wavelet\wavelet\dwt2.m
> > (convdown)
> > On line 86 ==> y = wkeep(y,sizeKEPT);
> >
> > Error in ==> D:\MATLAB6p5
\toolbox\wavelet\wavelet\dwt2.m
> > On line 74 ==> a = convdown(z,Lo_D,sizeKEPT,shift);
> >
> > thanks in advance,
> 
> Maybe something went wrong with your read
> of the image. Try this:
> 
>  y=imread('lenna.bmp');
>  size(y)
> 
>                  - Randy

no the problem is not relate with size because the same 
command is working with gray image.
the prob. with color image only.please if you have idea 
tell me

thanks

0
halmamory (279)
2/8/2008 7:26:01 PM
In article <foiac9$7rk$1@fred.mathworks.com>,
huda nawaf <halmamory@yahoo.com> wrote:

>no the problem is not relate with size because the same 
>command is working with gray image.
>the prob. with color image only.please if you have idea 
>tell me

doc dwt2

  The dwt2 command performs a single-level two-dimensional wavelet
  decomposition with respect to either a particular wavelet ('wname',
  see wfilters for more information) or particular wavelet
  decomposition filters (Lo_D and Hi_D) you specify.


Your color image is probably a truecolor image, which would be
a three-dimensional array, not a two-dimensional array.
-- 
  "Is there any thing whereof it may be said, See, this is new? It hath
  been already of old time, which was before us."    -- Ecclesiastes
0
roberson2 (8602)
2/8/2008 7:59:17 PM
On Feb 8, 2:26 pm, "huda nawaf" <halmam...@yahoo.com> wrote:
> Randy Poe <poespam-t...@yahoo.com> wrote in message
>
> <16e899a1-a0b9-4a62-b89a-
> 649baad11...@l1g2000hsa.googlegroups.com>...> On Feb 8, 11:49 am, "huda nawaf" <halmam...@yahoo.com>
> wrote:
> > > hello,
> > > please I faced a problem in dwt2 with color image .
> > > y=imread('lenna.bmp');
> > > t=dwt2(y,'db1')
>
> > > the following message is appearing:
>
> > >  ?? Error using ==> >
> > > Matrix dimensions must agree.
>
> > > Error in ==> D:\MATLAB6p5
>
> \toolbox\wavelet\wavelet\wkeep.m> > (GetFirstLast)
> > > On line 48 ==> K = find(s>sx);
>
> > > Error in ==> D:\MATLAB6p5
>
> \toolbox\wavelet\wavelet\wkeep.m> > On line 35 ==> [first,last,ok] = GetFirstLast
> > > (sx,begInd,varargin{:});
>
> > > Error in ==> D:\MATLAB6p5
>
> \toolbox\wavelet\wavelet\dwt2.m> > (convdown)
> > > On line 86 ==> y = wkeep(y,sizeKEPT);
>
> > > Error in ==> D:\MATLAB6p5
>
> \toolbox\wavelet\wavelet\dwt2.m
>
> > > On line 74 ==> a = convdown(z,Lo_D,sizeKEPT,shift);
>
> > > thanks in advance,
>
> > Maybe something went wrong with your read
> > of the image. Try this:
>
> >  y=imread('lenna.bmp');
> >  size(y)
>
> no the problem is not relate with size because the same
> command is working with gray image.

Actually, the problem IS with size. See below.

> the prob. with color image only.please if you have idea
> tell me

But as Walter mentioned, size(y) would have given you
a clue. I was expecting that you would find size(y) = 0
because there was a problem reading.

It looks more like the problem is that you need to convert
your color image (a 3-D array) into a suitable 2-D format.

In either case, if you had tried what I suggested you would
have gotten useful information.

                 - Randy
0
poespam-trap (1550)
2/8/2008 8:34:43 PM
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in 
message <foical$80m$1@canopus.cc.umanitoba.ca>...
> In article <foiac9$7rk$1@fred.mathworks.com>,
> huda nawaf <halmamory@yahoo.com> wrote:
> 
> >no the problem is not relate with size because the same 
> >command is working with gray image.
> >the prob. with color image only.please if you have idea 
> >tell me
> 
> doc dwt2
> 
>   The dwt2 command performs a single-level two-
dimensional wavelet
>   decomposition with respect to either a particular 
wavelet ('wname',
>   see wfilters for more information) or particular 
wavelet
>   decomposition filters (Lo_D and Hi_D) you specify.
> 
> 
> Your color image is probably a truecolor image, which 
would be
> a three-dimensional array, not a two-dimensional array.
> -- 
>   "Is there any thing whereof it may be said, See, this 
is new? It hath
>   been already of old time, which was before us."    -- 
Ecclesiastes

really im in a problem ,
you are right the color image is 3 dim.
but in matlab toolbox there are color image work with dwt2.
even if the color image work with dwt2 .the result after 
image processing is gray image not colored while in run 
demo in matlab there are colored images be colored even 
after the processing ( i mean thier coefficients is 
colored not gray)
..
your reply is very hany for me

0
halmamory (279)
2/8/2008 8:51:03 PM
Randy Poe <poespam-trap@yahoo.com> wrote in message 
<736bb933-16f2-4744-bb62-
aa343534d982@y5g2000hsf.googlegroups.com>...
> On Feb 8, 2:26 pm, "huda nawaf" <halmam...@yahoo.com> 
wrote:
> > Randy Poe <poespam-t...@yahoo.com> wrote in message
> >
> > <16e899a1-a0b9-4a62-b89a-
> > 649baad11...@l1g2000hsa.googlegroups.com>...> On Feb 
8, 11:49 am, "huda nawaf" <halmam...@yahoo.com>
> > wrote:
> > > > hello,
> > > > please I faced a problem in dwt2 with color image .
> > > > y=imread('lenna.bmp');
> > > > t=dwt2(y,'db1')
> >
> > > > the following message is appearing:
> >
> > > >  ?? Error using ==> >
> > > > Matrix dimensions must agree.
> >
> > > > Error in ==> D:\MATLAB6p5
> >
> > \toolbox\wavelet\wavelet\wkeep.m> > (GetFirstLast)
> > > > On line 48 ==> K = find(s>sx);
> >
> > > > Error in ==> D:\MATLAB6p5
> >
> > \toolbox\wavelet\wavelet\wkeep.m> > On line 35 ==> 
[first,last,ok] = GetFirstLast
> > > > (sx,begInd,varargin{:});
> >
> > > > Error in ==> D:\MATLAB6p5
> >
> > \toolbox\wavelet\wavelet\dwt2.m> > (convdown)
> > > > On line 86 ==> y = wkeep(y,sizeKEPT);
> >
> > > > Error in ==> D:\MATLAB6p5
> >
> > \toolbox\wavelet\wavelet\dwt2.m
> >
> > > > On line 74 ==> a = convdown(z,Lo_D,sizeKEPT,shift);
> >
> > > > thanks in advance,
> >
> > > Maybe something went wrong with your read
> > > of the image. Try this:
> >
> > >  y=imread('lenna.bmp');
> > >  size(y)
> >
> > no the problem is not relate with size because the same
> > command is working with gray image.
> 
> Actually, the problem IS with size. See below.
> 
> > the prob. with color image only.please if you have idea
> > tell me
> 
> But as Walter mentioned, size(y) would have given you
> a clue. I was expecting that you would find size(y) = 0
> because there was a problem reading.
> 
> It looks more like the problem is that you need to 
convert
> your color image (a 3-D array) into a suitable 2-D 
format.
> 
> In either case, if you had tried what I suggested you 
would
> have gotten useful information.
> 
>                  - Randy
 size of y :100 100 3
in fact i want see the coeficients of wavelet is 
colored .this is important in my work.

thanks
0
halmamory (279)
2/8/2008 9:01:04 PM
On Feb 8, 4:01 pm, "huda nawaf" <halmam...@yahoo.com> wrote:
> Randy Poe <poespam-t...@yahoo.com> wrote in message
>
> <736bb933-16f2-4744-bb62-
> aa343534d...@y5g2000hsf.googlegroups.com>...> On Feb 8, 2:26 pm, "huda nawaf" <halmam...@yahoo.com>
> wrote:
> > > Randy Poe <poespam-t...@yahoo.com> wrote in message
>
> > > <16e899a1-a0b9-4a62-b89a-
> > > 649baad11...@l1g2000hsa.googlegroups.com>...> On Feb
>
> 8, 11:49 am, "huda nawaf" <halmam...@yahoo.com>
>
> > > wrote:
> > > > > hello,
> > > > > please I faced a problem in dwt2 with color image .
> > > > > y=imread('lenna.bmp');
> > > > > t=dwt2(y,'db1')
>
> > > > > the following message is appearing:
>
> > > > >  ?? Error using ==> >
> > > > > Matrix dimensions must agree.
>
> > > > > Error in ==> D:\MATLAB6p5
>
> > > \toolbox\wavelet\wavelet\wkeep.m> > (GetFirstLast)
> > > > > On line 48 ==> K = find(s>sx);
>
> > > > > Error in ==> D:\MATLAB6p5
>
> > > \toolbox\wavelet\wavelet\wkeep.m> > On line 35 ==>
>
> [first,last,ok] = GetFirstLast
>
> > > > > (sx,begInd,varargin{:});
>
> > > > > Error in ==> D:\MATLAB6p5
>
> > > \toolbox\wavelet\wavelet\dwt2.m> > (convdown)
> > > > > On line 86 ==> y = wkeep(y,sizeKEPT);
>
> > > > > Error in ==> D:\MATLAB6p5
>
> > > \toolbox\wavelet\wavelet\dwt2.m
>
> > > > > On line 74 ==> a = convdown(z,Lo_D,sizeKEPT,shift);
>
> > > > > thanks in advance,
>
> > > > Maybe something went wrong with your read
> > > > of the image. Try this:
>
> > > >  y=imread('lenna.bmp');
> > > >  size(y)
>
> > > no the problem is not relate with size because the same
> > > command is working with gray image.
>
> > Actually, the problem IS with size. See below.
>
> > > the prob. with color image only.please if you have idea
> > > tell me
>
> > But as Walter mentioned, size(y) would have given you
> > a clue. I was expecting that you would find size(y) = 0
> > because there was a problem reading.
>
> > It looks more like the problem is that you need to
> convert
> > your color image (a 3-D array) into a suitable 2-D
> format.
>
> > In either case, if you had tried what I suggested you
> would
> > have gotten useful information.
>
>  size of y :100 100 3
> in fact i want see the coeficients of wavelet is
> colored .this is important in my work.

But there are three numbers in each pixel position,
corresponding to R, G, and B values. The wavelet
representation is for something which has a single
value at each position. So what do you mean by
the wavelet decomposition of the colored image?

Perhaps you want to do three decompositions?
One for y(:,:,1), one for y(:,:,2) and one for y(:,:,3)?

            - Randy
0
poespam-trap (1550)
2/8/2008 9:23:09 PM
In article <09949702-2ec2-40ac-b34c-74211a327fcb@p69g2000hsa.googlegroups.com>,
Randy Poe  <poespam-trap@yahoo.com> wrote:

>But there are three numbers in each pixel position,
>corresponding to R, G, and B values. The wavelet
>representation is for something which has a single
>value at each position. So what do you mean by
>the wavelet decomposition of the colored image?

>Perhaps you want to do three decompositions?
>One for y(:,:,1), one for y(:,:,2) and one for y(:,:,3)?

I thought of suggesting that, but a few minutes later on my way
down for coffee, I realized that he'd probably be better off working
in a different colorspace such as YCrCb (or whatever it is that
JPEG transforms images into before quantization.)
-- 
   "History is a pile of debris"                     -- Laurie Anderson
0
roberson2 (8602)
2/8/2008 10:17:55 PM
Randy Poe <poespam-trap@yahoo.com> wrote in message 
<09949702-2ec2-40ac-b34c-
74211a327fcb@p69g2000hsa.googlegroups.com>...
> On Feb 8, 4:01 pm, "huda nawaf" <halmam...@yahoo.com> 
wrote:
> > Randy Poe <poespam-t...@yahoo.com> wrote in message
> >
> > <736bb933-16f2-4744-bb62-
> > aa343534d...@y5g2000hsf.googlegroups.com>...> On Feb 
8, 2:26 pm, "huda nawaf" <halmam...@yahoo.com>
> > wrote:
> > > > Randy Poe <poespam-t...@yahoo.com> wrote in message
> >
> > > > <16e899a1-a0b9-4a62-b89a-
> > > > 649baad11...@l1g2000hsa.googlegroups.com>...> On 
Feb
> >
> > 8, 11:49 am, "huda nawaf" <halmam...@yahoo.com>
> >
> > > > wrote:
> > > > > > hello,
> > > > > > please I faced a problem in dwt2 with color 
image .
> > > > > > y=imread('lenna.bmp');
> > > > > > t=dwt2(y,'db1')
> >
> > > > > > the following message is appearing:
> >
> > > > > >  ?? Error using ==> >
> > > > > > Matrix dimensions must agree.
> >
> > > > > > Error in ==> D:\MATLAB6p5
> >
> > > > \toolbox\wavelet\wavelet\wkeep.m> > (GetFirstLast)
> > > > > > On line 48 ==> K = find(s>sx);
> >
> > > > > > Error in ==> D:\MATLAB6p5
> >
> > > > \toolbox\wavelet\wavelet\wkeep.m> > On line 35 ==>
> >
> > [first,last,ok] = GetFirstLast
> >
> > > > > > (sx,begInd,varargin{:});
> >
> > > > > > Error in ==> D:\MATLAB6p5
> >
> > > > \toolbox\wavelet\wavelet\dwt2.m> > (convdown)
> > > > > > On line 86 ==> y = wkeep(y,sizeKEPT);
> >
> > > > > > Error in ==> D:\MATLAB6p5
> >
> > > > \toolbox\wavelet\wavelet\dwt2.m
> >
> > > > > > On line 74 ==> a = convdown
(z,Lo_D,sizeKEPT,shift);
> >
> > > > > > thanks in advance,
> >
> > > > > Maybe something went wrong with your read
> > > > > of the image. Try this:
> >
> > > > >  y=imread('lenna.bmp');
> > > > >  size(y)
> >
> > > > no the problem is not relate with size because the 
same
> > > > command is working with gray image.
> >
> > > Actually, the problem IS with size. See below.
> >
> > > > the prob. with color image only.please if you have 
idea
> > > > tell me
> >
> > > But as Walter mentioned, size(y) would have given you
> > > a clue. I was expecting that you would find size(y) 
= 0
> > > because there was a problem reading.
> >
> > > It looks more like the problem is that you need to
> > convert
> > > your color image (a 3-D array) into a suitable 2-D
> > format.
> >
> > > In either case, if you had tried what I suggested you
> > would
> > > have gotten useful information.
> >
> >  size of y :100 100 3
> > in fact i want see the coeficients of wavelet is
> > colored .this is important in my work.
> 
> But there are three numbers in each pixel position,
> corresponding to R, G, and B values. The wavelet
> representation is for something which has a single
> value at each position. So what do you mean by
> the wavelet decomposition of the colored image?
> 
> Perhaps you want to do three decompositions?
> One for y(:,:,1), one for y(:,:,2) and one for y(:,:,3)?
> 
>             - Randy
 how they did that in matlab with woman image ? it is 
colored image but it was decomposed by wavelet and their 
coefficients are colored

0
halmamory (279)
2/9/2008 8:05:03 AM
Reply: