필터 지우기
필터 지우기

How do I quantize and dequantize a matrix ?

조회 수: 5 (최근 30일)
Derick Wong
Derick Wong 2013년 12월 20일
답변: John D'Errico 2013년 12월 20일
Hi,
May I ask how do I quantize and dequantize a given matrix eg.row 93 and column 343.
  댓글 수: 2
Image Analyst
Image Analyst 2013년 12월 20일
First explain to us what the means. As you know all numbers in a computer are quantized because they're digital.
Derick Wong
Derick Wong 2013년 12월 20일
편집: Derick Wong 2013년 12월 20일
It is a matrix base on motion capture of x-axis, y-axis and z-axis. This axis represents the joints.
Now I have this matrix, I need to do a quantization and then a dequantization. I used the command round initially,
eg A=ceil(10*rand(3,4))
Quantization=round(A)
However, I am puzzled of how to do an inv_quantization after that. I thought of some alternative way you might suggest ?

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2013년 12월 20일
Unless you save what it was before you threw away the fractional part, you cannot get it back. In your script you can alter it like this to save the information
m = 10*rand(3,4); % Create m.
% Round up to nearest greater integer.
A=ceil(m)
Quantization=A; % No need for round as A is already integers.
% Get m back
A = m;
Quantization = m;

추가 답변 (1개)

John D'Errico
John D'Errico 2013년 12월 20일
Consider the vector [1.75 2.25]. After rounding, it maps to [2 2]. Can you possibly know after the rounding process what the original values were? Of course not.
You can do as Image Analyst suggests, and save the fractional parts thrown out, but this is about as much as you can do in general.
If you do know something about the relationship that created your data, then it MAY be possible to do more. For example, I once wrote an unrounding tool, that presumes the elements are rounded from some smooth functional relationship. It tries to find a maximally smooth curve through the data points, such that the curve is consistent with rounding.
The point is you can never recover the original values without more information provided by you.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by