Extract the "overall colors" of an image to apply another?
이전 댓글 표시
I've been meaning to show my students a way to "borrow" the color palette of an image to apply to another?
Take the Mona Lisa, for example. It has its own "tones" and "mood". Suppose there was a way to load that image into Matlab and extract its "most vital" color characteristic? And then be able to "apply" this "personality" to any other existing image? I know, it's a crazy idea and I've been thinking what could possibly be the "linking mechanism" between the two images or between any two sets of images, for that matter, that would make this possible? Perhaps the "Brightness" levels? To me, it's clearly a problem of "mapping tones" between imiages but I have no idea where to start. But one thing is sure, the students would immediately understand the idea and, from a pedagogical point of view, it would go a long way towards building an "abstract" view of "image processing" which is what the class is about.
채택된 답변
추가 답변 (2개)
Richard Burnside
2023년 6월 14일
편집: Richard Burnside
2023년 6월 14일
1 개 추천
The imread command will return the indexed image and the 256x3 colormap of the image:
[X,cmap] = imread('corn.tif');
You can work with that colormap to apply it to another image using the colormap command.
댓글 수: 4
Roger Breton
2023년 6월 14일
Roger Breton
2023년 6월 14일
편집: Walter Roberson
2023년 6월 15일
Roger Breton
2023년 6월 14일
편집: Roger Breton
2023년 6월 14일
Richard Burnside
2023년 6월 14일
The answer supplied below by Image Analyst seems to have that process worked out. Pretty amazing results.
Image Analyst
2023년 6월 14일
1 개 추천
The best algorithm I've seen for transferring the color gamut is Mark Grundland Color Histogram Specification by Histogram Warping

Sorry, I don't have code for that algorithm.
댓글 수: 3
Roger Breton
2023년 6월 14일
Image Analyst
2023년 6월 14일
If youi can do it, let me know. And post it to the File Exchange. A couple of years ago I made a s tab at it and I got the first few steps done but then it got into some pretty sophisticated math that I didn't know how to translate into MATLAB so I gave it up.

Roger Breton
2023년 6월 14일
카테고리
도움말 센터 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





