Page 1 of 1

A little Q?

Posted: 2015-10-20T16:07:36-07:00
by ali.biomed7
Hi,friends
I don't know how to use linear interpolation method on a matrix like this:
7 5 6
2 8 4
3 5 3
and the other is Interlacing zeros?
I would be grateful if sb help me,plz.

Re: A little Q?

Posted: 2015-10-20T17:48:45-07:00
by fmw42
Sorry, but I do not understand your requests. I am not familiar with "linear interpolation method on a matrix". What do you mean by that? What is it you want to do with the matrix -- use it for convolution?

Perhaps you want to compare two images. IM can give you a number of metrics for the difference between two images. See
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/
http://www.imagemagick.org/Usage/compare/#statistics

Or I have a script that will generate a scatter plot between two images, but it does not do the linear regression analysis. See
http://www.fmwconcepts.com/imagemagick/ ... /index.php

For general linear regression, you may need to go to something like MATLAB.

Also I have no idea what you mean by "interlacing zeros"? Do you want to add rows or columns of zeros between each row or column of an image?

Please read viewtopic.php?f=1&t=9620

Re: A little Q?

Posted: 2015-10-21T06:44:56-07:00
by ali.biomed7

Re: A little Q?

Posted: 2015-10-21T09:06:51-07:00
by fmw42

Re: A little Q?

Posted: 2015-10-21T13:03:05-07:00
by ali.biomed7
linear interpolation not bilinear or bicubic !!!

Re: A little Q?

Posted: 2015-10-21T13:08:55-07:00
by snibgo
The Google books link doesn't work for me.

Linear interpolation is for one dimensional spaces. Bilinear is for two dimensions. The principle is the same.

Re: A little Q?

Posted: 2015-10-21T14:12:07-07:00
by fmw42
This is an image forum for 2D processing. As user snibgo said, linear interpolation is for 1D and bilinear is for 2D. The latter is linear in both x and y.

If you really have a 1D situation, then you should post to some other forum.

If not, then please explain your problem in more detail.


If you are trying to fit a line to a set of points, then search Google. Here are some results:

http://hotmath.com/hotmath_help/topics/ ... t-fit.html
http://mathworld.wolfram.com/LeastSquaresFitting.html
http://stackoverflow.com/questions/1144 ... ine-with-c
http://www.johndcook.com/blog/2008/10/2 ... e-to-data/

Re: A little Q?

Posted: 2015-10-22T08:11:40-07:00
by ali.biomed7
Let me ask my Q in another way.
Do u know this structure------> imsize(O,[3 3],'bilinear') ?

O=[1 1;2 2]

The answer from matlab is:
1.0000 1.0000 1.0000
1.5000 1.5000 1.5000
2.0000 2.0000 2.0000
Can u get the answer in paper without using matlab ,in paper by hand?

Re: A little Q?

Posted: 2015-10-22T08:16:17-07:00
by ali.biomed7
The link is page 294 from DIGITAL IMAGE PROCESSING book By JAYARAMAN.
If u search linear interpolation or zero interlacing expression u will get the page i said.

Re: A little Q?

Posted: 2015-10-22T08:37:14-07:00
by snibgo
Your question seems to be about Matlab, not ImageMagick.

I suggest you ask on a Matlab forum, or read the documentation.