954,479 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

extrapolate an image

hi all !
please let me know how to extrapolate a 2D image to expand it.
thanking you in advance.

koteeswara
Newbie Poster
5 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

Hello,

This question is similar in concept to building a pyramid.

You might want to expand on what you are trying to do first.

Christian

kc0arf
Posting Virtuoso
Team Colleague
1,937 posts since Mar 2004
Reputation Points: 121
Solved Threads: 57
 

Hello Christian!
thankyou for reply. i am working on Visualization Tool Kit, my project is "volume rendering of 2D mri images to get 3D object using vtk". i got found one formula for extraploation in the following website http://www.sgi.com/misc/grafica/interp/ . now please do send me a C++ program which can read an image into a matrix and display the same.
koteeswara

koteeswara
Newbie Poster
5 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 
now please do send me a C++ program which can read an image into a matrix and display the same.

Not trying to be rude, but I believe that's what youpay someone to do. We're here to help you learn how to code, not write programs for you. Attempt to write something on your own, and we'll help you hash it out.

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

thankyou for the suggestion dear sir/madam!
i am trying to read the image with fread() command in c.
koteeswara

Not trying to be rude, but I believe that's what you pay someone to do. We're here to help you learn how to code, not write programs for you. Attempt to write something on your own, and we'll help you hash it out.
koteeswara
Newbie Poster
5 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

Have you successfully read in the image yet? That is the first hurdle. Then the extrapolation should be clear.

1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
 

dear sir/madam!
i am not yet successful in reading the image. i am working on it
koteeswara

koteeswara
Newbie Poster
5 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

this is the c program by which i can read the image store the image in a matrix and display the image as well. at last i was successful in reading jpeg giff and bmp images.
koteeswara.
#include
main()
{
FILE *fp;
int a[1024][1024];
int i=0,j=0,k;
fp=fopen("tsunami_guillemin.jpg","rb");
if(fp==NULL)
{
puts("cannot open file");
//exit();
}
while(1)
{
for(i=0;i<1024;i++)
for(j=0;j<1024;j++)
a[i][j]=getc(fp);
if(a[i][j]=EOF)
break;
i++;j++;
}
fclose(fp);
fp=fopen("example2.bmp","wb");
for(i=0;i<1024;i++)
for(j=0;j<1024;j++)
{
putc(a[i][j],fp);
}
fclose(fp);
for(i=0;i<41;i++)
for(j=0;j<41;j++)
{printf(" %d",a[i][j]);
j++;}
printf("\n");
}

koteeswara
Newbie Poster
5 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

Im not too keen on the one-size matrix [1024][1024]. It would make more sense to get the Bitmap's width and Height from the BMP file. Doing a google search for the file fomat (Bitmap File format) should help -> Bear in mind there are MANY Win32 API functions/structures to handle and load bitmaps correctly...

If you can get the BM width height ect... then instead of loading the WHOLE file in (as your code does) you can just load the pixel data, which is what you need to extrapolate. The file format / API docs will help with getting the info from the file header ect...

1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You