extrapolate an image

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2005
Posts: 5
Reputation: koteeswara is an unknown quantity at this point 
Solved Threads: 0
koteeswara koteeswara is offline Offline
Newbie Poster

extrapolate an image

 
0
  #1
Jan 17th, 2005
hi all !
please let me know how to extrapolate a 2D image to expand it.
thanking you in advance.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 1,620
Reputation: kc0arf is a jewel in the rough kc0arf is a jewel in the rough kc0arf is a jewel in the rough 
Solved Threads: 51
Team Colleague
kc0arf kc0arf is offline Offline
Posting Virtuoso

Re: extrapolate an image

 
0
  #2
Jan 19th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 5
Reputation: koteeswara is an unknown quantity at this point 
Solved Threads: 0
koteeswara koteeswara is offline Offline
Newbie Poster

Re: extrapolate an image

 
0
  #3
Jan 19th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: extrapolate an image

 
0
  #4
Jan 19th, 2005
Originally Posted by koteeswara
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 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.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 5
Reputation: koteeswara is an unknown quantity at this point 
Solved Threads: 0
koteeswara koteeswara is offline Offline
Newbie Poster

Re: extrapolate an image

 
0
  #5
Jan 20th, 2005
thankyou for the suggestion dear sir/madam!
i am trying to read the image with fread() command in c.
koteeswara


Originally Posted by alc6379
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 445
Reputation: 1o0oBhP is an unknown quantity at this point 
Solved Threads: 6
1o0oBhP's Avatar
1o0oBhP 1o0oBhP is offline Offline
Posting Pro in Training

Re: extrapolate an image

 
0
  #6
Jan 20th, 2005
Have you successfully read in the image yet? That is the first hurdle. Then the extrapolation should be clear.
http://sales.carina-e.com

no www
no nonsense

coming soon to a pc near you! :cool:
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 5
Reputation: koteeswara is an unknown quantity at this point 
Solved Threads: 0
koteeswara koteeswara is offline Offline
Newbie Poster

Re: extrapolate an image

 
0
  #7
Jan 22nd, 2005
dear sir/madam!
i am not yet successful in reading the image. i am working on it
koteeswara
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 5
Reputation: koteeswara is an unknown quantity at this point 
Solved Threads: 0
koteeswara koteeswara is offline Offline
Newbie Poster

Re: extrapolate an image

 
0
  #8
Jan 24th, 2005
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<stdio.h>
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");
}
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 445
Reputation: 1o0oBhP is an unknown quantity at this point 
Solved Threads: 6
1o0oBhP's Avatar
1o0oBhP 1o0oBhP is offline Offline
Posting Pro in Training

Re: extrapolate an image

 
0
  #9
Jan 25th, 2005
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...
http://sales.carina-e.com

no www
no nonsense

coming soon to a pc near you! :cool:
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC