May 30, 2009

Installing pngwriter: a library to write png image

To install pngwrite we need to install to helper library before we install pngwriter.
1. libpng
2. freetype2

We can use fink or macport to install them. Using macport

-> port install libpng
-> port install freetype

both will be installed on /opt/local directory.
(.h files in /opt/local/include .dylib files in /opt/local/lib)

Then we can download the pngwriter from here.
PNGWRITER

To install pngwriter
1. untar the zipped file.
The go inside the folder.
->make
->make install

This will install the pngwriter in /usr/local
(.h files in /usr/local/include and .dylib files in /usr/local/lib)

To use the pngwriter library we need just to add the pngwriter.h file.
#include (pngwriter.h)
int main()
{
pngwriter image(200, 300, 1.0, "out.png");
image.plot(30, 40, 1.0, 0.0, 0.0);
image.close();
return 0;
}
Let this be a sample program write_test.cpp.

To compile the program we need to the following command
g++ write_test.cpp -o test -I/opt/local/include/freetype2 -I/opt/local/include
-I/usr/local/include -L/usr/local/lib -L/opt/local/lib -lpng -lpngwriter -lz -lfreetype

(Note: you have to specifically give the include path for freetype -I/opt/local/include/freetype2 -I/opt/local/include.
And: since pngwriter is installed on /usr/local/include, so is the include path for pngwriter. The lib files are on -L/opt/local/lib (for freetype and libpng ) and -L/usr/local/lib ( for pngwriter ).

(Note: pngwriter assumes the lower left corner to be origin(0,0) and upper right corner is at (width, height))

Sample pngwriter code:
----------------------

This program reads two images and finds the HSV components (of the corresponding white region of the segmented binary image.) of the color image.

int main(int argc, char* argv[])
{
if ( argc < 4 )
{
cerr << "Usage: area " << endl;
return -1;
}
//
// MagickCore::SetMagickResourceLimit(MagickCore::MemoryResource, 1536);
// MagickCore::SetMagickResourceLimit(MagickCore::MapResource, 2048);
// Image* img = new Image(argv[1]);


map mapHSV_H;
map mapHSV_S;
map mapHSV_V;

// read the segmented image
pngwriter imageSegmented;
imageSegmented.readfromfile(argv[1]);

// read the color image

pngwriter imageColor;
imageColor.readfromfile(argv[2]);

int widthS = imageSegmented.getwidth();
int heightS = imageSegmented.getheight();

int widthC = imageColor.getwidth();
int heightC = imageColor.getheight();

int width, height;

if ( widthS == widthC && heightS == heightC) {
width = widthS, height = heightS;
} else {
cerr<<"Unequal dimension of the two input images"< exit(1);
}


for (int j=0; j for (int i=0; i
// read the segmented image if the pixel is white then find the HSV component of that pixel
double red = imageSegmented.dread(i, j, RGB_R);
double green = imageSegmented.dread(i, j, RGB_G);
double blue = imageSegmented.dread(i, j, RGB_B);

cout<<"R = "<

28 comments:

Anonymous said...

любительские порно фото школьницы http://free-3x.com/ онлайн видео подростки секс free-3x.com/ изнасилование малолетки видео онлайн [url=http://free-3x.com/]free-3x.com[/url]

Anonymous said...

Ich bin endlich, ich tue Abbitte, aber es kommt mir nicht heran. Ich werde weiter suchen. cialis rezeptfrei viagra wirkungseintritt [url=http//t7-isis.org]viagra[/url]

Anonymous said...

hi

can anyone help me
i have tried for over a week now to get a loan,i have very bad credit history mainly due to a failed marrage ,i have had all the usual ,wh loans,advantage loans ,yes loans ,get in touch and promise a [url=http://www.usainstantpayday.com]bad credit loans[/url] on paying the brokerage fee,i am reluctant due to reviews on the net and i have been stung before by a company called wentorth finance ,and never got the loan of the 50 pound fee back,
i have had an offer from flm but need a gaurantor which isnt really an option either .
i wondered if anyone had any loan companys that considered bad credit ,but loaned direct without these numerous sites with different alias but mainly did same thing pay us and we will get u loan (maybe)senario
has anyone also heard of a company called fresh loans they have they sent me details out but the may be a charge but not always ,i suspect she didnt want to tell me there was a charge

thanks
edgetaEarnerb

Anonymous said...

[url=http://cpcheat.org/]Club Penguin Cheats[/url] provides you with a [url=http://cpcheat.org/club-penguin-money-maker/]Club Penguin Money Maker[/url] that permits you to gain a lot of coins in Club Penguin.
[url=http://cpcheat.org/]Club Penguin Cheats[/url] also gives you [url=http://cpcheat.org/club-penguin-trackers/]Club Penguin Trackers[/url] such as a [url=http://cpcheat.org/club-penguin-aunt-arctic-tracker/]Club Penguin Aunt Arctic Tracker[/url], a [url=http://cpcheat.org/club-penguin-cadence-tracker/]Club Penguin Cadence Tracker[/url], a [url=http://cpcheat.org/club-penguin-gary-tracker/]Club Penguin Gary Tracker[/url], a [url=http://cpcheat.org/club-penguin-band-tracker/]Club Penguin Band Tracker[/url], a [url=http://cpcheat.org/club-penguin-rockhopper-tracker/]Club Penguin Rockhopper Tracker[/url], and a [url=http://cpcheat.org/club-penguin-sensei-tracker/]Club Penguin Sensei Tracker[/url].
Finally,[url=http://cpcheat.org/]Club Penguin[/url] gives you [url=http://cpcheat.org/club-penguin-bots/]Club Penguin Bots[/url] and [url=http://cpcheat.org/]Club Penguin Mission Cheats[/url] and [url=http://cpcheat.org/]Club Penguin Coin Cheats[/url]

Anonymous said...

[b]All of these girls are online now! just click on your favourite to go to their cam![/b]

[url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/1.jpg[/img][/url] [url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/2.jpg[/img][/url]
[url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/3.jpg[/img][/url] [url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/4.jpg[/img][/url]
[url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/5.jpg[/img][/url] [url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/6.jpg[/img][/url]
[url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/7.jpg[/img][/url] [url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/8.jpg[/img][/url]
[url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/9.jpg[/img][/url] [url=http://adf.ly/1DUJ][img]http://www.hourlynetnews.com/mtree/10.jpg[/img][/url]

this will keep updating with the latest girls!

Anonymous said...

China and Russia put the blame on some screwed up experiments of US for the earthquake that happened in Haiti.
Chinese and Russian Military scientists, these reports say, are concurring with Canadian researcher, and former Asia-Pacific Bureau Chief of Forbes Magazine, Benjamin Fulford, who in a very disturbing video released from his Japanese offices to the American public, details how the United States attacked China by the firing of a 90 Million Volt Shockwave from the Americans High Frequency Active Auroral Research Program (HAARP) facilities in Alaska
If we can recollect a previous news when US blamed Russia for the earthquake in Georgio. What do you guys think? Is it really possible to create an earthquake by humans?
I came across this [url=http://universalages.com/hot-news/what-happened-in-haiti-is-it-related-to-haarp/]article about Haiti Earthquake[/url] in some blog it seems very interesting, but conspiracy theories have always been there.

Anonymous said...

[color=#5588aa]Hi

With the continuing rise in popularity of facebook poker chips as a virtual currency in facebook texas holdem poker game many scammers have engaged themselves, who try their best to trick unsuspecting players out of their hard earned yahoo poker chips. All over the internet forums are littered with posts by innocent people who have had their poker chips stolen. Nothing is as sorry state as logging to Facebook or MySpace to play a few hands of poker only to find that someone has already been in your account and your poker chips are gone.[/color]

[url=http://www.chipshut.com][img]http://www.chipshut.com/img/facebook-poker-chips-hut.jpg[/img][/url]

[color=#5588aa]Keep these basic things in mind to protect your facebook poker chips:

Never give your password to a stranger: Trust is a delicate thing that takes a long time to build but only second to destroy. You may meet a sexy girl in poker room and you are friends with him/her. He/she will keep interacting with you days before playing her trick. So be carefull enough to protect your login credentials to yourself, else this may lead to disaster.

Be careful about what you download: Serious online gamers are looking for cheats or hacks for the games they play in order to give them an advantage on their opponents. Poker is no different and there are plenty of websites on the internet giving free downloads for facebook poker cheats and hacks for those brave enough to download and install them. But many of these so called facebook poker cheats have viruses or trojan programs. The moment you install any of these your computer is at the risk of attacks by the creator of the program. He can then have access to vital information that you access from your computer. Leaving your facebook poker account at risk of been hacked. If you never downloaded any of these programs then you’re probably safe, and if you have then you should run a spyware detection program. The best move will be for get your computer formatted to avoid any loop holes.

Phishing Links: This way of hacking has been thee for quite sometime now. Scammers send legitimate and official looking emails to your inbox. When you open them you are asked to click on the link and login in order to save your account or win free facebook poker chips, but in reality you are logging into a fake site that sends your information off to the theif who made it. Before you find it out, its too late to react and they would have already broken into your account and emptied it of any facebook poker chips that you may have.

YouTube scams: If you do a search on youtube for facebook poker cheats, zynga poker hacks, or free facebook poker chips you’ll find hundreds of videos on the topic. More than 90% of them are made by idiots hoping to convince you to send them your account information. They range from slightly clever to completely moronic.

Image Photo Having Exe Embedded In it: This one is hard to catch. This is the latest fashion that is used by scammer, you will be asked to share family photo's. When you open their photo, that will innitiate an exe in the background which will steal all your information and send to the mastermind behin it. So be careful with whom you share photos.

Hope these tips help you saving your chips.

These tips have been brought to you by [/color][url=http://www.chipshut.com]Chips Hut[/url][color=#5588aa] if you are looking to buy [/color][url=http://www.chipshut.com]facebook poker chips[/url], [color=#5588aa]you may go to our online store.

Thanks[/color][img]http://www.chipshut.com/img/chips-hut-smily.gif[/img]

Anonymous said...

hello! acquire mac bit torrents here
http://www.apache3.net

Anonymous said...

Hello, as you can see this is my first post here.
In first steps it is very nice if somebody supports you, so hope to meet friendly and helpful people here. Let me know if I can help you.
Thanks and good luck everyone! ;)

Anonymous said...

According to one of the uploaders the following changes have been made to build 7227

1. Changes in the mechanism for displaying thumbnails in the taskbar.

2. Pop-Up lists for the panel

3. Pop-Up lists for Remote Desktop

4. Applying the settings of the taskbar

5. Multitouch zoom

6. Invert selection

7. You can search for music by artist

8. View the contents of the search results

9. Intelligent indexing after installation

10. Reducing the length of playback sounds system

11. Changes in the panel Devices and Printers

12. Changes in the mechanism of extraction devices

13. Support for FireWire-cameras

14. Reduction in section in system

15. Improved driver support

16. Reducing the paging file

17. Assigning a letter to boot with two OS loaded

18. Naming the section reserved for the system.

There are rumors out there that this build could be fake and that build 7230 will be leaked tomorrow evening.
to know how the new SP looks and to see the screen shots visit [url=http://technoages.com/operating-system/windows-7-operating-system/windows-7-sp1-leaked-check-out-all-the-new-features-of-windows-7-service-pack-1/]this pageabout windows 7[/url]

Anonymous said...

Watch Gossip Girl Online For Free - Gossip Girl Streaming Online

[CENTER][URL="http://www.gossip-girl.watch-movies-and-series-online.com"][IMG]http://www.youronlinemovies.net/includes/public/images/movies/gossip-girl.png[/IMG][/URL]

Hi [B]Upper East Siders[/B]!
Come And Welcome to my website: [B][URL="http://gossip-girl.watch-movies-and-series-online.com"][B]Gossip Girl[/B][/URL][/B]
Whether you’re a Hampton Baby, Central Park [B]Prada[/B] gal, or you even dwell in *[B]gasp[/B]* Brooklyn, [I]this site is for you.[/I]
Why? The answer’s easier than deciding [B]what to wear[/B] tomorrow to school.
[B]Because [/B]my website has [B]all [/B]the latest [B]gossip[/B] about [B]Serena[/B], [B]Blair, Dan [/B]and the other poor little rich kids on the Upper East Side.


[/CENTER]

Anonymous said...

Witam doszedlem do wniosku ze ta strona jest najlepsza jezeli chodzi o [url=http://www.youtube.com/user/kredytstudencki]kredyt studencki[/url].

http://identi.ca/kredytstudencki

Anonymous said...

good afternoonpeople this is a great forum hope im welcome :)

Anonymous said...

Buy online generic medicines from [url=http://allergyrxstore.com/] Drugstore[/url] , no prior prescription and free consultation. On our medicine from [url=http://allergyrxstore.com/] Reputable Pharmac[/url] you can [url=http://allergyrxstore.com/] buy online cheap medication[/url] Clarinex .

Anonymous said...

Jaka jest najlepsza stronka po polsku o kredycie sms? Szukam mozliwie jak najszybciej chwilowki albo pozyczki sms.

Znalazlem ta strone, jest ona najlepsza [url=http://studencki-kredyt.pl/kredyt-sms.html]kredyt sms[/url].

Licze na to ze ci to pomoglo, pozdrawiam z Polski.

Anonymous said...

Jezeli interesuja cie dokladniejsze informacje na temat wnioskow o bron palna to zajrzyj na ta strone [url=http://studencki-kredyt.pl/pozwolenie-na-bron.html]pozwolenie na bron[/url].


[url=http://studencki-kredyt.pl/pozwolenie-na-bron.html]pozwolenie na bron palna[/url]

Anonymous said...

Nice webpage.

We offer domestic and house cleaners carried out by trained cleaning professionals.

Our cleaning technicians are professional and reliable.

Discover more about our [url=http://www.cleanerlondon.com/domestic-cleaning-london.php]office cleaning[/url] technicians.

Anonymous said...

It's so easy to choose high quality [url=http://www.euroreplicawatches.com/]replica watches[/url] online: [url=http://www.euroreplicawatches.com/mens-swiss-watches-rolex/]Rolex replica[/url], [url=http://www.euroreplicawatches.com/mens-swiss-watches-breitling/]Breitling replica[/url], Chanel replica or any other watch from the widest variety of models and brands.

Anonymous said...

[url=http://studencki-kredyt.pl/zycie-studenckie.html]kredyty a zycie studenckie[/url]
http://studencki-kredyt.pl/choroba-pageta.html
http://studencki-kredyt.pl/choroba-perthesa.html
http://studencki-kredyt.pl/choroba-peyroniego.html
http://studencki-kredyt.pl/choroba-popromienna.html
http://studencki-kredyt.pl/choroba-quervaina.html
http://studencki-kredyt.pl/choroba-raynauda.html
http://studencki-kredyt.pl/choroba-wiencowa.html
http://studencki-kredyt.pl/choroba-wilsona.html

Anonymous said...

Buy online generic drugs from [url=http://allergyrxstore.com/] Drugstore[/url] , no prior prescription and free consultation. On our medicines from [url=http://allergyrxstore.com/]online Drugstore[/url] you can [url=http://allergyrxstore.com/] buy online generics[/url] Claritin (Loratadine) .

Anonymous said...

[URL=http://www.wallpaperhungama.in/details.php?image_id=14627][IMG]http://www.wallpaperhungama.in/data/thumbnails/22/Shriya Saran-145.jpg[/IMG][/URL]

[URL=http://www.wallpaperhungama.in/details.php?image_id=14628][IMG]http://www.wallpaperhungama.in/data/thumbnails/22/Shriya Saran-146.jpg[/IMG][/URL]

[URL=http://www.wallpaperhungama.in/details.php?image_id=14630][IMG]http://www.wallpaperhungama.in/data/thumbnails/22/Shriya Saran-148.jpg[/IMG][/URL]

[url=http://www.wallpaperhungama.in/cat-Shriya-Saran-22.htm]Shriya Saran Wallpapers[/url]

Photo gallery at WallpaperHungama.in is dedicated to Shriya Saran Pictures. Click on the thumbnails for enlarged Shriya Saran pictures, personal photographs and exclusive photos. Also check out other Pictures Gallery for High quality and High Resolution image scans, movie captures, movie promos, wallpapers, hollywood & bollywood pictures, photos of actresses and celebrities.

Anonymous said...

hoodia diet pill diets pills hozantac drugs

[url=http://www.bebo.com/buylevitraonline1]buy dreampharmaceuticalscom levitra online[/url]

Anonymous said...

Hello, as you can see this is my first post here.
In first steps it's very good if somebody supports you, so hope to meet friendly and helpful people here. Let me know if I can help you.
Thanks and good luck everyone! ;)

Anonymous said...

canada meet singles [url=http://loveepicentre.com/]cross road dating[/url] special dating services http://loveepicentre.com/ radiometric dating

Anonymous said...

Hello everyone.

Do you enjoy watching TV shows online?

Watch popular TV shows such as Gossip Girl, Weeds, Lost and much more!

[url=http://www.channelblender.com/tv/tv-shows]Watch New Moon[/url]

Anonymous said...

Exceptional web site!

Most everyone needs to get insurance at one time or another, whether it is
auto insurance, life insurance, health insurance, or homeowners insurance.
These days it is more painless than ever to find complimentary insurance quotes from various
companies in order to find the optimal deal. You can also discover how to preserve
lots of money in free gasoline when you get your insurance price quotes.

[url=http://freeinsurancequoteshq.com]Free insurance quotes[/url]
http://freeinsurancequoteshq.com

[url=http://freeinsurancequoteshq.com/life/term-life-insurance-price-quote.html]Term life insurance price quote[/url]

http://freeinsurancequoteshq.com/life/term-life-insurance-price-quote.htm

Anonymous said...

What words...

Anonymous said...

Over $12700 Worth Of PLR E-Books, Software, And Scripts for you. NO BULKY DOWNLOADS, just download the Files you want, when you want them!

The Largest Master Resale Rights Gallery Ever
Earn Instant Paypal Payments
Only for 1.95 USD

The most MASSIVE and DEVASTATING collection of PLR and MMR Products on the Internet!
Now you can get the MASSIVE Private Label Rights Package jammed packed with thousand's of dollars worth of software, e-books, articles, scripts, web site templates, graphics, images and much more! Resell YOUR products for what ever price you want!

FR''EE Lifetime Upgrade

http://bit.ly/abtl8A

Gershgorin Theorem