How can I map a list of 24x3 RGB elements to a list of 256 levels?

조회 수: 1 (최근 30일)
Abdul Rahim Mohammad
Abdul Rahim Mohammad 2019년 4월 9일
댓글: Abdul Rahim Mohammad 2019년 4월 10일
I need to map a list of 24x3 values with each row represnting a RGB value to a list of 256x3 elements. I was advised that I would find the function polyfit helpful but I do not understand how polyfit works and how it maps elements. Any clarification or suggestions or a simple code snipped explaining how poyfit works would be helpful. Thank you.
  댓글 수: 4
Jan
Jan 2019년 4월 9일
With polyfit you fit a polynomial to a set of data. You did not explain if you expect the 24x3 data table to match a polynomial and duplicate sample are mentioned the first time now.
Vague questions are welcome in this forum. It is thenature of questions, that some details are not clear to the asking person. As soon as all details are clear, the solution is usually trivial.
So please explain, why you or your teacher thinks, that the data table is approximately a polynomial.
Abdul Rahim Mohammad
Abdul Rahim Mohammad 2019년 4월 10일
Edit: I understand now where I was wrong,
The process I followed is to take samples from two 24x3 arrays and use a polyfit(1st_array, 2nd_array, order of polynomial I want to fit), use the resultant values from polyvfit for polyval( resultant coeffs of polyfit, scale I want to fit into i.e. 1:256);
Thank you very much for your responses, Jan. They helped me alot.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by