Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/feed-rss2.php on line 8
‘Final Project’ Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 06:15:08 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Final Project: FINAL https://kenscourses.com/tc101fall2015/2015/final-project-final/ Thu, 26 Nov 2015 06:15:08 +0000 http://alansprogramming.wordpress.com/?p=358 Continue reading Final Project: FINAL ]]> FINAL

It’s over. It’s all over!! “Stress Free Bar” by Jason St. Peter. Link: https://www.flickr.com/photos/fiftypercentchanceofrain/3769770467/

Redundant title is redundant. After much work, tears, sweat and a couple of sleep-deprivation sessions at the Biblioteca, we did it. Messily, and with two codes worth of work, but we did it. Montse had a lot of trouble simply getting the Magick++ library to cooperate with us and it just did not work in my computer. I really have to check it sometime… Anyway, the “good” code is the one titled Final Project.cpp, while the others are alternates with discrepancies (see Week #3). All we have left to do is wait for the reckoning to come.

Here’s the alternate (code for “sucky”) code:

Final1

Final2

Aaaand finally the good and final GitHub code link.

]]>
https://creativecommons.org/licenses/by/4.0/
Final Project! https://kenscourses.com/tc101fall2015/2015/final-project-10/ Thu, 26 Nov 2015 04:39:20 +0000 http://myfreakingcrazythoughts.wordpress.com/?p=386 Continue Reading →]]> We did it!

My buddy and I finally acomplish our project for our TC101 class.

Well, basically, our program had to do the following:

“You will create a command-line program that uses two-dimensional arrays or matrices to process images. You cannot simply call graphics libraries to manipulate the images directly but must implement the functions with your own algorithms. The input to each operation is an image (you choose to support any of JPEG, PNG) and the output is the modified image. The idea is to have a final project which shows your mastery of the topics in this course”.

I was really hard to acomplish but Eduardo and I worked together and we made it!

The user is able to type in the name of the file (a picture) and the program will process the image outputting a different file than the first one.

There is a huge code!

It looks like this:

#include <Magick++.h>
#include <iostream>
#include <cmath>
using namespace std;
using namespace Magick;

void grayscale (string in, string out){
  Image image;
  image.read( in );
  int x = image.rows();
  int y = image.columns();
  Color image_array [x] [y];
  Color original;
  Color graysc;
  int col;


  for (int i=0; i < x; i++){                    
    for (int u = 0; u < y; u++){               
      original = image.pixelColor(u,i); 
      image_array [i][u] = original;
      col = (original.redQuantum() + original.greenQuantum() + original.blueQuantum()) / 3;
      graysc.redQuantum(col);
      graysc.greenQuantum(col);
      graysc.blueQuantum(col);
      image_array [i] [u] = graysc;
      image.pixelColor(u, i, graysc);
    }
  }
  image.write( out );
}

void scale(string in, string out){
  Image image;
  image.read( in );

  int x = image.rows();
  int y = image.columns();
  int xf = x/2;
  int yf = y/2;
  Image image2( Geometry(yf, xf), Color(MaxRGB, MaxRGB, MaxRGB, 0));
  Color image_array [x] [y];
  Color image_array2 [xf] [yf];
  Color pixel1, pixel2, pixel3, pixel4, pixel5;
  int red,blue,green;
  Color newRGB, newRGB2;

  for (int i=0; i < x; i++){
        for (int u = 0; u < y; u++){
              pixel1 = image.pixelColor(u,i);
              image_array [i][u] = pixel1;
        }
  }

  for (int i=0; i < x; i = i+2){
       for (int u = 0; u < y; u = u+2){
       	     int x2 = i/2;
       	     int y2 = u/2;
             pixel2 = image_array [i] [u];
             pixel3 = image_array [i+1] [u];
             pixel4 = image_array [i] [u+1];
             pixel5 = image_array [i+1] [u+1];
             red = (pixel2.redQuantum() + pixel3.redQuantum() + pixel4.redQuantum() + pixel5.redQuantum())/4;
             blue = (pixel2.blueQuantum() + pixel3.blueQuantum() + pixel4.blueQuantum() + pixel5.blueQuantum())/4;
             green = (pixel2.greenQuantum() + pixel3.greenQuantum() + pixel4.greenQuantum() + pixel5.greenQuantum())/4;
             newRGB.redQuantum(red);
             newRGB.greenQuantum(green);
             newRGB.blueQuantum(blue);
             image_array2 [x2] [y2] = newRGB;
       }
  }

  for (int i=0; i < xf; i++){
       for (int u = 0; u < yf; u++){
             newRGB2 =image_array2 [i] [u];
             image2.pixelColor(u, i, newRGB2);
       }
  }

 image2.write( out );
}

int main(int argc,char **argv)
{
  InitializeMagick(*argv);

  try {
 string im;
 string out;
 int ans;
 cout << "Write your file name: ";
 cin >> im;
 cout<< "Write the name of your output file: ";
 cin>>out;
 cout<<"What do you wanna do?"<<endl<<"1. Grayscale."<<endl<<"2. Scale (1/2)."<<endl;
 cin>>ans;

while (ans != 1 && ans != 2){
  cout<<"Try again please: ";
  cin>>ans;}
if(ans == 1){
 grayscale(im, out);}
 if (ans == 2){
 scale(im, out);
}
}
  catch( Exception &error_ )
    {
      cout << "Caught exception: " << error_.what() << endl;
      return 1;
    }
  return 0;
//// c++ -O2 -o prog prog.cpp `Magick++-config --cppflags --cxxflags --ldflags --libs`
}

 

There is also a Repository made it in Github and that’s were our teacher is going to check it out.

Any question feel completely free to ask.

Thank you guys for everything.

-The Admin.

 

 

]]>
https://creativecommons.org/licenses/by/4.0/
See you next time… https://kenscourses.com/tc101fall2015/2015/see-you-next-time/ Thu, 26 Nov 2015 03:00:56 +0000 http://hrglez.wordpress.com/?p=341 ]]> I have done the final project… It was hard enough to make me read and search a lot. I have improved my engineer, English and student skills doing this.

I want to thank Ken and all the people who helped me with this one.

We made a video for this, is over here:

An image of the Final Project:

final

The code: https://github.com/kenwbauer/TC101F15_Team21/blob/master/FinalProject

See you next time!!

]]>
https://creativecommons.org/licenses/by/4.0/
The final dash 2.0 https://kenscourses.com/tc101fall2015/2015/the-final-dash-2-0/ Wed, 25 Nov 2015 13:20:07 +0000 http://hrglez.wordpress.com/?p=326 ]]> This is the last day of the course…

I have done all the masteries and all the WSQ’s. So I have to do:

-The video for extra points about Ken’s course.

-The Final Project, I’m working on it and I already have one part completed, but I still fighting with the resizing part.

This is the last day, so I won’t give up until midnight.

]]>
https://creativecommons.org/licenses/by/4.0/
The Final Project. I’m on it! https://kenscourses.com/tc101fall2015/2015/the-final-project-im-on-it/ Mon, 23 Nov 2015 23:28:03 +0000 http://hrglez.wordpress.com/?p=315 ]]> Okay, this is hard, but God sent me this:

imagemagick

That document literally saved my life, now I have done the first part:

FP

I just have to finish the other thing about resize it and this course will be over. I have until Wednesday, so let’s work harder.

Good luck for everyone.

]]>
https://creativecommons.org/licenses/by/4.0/
Finished project https://kenscourses.com/tc101fall2015/2015/finished-project/ Mon, 23 Nov 2015 19:07:54 +0000 http://progradianagdv.wordpress.com/?p=113 Here is the link for our finished project

https://github.com/kenwbauer/TC101F15_Team22/blob/master/FinishedProject

This was a complicate project because we had to use a library that we have never used before, and also we had to manipulate each single pixel to change the color to a gray scale. But finally we could end this in the correct form.

]]>
https://creativecommons.org/licenses/by/4.0/
PROJECT ADVANCE! STAGE 2 AND 3. https://kenscourses.com/tc101fall2015/2015/project-advance-stage-2-and-3/ Mon, 23 Nov 2015 06:02:38 +0000 http://myfreakingcrazythoughts.wordpress.com/?p=203 Continue Reading →]]> For stage 2 and 3 of the final project I got into the research of how to make the program using the library in Ubuntu and well, it was quite easy, now the challenge will be to start writing the functions that will aloud us to ask for a file and then modify all their structure in order to change it to Black & White and also to half the image in two dimensions.

The first step was to be able to ask the user for the name os the file, so he  could type in the name and our program will look for it and process the image in order to change it.

That’s what we got so far and we are now working on the conversion of the pixels from color to B&W.

 

Hopefully everything will be ready before the deadline of November 25 at midnight.

 

Goodnight!

-The Admin.

]]>
https://creativecommons.org/licenses/by/4.0/
Project week 2 https://kenscourses.com/tc101fall2015/2015/project-week-2/ Mon, 16 Nov 2015 03:00:31 +0000 http://progradianagdv.wordpress.com/?p=47 ]]> This week we tried to test the ImageMagick library with a simple program that you can find here

https://github.com/kenwbauer/TC101F15_Team22/commit/215a6c037b51a7467dc0ff2dced473dbeed6ce11

But we couldn’t make it work, we think that it is because we didn’t get correctly installed the library, so we will still working on this.

This is what happens when we try to compile the code.

project

]]>
https://creativecommons.org/licenses/by/4.0/
Second week for the Final Project https://kenscourses.com/tc101fall2015/2015/second-week-for-the-final-project/ Sun, 15 Nov 2015 19:22:46 +0000 http://hrglez.wordpress.com/?p=218 ]]> HI EVERYBODY!

I JUST DO NOT HAVE IMAGES FOR THIS POST, AND AS YOU CAN SEE I AM WRITING USING JUST CAPITAL LETTERS. THAT IS BECAUSE I AM TRYING TO EXPRESS ALL THE STRESS I AM DEALING WITH.

AND I KNOW YOU ARE IN THE SAME POSITION. THE FACT THAT THE SEMESTER IS ALMOST OVER DOES NOT MATTER, ACTUALLY I WISH I COULD HAVE MORE TIME FOR ALL THIS S!!T.

BUT WELL, THAT IS NOT THE PURPOSE OF THIS POST, LET’S TRY TO CALM DOWN.

As I said, no images this time, just information, you can trust me or not:

-We have actually researched a lot about Magick.

-We have installed the Magick++ libraries.

-We have the demo program, but the truth is we do not even tried to run it.

-I’m having a meeting with Ken next week to solve some answers.

WELL THAT IS ALL, I DO HAVE A LOT OF HOMEWORK AND I HAVE TO DONE IT. I AM ON IT.

SEE YOU! AND BEST REGARDS AND WISHES FOR EVERYONE!

]]>
https://creativecommons.org/licenses/by/4.0/
Final Project – Week #1 https://kenscourses.com/tc101fall2015/2015/final-project-week-1-2/ Mon, 09 Nov 2015 05:26:53 +0000 http://alansprogramming.wordpress.com/?p=132 Continue reading Final Project – Week #1 ]]> Progress this week was sufficient… we could have done a bit more but installing the Magick++ library and its component is the first step to making sure everything runs smoothly in the end.

We started by making sure we knew just what ImageMagick was, and the functionalities it will provide for the project.

S1

Then we came across a tutorial which helped us understand the functions of Magick++.

S2

And the last step was to simply download the whole thing, making absolutely sure the components and library for C++ were installed correctly. Now we are ready to work full-on with this project, with a nice, working environment at our disposal.

S3

Next week we will try to write and run some actual code to start tweaking things and seeing possibilities to make sure we get the best out of the library.

]]>
https://creativecommons.org/licenses/by/4.0/