How to implement dct2 in MATLAB coder?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 12 de Jun. de 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.
Respuestas (1)
Walter Roberson
el 13 de Jun. de 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:
- pad the input image to a power of 2 in each direction
- call dct() on the input image
- transpose the result
- call dct() on the transposed result;
- transpose the result of that.
To write idct2 yourself:
- call idct() on the array (which must be a power of 2 in each direction
- transpose the result
- call idct() on the transposed result;
- transpose the result of that
- truncate away the part of the result that did not exist in the original image.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!