Image scale to a logarithmic scale x and y axis.

조회 수: 11 (최근 30일)
Mikkel Ibsen
Mikkel Ibsen 2017년 9월 7일
댓글: Walter Roberson 2017년 9월 11일
Hi
I have this code where I've (With some help from Matlab Community) made a script that reads a image and gives the different colorzones a number. Then I give the image a x and y axis, so that I can place a point with x and y coordinates, and it gives me which zone it is in. It works perfectly when my x and y axis are linear, but I need to have them logarithmic, both of them. But when I try to do it, I either get my image in a straight line with a slope of 45 degrees, or else I only get my axis logarithmic and not my image.
I've made a point [0.1 600] which should be in zone 7 if it works.
My image looks like this, because I offend find that i flips the picture, when I try to force the y axis to start from 0 in the bottum and 1000 in the top.
I've attached my code, its small and simple.
Hope someone can help me.
  댓글 수: 5
Mikkel Ibsen
Mikkel Ibsen 2017년 9월 11일
Hey Walter
I'm totally new at this image conversion or texture-mapping, I'm trying to search on it on the internet but can't find a good guide or tutorial where I can learn it. Do you know a good guide or tutorial or do you mind writing the line of code in my script so it converts the image to a log scale and not just the axes? I can see a lot of people have been in here and looking, and since you are the only one writing I'm guessing they also need some help with this :). So I'm hoping you can help us "Newbies" with this image conversion to log log scales.
Walter Roberson
Walter Roberson 2017년 9월 11일
Your image is pseudocolor, so you could use warp()
You would just use planar coordinates.
Example with warp:
[I,map] = imread('forest.tif');
[X,Y] = meshgrid(1:size(I,1),1:size(I,2));
Z = zeros(size(X));
warp(X,Y,Z,I,map);
view(2)
set(gca,'xscale','log')

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by