Lab 1 Discussion, ECE637, Spring 2008
Debugging
Hi this is about another really powerful tool. As Professor Bouman has been talking a lot about debugging I suggest (if you are not using one already !) that one can make use of GDB (GNU debugger). It is a really powerful tool to debug codes. We can track status of all variables and see them change as the program execcutes. It is really easy to use especialy with the Emacs editor.
A link for GDB is :
http://www.yolinux.com/TUTORIALS/GDB-Commands.html
Singanallur V Venkatakrishnan
== Lab 1: doubt == --singanallur.v.venkatakrishnan.1, Mon, 14 Jan 2008 13:56:08 -0500 reply
When i tried running the Example out file ...it gives the following error :
machine data sizes are not appropriate for TIFF reader/writer error reading file img12.tif
can any one advise me ?
== Lab 1: doubt == --matias.zanartu.1, Mon, 14 Jan 2008 21:54:16 -0500 reply
I had the same problem when running the Example file remotely on a Linux machine using SSH. Are you doing this remotely as well? If that is the case, you may try running it directly in the VISE lab. I know that the program works fine if I run it on Cygwin on my windows machine. Good luck.
Still not working --singanallur.v.venkatakrishnan.1, Tue, 15 Jan 2008 14:19:24 -0500 reply
Well i tried it from CS department machines ...i am not able to log into vise ..is there some one we should see to get the VISE accounts ? is there any one else who was able to solve the problem
windows compilers/IDEs? --karl.ostmo.1, Thu, 17 Jan 2008 20:15:47 -0500 reply
Compiling
Hey all, Here are a couple of free options for compiling in Windows at home (you need administrative rights on your computer):
- Dev C++
- Go to File -> Project -> New -> Console application. Save the project in the C-code folder. Right click it in the left pane, select Add to project, go to the C-code folder and highlight everything (Ctrl+a). Then click compile (left-most button), and it will produce an .exe in the same folder.
- Eclipse IDE for C/C++ Developers
- You can download it from here: just unzip it to some place memorable. Although it comes with a few C "plugins", you're still going to need a compiler. Dev C++ comes with all of these compiler tools, so if you add "C:\Dev-Cpp\bin" to the "Path" environment variable in Windows, Eclipse will have access to them. Alternatively, you could install MinGW? independently from Dev C++.
When you start it, it'll ask you where you want your "workspace"; remember where this is. To start click on "Go to workbench", then File -> New -> C Project. Name the project and click Finish. Then select all of the files in the "C-code" folder and drag them into Eclipse on top of the project you created in the left pane. The "hammer" button compiles everything. To run your .exe file, open a command prompt and navigate to the "workspace" folder and into your project folder.
Link for NEW Linux users --singanallur.v.venkatakrishnan.1, Fri, 18 Jan 2008 15:36:51 -0500 reply
Hi ..I will give a link to just gain some basic knowledge of linux ..it is used in undergrad C course to familiarise new students with at least some common unix commands ..
http://www.cs.purdue.edu/homes/cs240/lab1/index.html
compile and run under Windows --sungye.kim.1, Sat, 19 Jan 2008 22:53:10 -0500 reply
If you still have a problem under under UNIX, try under Windows. There is no problem about compiling the C-code. I am using Visual Studio 2005 that is one of ECN softwares on Campus. Make new project by selecting "Win32 Console Application" and "Empty Project". Then, add the C source files the project you make.
compile and run under Windows --peter.s.mc.kinnis.1, Mon, 21 Jan 2008 01:27:59 -0500 reply
Ok I have Visual Studio 2003 for windows. I created the win32 console app and added the files. However, when I run the example, the code terminates at line 17 because argc is equal to 1 (not 2). I am suposed to pass the arguement img03.tiff to the example, however, this is very no intuitive in visual studio. Anyone know how to do this?
Also, Dr. Bowman asked us to use strict ansi c. Does anyone know where the setting is to enforce this in visual studio?
compile and run under Windows --peter.s.mc.kinnis.1, Mon, 21 Jan 2008 01:37:14 -0500 reply
Ok I figured out how to pass arguments, just in case anyone else is having problems. It's under Project -> Properties -> Configuration Properties -> Debugging -> Command Arguments.
Still not working --shivani.g.rao.1, Mon, 21 Jan 2008 19:53:47 -0500 reply
I found that I faced the same problem on the linux machines in the lab, but the program compiled and ran successfully on the Sun solaris machines. It also works fine when i remotely log in to ecegrid.ecn.purdue.edu
The alternative is to use Open CV on Linux machines. The file reading and writing is taken care of and all you need to worry is the main chunk of code. <http://www.intel.com/technology/computing/opencv/index.htm>
compile and run under Windows --sungye.kim.1, Mon, 21 Jan 2008 21:08:59 -0500 reply
In my case, I just build the source code without setting commnad arguments. Then, you will find *.exe file in your debug folder. You can execute the exe file on cmd window.
Printing in VISE? --alfa.satyaputra.1, Tue, 22 Jan 2008 13:20:49 -0500 reply
Has anyone managed/figured out on how to do so? I used xv in the VISE lab to process the images in Lab 1 and it worked just fine, but I had problems in sending it to the printer.
I've read the printing in VISE tutorial in the VISE homepage and I used something like 'lp -d printname' and I found the supposed printer name for the ones in VISE... but it doesnt work for me. I've tried some variations but I just cant seem to send my print jobs to the printers.
I've sent the files to myself and printed it out at home, but I'm still curious on this.
Satyam: Even I am unable to print from xv but here is a way to print the image files from the Unix machine itself. Open the directory containing the image (e.g. home/Personal/.../Lab1). Next, right click on the image icon, scroll down to Open With and select GIMP Image Editor. From inside GIMP, goto File->Print and select ms184h1 (note h1 prints color), hit Print. Done! And remember to "use original image size". PS: I am curious if I am posting this the right way. If not, someone please put in the correct place.
2D Convolution Algorithm --peter.s.mc.kinnis.1, Tue, 22 Jan 2008 16:44:33 -0500 reply
I was just wondering how people are implimenting the filters. It seems that you need a 2D convolution function. So you can take the 2d fft multiply by your filter and invert. However this seems like allot of work, and I have never implimented an FFT algorithm. I was wondering if this is how we are suposed to impliment, or if I should just write a convolution in the space domain?
2D Convolution Algorithm --matias.zanartu.1, Tue, 22 Jan 2008 18:35:32 -0500 reply
I think that is not the path you should follow. I suggest deriving the difference equation for each filter and defining the filtered image that way. The example file gives you an idea of how to do this for a simple filter. Good luck!
Remove noise --matias.zanartu.1, Tue, 22 Jan 2008 18:39:41 -0500 reply
I asked Prof. Bouman about the added noise component that appears in the original example file. He said that it should be removed for alll cases in this lab. Please be aware of that.
2D Convolution Algorithm --alfa.satyaputra.1, Tue, 22 Jan 2008 20:26:47 -0500 reply
Take note that in some of the problems in this lab, the filter given is a separable filter. So you should be able to first filter it in horizontal direction, and then filter it in the vertical direction. It should give the same result to using a 2D filter.
Be careful though, since it seems like not everything in here is separable.
Re: To Satyam --alfa.satyaputra.1, Tue, 22 Jan 2008 20:30:29 -0500 reply
We posted ours using the comment box at the bottom of the page, you should be able to see it when you've logged in. Feel free to post your input again if you wish to do so.
Printing in VISE? --mehmet.gunal.1, Thu, 24 Jan 2008 18:27:58 -0500 reply
I believe we will have to ask Dr. Bouman on how to print using xv, I can't find any material regarding how to send prints over to ms184h1 either.
Printing in VISE? --rong.zhang.5, Thu, 24 Jan 2008 22:11:16 -0500 reply
For general instructions of printing in the VISE lab, you can refer to http://vise.www.ecn.purdue.edu/VISE/info/pdf/print.pdf However, as far as I know, the color printers in the VISE lab are often out of order. :-) So, if a color printing is needed, you may print it at some other places, e.g., Hicks Library.
point spread function --dong.ok.kim.1, Thu, 24 Jan 2008 23:28:16 -0500 reply
I wonder what I have to use to compute the point spread function(No.2 of IIR Filter). Should I use C programming?
compile and run under Windows --christopher.smalt.1, Sun, 27 Jan 2008 21:02:03 -0500 reply
To enforce ANSI compiling in visual studio, go to the properties of the project, under Configuration Properties | C/C++ | Advanced | Compile as: Compile as C Code TC
Printing in VISE? --joshua.s.hayden.1, Tue, 29 Jan 2008 21:49:27 -0500 reply
I would suggest using The GIMP rather than xv. You can open your images in the The GIMP by right clicking > open with > The GIMP. It's very similar to Photoshop, for those who are familiar.
Either way; Printing to the VISE lab printer is much easier than in xv. Simple go to File > Print. From this screen you can select "ms184h1" as the printer name. You can also scale the image and convert it to and from color and greyscale from the print screen.
http://www.gimp.org/ - Free download for Linux, Windows, and Mac OS X (though this one is a bit more complicated). It is already installed on all VISE machines.