How to implement dct2 in MATLAB coder?

3 Ansichten (letzte 30 Tage)
kim lee
kim lee am 11 Jun. 2018
Beantwortet: Walter Roberson am 13 Jun. 2018
Dear all,
I'm trying to implement dct2 by using MATLAB coder in https://in.mathworks.com/help/images/ref/dct2.html.
But I've found error message when I invoke dct2 in MATLAB coder.
How do I resolve this problem?
  4 Kommentare
Walter Roberson
Walter Roberson am 12 Jun. 2018
You write dct2 and idct2 yourself.
You will have problems with the graphics components. There is no one platform-independent standard for graphics -- there are a number of competing graphics standards.
You have to understand that code generation assumes that you might be generating code for an embedded system that might not have any graphics at all, or which might have a 7 segment by 20 characters by 2 rows LCD panel.
kim lee
kim lee am 13 Jun. 2018
@Walter Roberson,
I'm not trying to implement it with graphics component and also that is not my question.
I'm just trying to implement dct2 but as you already seen that error messages, there are some errors to make as a c code.
please check my question again .

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 13 Jun. 2018
I already answered you about dct2: I wrote,
"You write dct2 and idct2 yourself."
Mathworks has chosen not to permit code generation for their dct2 and idct2 routines, or perhaps they have simply not gotten around to implementing it. You did not miss any obscure setting.
To write dct2 yourself:
  1. pad the input image to a power of 2 in each direction
  2. call dct() on the input image
  3. transpose the result
  4. call dct() on the transposed result;
  5. transpose the result of that.
To write idct2 yourself:
  1. call idct() on the array (which must be a power of 2 in each direction
  2. transpose the result
  3. call idct() on the transposed result;
  4. transpose the result of that
  5. truncate away the part of the result that did not exist in the original image.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by