Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8531493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:29:43+00:00 2026-06-11T09:29:43+00:00

I haven’t fully understood how qtdecomp works… I = [1 1 1 1 2

  • 0

I haven’t fully understood how qtdecomp works…

I = [1    1    1    1    2    3    6    6
     1    1    2    1    4    5    6    8
     1    1    1    1   10   15    7    7
     1    1    1    1   20   25    7    7
    20   22   20   22    1    2    3    4
    20   22   22   20    5    6    7    8
    20   22   20   20    9   10   11   12
    22   22   20   20   13   14   15   16];

S = qtdecomp(I,2);
disp(full(S));

The results of this are:

   4     0     0     0     1     1     2     0
   0     0     0     0     1     1     0     0
   0     0     0     0     1     1     2     0
   0     0     0     0     1     1     0     0
   4     0     0     0     1     1     1     1
   0     0     0     0     1     1     1     1
   0     0     0     0     1     1     1     1
   0     0     0     0     1     1     1     1

in the left bottom 4*4 matrix, maximum value (22) of the block elements minus the minimum value (20) is 2, so when decomposing this part, it will left as is.

When I do this on a uint8 matrix:

I = uint8([...
     1    1    1    1    2    3    6    6
     1    1    2    1    4    5    6    8
     1    1    1    1   10   15    7    7
     1    1    1    1   20   25    7    7
    20   22   20   22    1    2    3    4
    20   22   22   20    5    6    7    8
    20   22   20   20    9   10   11   12
    22   22   20   20   13   14   15   16]);

S = qtdecomp(I,2/255);
disp(full(S));

the answer is just like before. But when I change S to this:

S = qtdecomp(I,1.9/255);

The answer is

 4     0     0     0     1     1     2     0
 0     0     0     0     1     1     0     0
 0     0     0     0     1     1     2     0
 0     0     0     0     1     1     0     0
 4     0     0     0     1     1     1     1
 0     0     0     0     1     1     1     1
 0     0     0     0     1     1     1     1
 0     0     0     0     1     1     1     1

I suppose the left bottom 4*4 matrix should decompose, but why doesn’t it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:29:44+00:00Added an answer on June 11, 2026 at 9:29 am

    What matlab does here is when I is uint8 it multiples the threshold by 255 and rounds it, so 1.9/255 is evaluated to 2.

    You can see this by opening the source code for qtdecomp (by pressing ctrl+D) or here. There’s an if/elseif near the end of the file (params{1} = round(255 * params{1});).

    You should be able to use S = qtdecomp(I,1/255); to get the result you are looking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I haven't used the STL much before, but I started to on this huffman
I haven't been able to get this working and all of the sample code
I haven't seen this question anywhere else, I hope someone can help. I have
I haven't found any documentation on this or seen this done before, but is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I haven't found a definite answer to this yet. Lots of apps let you
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Haven't found this in my search on Stackoverflow - I know I've seen a
Haven't touched Ruby for ages so this really puzzled me. Started up irb. Then
Haven't seen this before so hopefully someone has a easy solve, I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.