<< Chapter < Page Chapter >> Page >
copy V:\ece320\idk\c6000\IDK\Examples\NTSC\img_proc copy V:\ece320\idk\c6000\IDK\Drivers\include copy V:\ece320\idk\c6000\IDK\Drivers\lib

After the IDK is powered on, open Code Composer 2 by clicking on the "CCS 2" icon on the desktop. From the "Project" menu,select "Open," and then open img_proc.pjt . You should see a new icon appear at the menu on the left side ofthe Code Composer window with the label img_proc.pjt . Double click on this icon to see a list of folders. There should be a folder labeled "Source."Open this folder to see a list of program files.

The main.c program calls the img_proc.c function that displays the output of four image processing routines in four quadrants on themonitor. The other files are associated with the four image processing routines. If you open the "Include" folder, youwill see a list of header files. To inspect the main program, double click on the main.c icon. A window with the C code will appear to the right.

Scroll down to the tskMainFunc() in the main.c code. A few lines into this function, you will see the line LOG_printf(&trace,"Hello\n"); . This line prints a message to the message log, which can be useful fordebugging. Change the message " Hello\n " to " Your Name\n " (the " \n " is a carriage return). Save the file by clicking the little floppydisk icon at the top left corner of the Code Composer window.

To compile all of the files when the " .out " file has not yet been generated, you need to use the "Rebuild All"command. The rebuild all command is accomplished by clicking the button displaying three little red arrows pointing down ona rectangular box. This will compile every file the main.c program uses. If you've only changed one file, you only needto do a "Incremental Build," which is accomplished by clicking on the button with two little blue arrows pointing into a box(immediately to the left of the "Rebuild All" button). Click the "Rebuild All" button to compile all of the code. A windowat the bottom of Code Composer will tell you the status of the compiling (i.e., whether there were any errors or warnings).You might notice some warnings after compilation - don't worry about these.

Click on the "DSP/BIOS" menu, and select "Message Log." A new window should appear at the bottom of Code Composer. Assumingthe code has compiled correctly, select "File" -> "Load Program" and load img_proc.out (the same procedure as on the other version of Code Composer). Nowselect "Debug" -> "Run" to run the program (if you have problems, you may need to select "Debug" -> "Go Main" beforerunning). You should see image processing routines running on the four quadrants of the monitor. The upper left quadrant(quadrant 0) displays a low pass filtered version of the input. The low pass filter "passes" the detail in the image,and attenuates the smooth features, resulting in a "grainy" image. The operation of the low pass filter code, and howdata is moved to and from the filtering routine, was described in detail in the previous section. The lower left quadrant(quadrant 2) displays the output of an edge detection algorithm. The top right and bottom right quadrants(quadrants 1 and 3, respectively), show the original input displayed unprocessed. At this point, you should notice yourname displayed in the message log.

Implementation

You will create the component code flip_invert.c to implement an algorithm that horizontally flips and inverts the input image. The code in flip_invert.c will operate on one line of the image at a time. The copyim.c wrapper will call flip_invert.c once for each row of the prescaled input image. The flip_invert function call should appear as follows:

flip_invert(in_data, out_data, cols);

where in_data and out_data are pointers to the input and output buffers in internal memory,and cols is the length of each column of the prescaled image.

The img_proc.c function should call the copyim.c wrapper so that the flipped and inverted image appears in the top right (first) quadrant. The call to copyim is as follows: copyim(scratch_pad, out_img, out_ptr, pitch);

This call is commented out in the im_proc.c code. The algorithm that copies the image (unprocessed) to thescreen is currently displayed in quadrant 1, so you will need to comment out its call and replace it with the call tocopyim.

Your algorithm should flip the input picture horizontally, such that someone on the left side of the screen looking leftin quadrant 3 will appear on the right side of the screen looking right. This is similar to putting a slide in a slideprojector backwards. The algorithm should also invert the picture, so that something white appears black and vice versa.The inversion portion of the algorithm is like looking at the negative for a black and white picture. Thus, the totaleffect of your algorithm will be that of looking at the wrong side of the negative of a picture.

Pixel values are represented as integers between 0 and 255.

To create a new component file, write your code in a file called " flip_invert.c ". You may find the component code for the low pass filter in" conv3x3_c.c " helpful in giving you an idea of how to get started. To compile this code, you must include itin the " img_proc " project, so that it appears as an icon in Code Composer. To include your new file, rightclick on the " img_proc.pjt " icon in the left window of Code Composer, and select "Add Files."

Questions & Answers

A golfer on a fairway is 70 m away from the green, which sits below the level of the fairway by 20 m. If the golfer hits the ball at an angle of 40° with an initial speed of 20 m/s, how close to the green does she come?
Aislinn Reply
cm
tijani
what is titration
John Reply
what is physics
Siyaka Reply
A mouse of mass 200 g falls 100 m down a vertical mine shaft and lands at the bottom with a speed of 8.0 m/s. During its fall, how much work is done on the mouse by air resistance
Jude Reply
Can you compute that for me. Ty
Jude
what is the dimension formula of energy?
David Reply
what is viscosity?
David
what is inorganic
emma Reply
what is chemistry
Youesf Reply
what is inorganic
emma
Chemistry is a branch of science that deals with the study of matter,it composition,it structure and the changes it undergoes
Adjei
please, I'm a physics student and I need help in physics
Adjanou
chemistry could also be understood like the sexual attraction/repulsion of the male and female elements. the reaction varies depending on the energy differences of each given gender. + masculine -female.
Pedro
A ball is thrown straight up.it passes a 2.0m high window 7.50 m off the ground on it path up and takes 1.30 s to go past the window.what was the ball initial velocity
Krampah Reply
2. A sled plus passenger with total mass 50 kg is pulled 20 m across the snow (0.20) at constant velocity by a force directed 25° above the horizontal. Calculate (a) the work of the applied force, (b) the work of friction, and (c) the total work.
Sahid Reply
you have been hired as an espert witness in a court case involving an automobile accident. the accident involved car A of mass 1500kg which crashed into stationary car B of mass 1100kg. the driver of car A applied his brakes 15 m before he skidded and crashed into car B. after the collision, car A s
Samuel Reply
can someone explain to me, an ignorant high school student, why the trend of the graph doesn't follow the fact that the higher frequency a sound wave is, the more power it is, hence, making me think the phons output would follow this general trend?
Joseph Reply
Nevermind i just realied that the graph is the phons output for a person with normal hearing and not just the phons output of the sound waves power, I should read the entire thing next time
Joseph
Follow up question, does anyone know where I can find a graph that accuretly depicts the actual relative "power" output of sound over its frequency instead of just humans hearing
Joseph
"Generation of electrical energy from sound energy | IEEE Conference Publication | IEEE Xplore" ***ieeexplore.ieee.org/document/7150687?reload=true
Ryan
what's motion
Maurice Reply
what are the types of wave
Maurice
answer
Magreth
progressive wave
Magreth
hello friend how are you
Muhammad Reply
fine, how about you?
Mohammed
hi
Mujahid
A string is 3.00 m long with a mass of 5.00 g. The string is held taut with a tension of 500.00 N applied to the string. A pulse is sent down the string. How long does it take the pulse to travel the 3.00 m of the string?
yasuo Reply
Who can show me the full solution in this problem?
Reofrir Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Ece 320 - spring 2003. OpenStax CNX. Jan 22, 2004 Download for free at http://cnx.org/content/col10096/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 320 - spring 2003' conversation and receive update notifications?

Ask