Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Image pixel coordiates interpolation from a limited points

Subject: Image pixel coordiates interpolation from a limited points

From: Abbas Cheddad

Date: 14 Aug, 2013 12:56:07

Message: 1 of 6

Hi,

I would like to set pixels in an image to a specific value along with the intermediate pixels (pixels that lie between two points). What I have is a set of X,Y coordinates of some points on a line segment. I can work out a code that interpolates the in-between values but I wonder if MATLAB has a built-in function which can be used for that or if there is a function posted in the file exchange blog?

[X Y]

ans =

          27 1096
         603 734
        1162 345
        1545 44
        3929 33
        4011 60
      

Cheers,
Abbas

Subject: Image pixel coordiates interpolation from a limited points

From: Image Analyst

Date: 17 Aug, 2013 02:41:07

Message: 2 of 6

Abbas
You can use the Bresenham line algorithm, or you can use imline(). I've posted code over in Answers. Go there (http://www.mathworks.com/matlabcentral/answers/) and I'll post a demo for you if you ask a question.

Subject: Image pixel coordiates interpolation from a limited points

From: jsomasekar@gmail.com

Date: 19 Aug, 2013 04:39:21

Message: 3 of 6

On Wednesday, 14 August 2013 18:26:07 UTC+5:30, Abbas Cheddad wrote:
> Hi,
>
>
>
> I would like to set pixels in an image to a specific value along with the intermediate pixels (pixels that lie between two points). What I have is a set of X,Y coordinates of some points on a line segment. I can work out a code that interpolates the in-between values but I wonder if MATLAB has a built-in function which can be used for that or if there is a function posted in the file exchange blog?
>
>
>
> [X Y]
>
>
>
> ans =
>
>
>
> 27 1096
>
> 603 734
>
> 1162 345
>
> 1545 44
>
> 3929 33
>
> 4011 60
>
>
>
>
>
> Cheers,
>
> Abbas

Subject: Image pixel coordiates interpolation from a limited points

From: Abbas Cheddad

Date: 20 Aug, 2013 14:20:22

Message: 4 of 6

Super! Thanks a million. I will try out your suggestions, I guess the imline function is what I am looking for.

Cheers,
Abbas

==============

"Image Analyst" wrote in message <kumns2$u3$1@newscl01ah.mathworks.com>...
> Abbas
> You can use the Bresenham line algorithm, or you can use imline(). I've posted code over in Answers. Go there (http://www.mathworks.com/matlabcentral/answers/) and I'll post a demo for you if you ask a question.

Subject: Image pixel coordiates interpolation from a limited points

From: Abbas Cheddad

Date: 20 Aug, 2013 14:20:24

Message: 5 of 6

Super! Thanks a million. I will try out what you suggested.


"Image Analyst" wrote in message <kumns2$u3$1@newscl01ah.mathworks.com>...
> Abbas
> You can use the Bresenham line algorithm, or you can use imline(). I've posted code over in Answers. Go there (http://www.mathworks.com/matlabcentral/answers/) and I'll post a demo for you if you ask a question.

Subject: Image pixel coordiates interpolation from a limited points

From: Abbas Cheddad

Date: 20 Aug, 2013 14:20:35

Message: 6 of 6

Thank you! I will check your suggestion.
All the best!
Abbas

"Image Analyst" wrote in message <kumns2$u3$1@newscl01ah.mathworks.com>...
> Abbas
> You can use the Bresenham line algorithm, or you can use imline(). I've posted code over in Answers. Go there (http://www.mathworks.com/matlabcentral/answers/) and I'll post a demo for you if you ask a question.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us