AN AMERICAN RHAPSODY
Reviewed by Harvey Karten Paramount Classics/ Fireworks Pictures/Seven Arts Director: Eva Gardos Writer: Eva Gardos Cast: Nastassja Kinski, Scarlett Johansson, Tony Goldwyn, Kelly Endresz Banlaki, Agi Banfalvy, Zsuzsa Czinkoczi, Balazs Galko, Zoltan Seress
I guess most of us think we've had weird childhoods, parents who did not understand us, but Eva Gardos's coming-of-age story is an unusual one because not many of us were in her predicament. One example of what people like her went through was seen in the documentary "Into the Arms of Strangers," about 10,000 Jewish children in Nazi-dominated Europe who were whisked to England where they were adopted, some never seeing their biological parents again. Not that Eva Gardos was a member of some hated minority in her native Hungary, and in fact she never even felt a need to leave her homeland. In "American Rhapsody," which is a dramatization of her early and adolescent years, she is seen singing songs in praise of the fun she has in Communist Hungary during the 1950's, nicely decked out in a white uniform with other genuinely smiling girls. But her parents faced a different set of circumstances, which is why Ms. Gardos gives us a labor of love with a movie depicting her bewilderment as a kid and later, her rebellion as an unhappy adolescent.
Eva, who in this story is named Suzanne and is seen at the age of one, again at six, and yet again at age fifteen, could scarcely have known what impelled her folks, Margit (Nastassja Kinski) and Peter (Tony Goldwyn) to risk everything by leaving the country of their birth. Peter's publishing house was closed down by the repressive Communist regime governing the East European nation and, as we later learn, someone happens to his wife Margit that is quite a bit more gruesome. Writer-director Gabor takes us through the risky escape, as Margit and Peter, dressed as peasants, are put on a train heading toward the Austrian border under the supervision of whatever they call a Coyote in the Budapest area, crawl under barbed wire, find themselves in Vienna and later go to Los Angeles.  Suzanne grows without her real folks but stays in Budapest with foster parents, the kindly Jeno (Balazs Galko) and Teri (Zsuzsa Czinkoczi), inhabiting the middle of the story at age six where Suzanne is played by the marvelous and adorable Kelly Endresz Banlaki. Suzanne is wrested from the foster folks whom she loves by her grandmother and whisked to L.A. to join her biological parents where at first she digs the hamburgers, the Elvis records, and the lovely, if sterile, suburban landscape. By the time she reaches the troubled age of fifteen, however (as played by Scarlett Johansson--formerly of "The Horse Whisperers" and "Ghost World"), she's homesick for the old country and the kindly people she leaves behind.
I rarely want to throw tomatoes at the screen but I did in this case--and this is not a criticism of the film. Margit, who felt so oppressed during the Soviet occupation of Hungary and was itching to get out of there, now becomes a bit a Red Fascist herself, just like the occupations forces in 1950's Budapest. While praising the land of liberty, she suddenly does not like the freedoms that her daughter wants to enjoy with a handsome boy. Seeing the teen kissing the lad, she has bolts put on Suzanne's bedroom door and locks installed on the windows--to the chagrin of the poor teen who by then wants to escape to freedom--back to Hungary!
The question that keeps us, oh, in the middle of our seats by this time is: will she bolt for good and stay with her kindly Hungarian folks, where she can find equally handsome boys and be serenaded by gypsies? Or will she sell out and realize that America is her real home after all?
Gardos wears her heart on her sleeve. After all, this is her story and she must be proud indeed to share it with movie buffs everywhere. The film played first at the Karlovy Vary Film Festival in the Czech Republic, then headed west to Nantucket, and is now scheduled to open August 10 in NY and LA and later in the rest of the country. Aside from being an absolute labor of love for Gardos, "An American Rhapsody" falls short of its title--a fairly ordinary picture told in a conventional style albeit with canny lensing especially in Budapest by Elemer Ragalyi, backed up by a Hungarian crew in the city of bridges and an L.A. team here in the States. Though arthouse fare, the plot is schematic. Important gaps make us want to know more about, say, how the Red Cross managed to sponsor Suzanne's solo trip at the age of six from Budapest to L.A. via London. Tony Goldwyn plays the kind of dad we all wish we had--understanding, gentle, often at a loss to calm down his neurotic wife. And Natassja Kinski blinks quite a bit. But oh, that Kelly Endresz Banlaki--that's the little actress whose notable performance will survive in our memory after the predictable plot is forgotten.
Rated PG-13. Running time: 103 minutes. (C) 2001 by Harvey Karten<EMAIL_ADDRESS>========== X-RAMR-ID: 28817 X-Language: en X-RT-ReviewID: 236417 X-RT-TitleID: 10000566 X-RT-SourceID: 570 X-RT-AuthorID: 1123
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Search
Preparing search index...


"Hurlyburly"
Reviewed by Heather Picker
Directed by Anthony Drazan. Written by David Rabe. Starring Sean Penn and Kevin Spacey, with Chazz Palminteri and Robin Wright Penn. 1998, 123 min., Rated R.
The night before I watched "Hurlyburly," I watched Neil LaBute's "Your Friends & Neighbors." Both films share the common theme of disparity in the lives of people who seemingly have it all going for them. "Hurlyburly," directed by Anthony Drazan is about the self-absorption of a group of friends and acquaintances. Unlike the characters in "Your Friends & Neighbors," the folks here hurt themselves and each other through drug use and words instead of sex.
Eddie (Sean Penn) is a casting director who lives in a Hollywood Hills mansion with business partner Mickey (Kevin Spacey). A brief but concise introduction into Eddie's world opens the film. Introduced as occurring "A Little While Ago" (only to skip ahead a short while later), Eddie snorts cocaine and nervously paces the room, and says "Heart's stopped. I know how you feel," as a picture of open heart surgery flashes across the television screen. At this time nothing more about the character and how he will behave throughout the rest of the movie has to be explained or foreshadowed; there is an almost instantaneous identification with the inner pain this man is in, which so obviously contorts him, that just makes you feel like nothing will really change, at least during the course of the next couple of hours we'll spend with him, because he needs this distress in order to function the only way he knows how.
To say that there is plot, and then discuss it is not something that would be enjoyable to read because the movie is basically one hundred percent dialogue and is largely repetitive. Adapted by David Rabe from his own play, it is easy to imagine the script as one rather length soliloquy, as characters, mostly Eddie, deliver rambling, occasionally incoherent speeches at such a rate that there is little time for pause or action of any sort. Some viewers will be turned off by this, but these are characters who feel like they are drowning in themselves figuratively as they literally drown themselves in drugs. I didn't mind that a lot of the same things were mentioned in different ways by the characters, whose few tangible bonds are their shared feelings of suffocating in their own thoughts, their own selfishness and constant distraction. Everything revolves around them, and they don't know whether or not it is okay to feel like that, even though they do. It is what makes them human, and it is what made it a sometimes visceral viewing experience for myself.
The elements of the story that aren't exactly cohesive but band together characters and lead into the ending are as follows: Eddie is interested in Darlene (Robin Wright Penn), who is also in show business, but Mickey becomes involved with her first. Friend Artie (Garry Shandling) shows up at Eddie and Mickey's place with Donna (Anna Paquin), a teen runaway (?) who was living in the elevator at his building. He "gives" her to them as a CARE package, and Mickey finds her more interesting a prospect than Darlene, so tries to pull the noble friend routine by encouraging Eddie and Darlene to give a go at a relationship. Phil (Chazz Palminteri), Eddie's struggling actor friend and small-time thug, is having marital woes and spends much of his free time getting high, popping pills, and intimidating Donna at the Hills bachelor pad.
Along for the ride is Bonnie (Meg Ryan), infamous in Eddie and Mickey's circle for her promiscuity, who is tossed out of a moving car by Phil, after Eddie tried to set the two of them up towards the end of a night of mucho chemical (plural and of various natures) intake. Bonnie is the most out-of-place character, though Ryan makes a nice impression during her brief on-camera stint. The only reason necessitating even the mentioning of her character is a story that the sober but soon not to be Eddie tells about Bonnie engaging in what can definitely be considered bad-parenting behavior around her young daughter, at the suggestion of Eddie and Mickey, who doesn't show any emotion as Eddie disgustedly keeps on with the story.
"Hurlyburly" boasts perhaps the best ensemble acting of 1998. Penn is astounding, and Spacey is perfect, and appears to revel in the sarcastic, hypocritical lines Mickey gets to slyly deliver. Robin Wright Penn, Shandling, and Paquin don't have too much to do, but are solid in their roles, and Palminteri is also great. Drazan has a visual style that is mostly uncluttered, which works well because the dialogue is the main attraction. Rabe has crafted a script that will be irritating and stilted, just adequate, or revelatory depending on the viewer. Some of the plot is strained, and about an hour and a half into the film I knew what the "big event" would be that would give some of the characters a chance for redemption, and I also knew how they'd use that chance. Predictable, but interesting to watch unfold.
DVD Details: New Line unfortunately didn't release the DVD as a part of their Platinum Series, but it is nonetheless an affordably priced ($24.99, available online for $14.99) disc with an attractively sparse look and some good supplemental material. Shown widescreen (the film's aspect ratio is 1.85:1) and anamorphically enhanced, the picture is mostly solid but at times artifacts are noticeable. Anything less than absolute visual brilliance is considered substandard for a New Line DVD release, but the picture quality is acceptable and quite good. The sound is excellent. Stereo surround and DD 5.1, in a movie that is entirely composed of dialogue, it more than suffices and everything sounds crisp and clear.
The main menu is simple and nice looking, with Play Movie, Special Features, Scene Selections, and Language Selections options. If you click on the New Line logo you'll see disc production credits. The theatrical trailer is slightly grainy at times, gives the definition of the film's title, "n. 1. Tumultuous commotion; uproar." Cast and crew filmographies and biographies are included, as are two full-length audio commentaries. The first is with director Drazan; he rhapsodizes on directing the adaptation, and David Rabe on the writing process. The second track is of Penn, Rabe, and author/social commentator Janet Brown discussing the themes in the play and movie, and selective music cues and insight from composer David Baerwald. It isn't an "As Good As It Gets" or "Bound" type of together-in-a-room discussion, rather isolated comments with some stretches of just the movie in between. Overall, the second commentary track is interesting and informative.
 I read a review saying this film isn't appropriate (in that reviewer's opinion) for anyone under college age, but as a high school student I can say that most mature teenagers can 'handle' seeing this movie.
The Verdict: "Hurlyburly" isn't for everyone. It's story is hidden under layer upon layer of dialogue, but it's lasting message and the excellent acting are it's strongest suits and fans of dark, offbeat, edgy dramas with a healthy dose of social commentary are most likely to appreciate it. And the DVD is another New Line home-run. mailto<EMAIL_ADDRESS>Review courtesy of http://www.thatmoviesite.8m.com
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


DfE enquiries
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
News story
Department for Education figures released today show that a third of all secondary schools have become or are converting to academies.
Figures released today show that more than 1,000 schools have now applied to become academies. 240 schools have applied in the last month alone.
As of today:
The total number of open academies, including those opened under the previous government, now stands at 658.
Outstanding schools were invited to apply for academy status from June 2010. This offer has since been extended to special schools and any other school that is performing well.
Strong schools that convert to academy status are expected to support other local schools that could benefit from improvement. So far, more than 800 schools are benefiting from this support.
Academies are free from local and national government control. They are able to focus their time and resources on meeting the needs of their pupils and school, rather than answering to local or national politicians and bureaucrats.
Education Secretary, Michael Gove, said today:
More than a thousand schools have now applied to be academies. A third of secondary schools are now either an academy or have started on the road to conversion. This represents a fundamental shift in power away from government and towards teachers. Teachers, not politicians or bureaucrats, know best how to run schools.
Schools want the freedom to decide what is best for their pupils. They want to be free to innovate in the classroom, inspiring pupils to learn. Academy status gives them that freedom and is the reason why even more schools will follow these pioneers in the following months and years.
Schools have welcomed the opportunity to become academies.
Des MacPhee of Norton College, North Yorkshire, said
We want to secure Norton College’s ‘outstanding practice’ and be recognised as a teaching school which leads a collaborative and school-led partnership focused on school improvement. The Trust will enhance outcomes for all of its learners by using the additional flexibilities brought about by academy status.
The updated list of academies and information for schools wishing to apply is available in the academies section of the Department for Education’s website.
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Published: 10 May 2011


|
CoreSight Access Library
2.3
ARM CoreSight Access Library - on target CoreSight component control
|
Basic API functions are common and can be used with both ITM or STM. More...
Functions | |
| int | cs_trace_swstim_get_port_count (cs_device_t dev) |
| int | cs_trace_stimulus (cs_device_t dev, unsigned int port, unsigned int value) |
| Generate a software trace message on a given port. More... | |
| int | cs_trace_swstim_enable_trigger (cs_device_t dev, unsigned int mask, unsigned int value) |
| int | cs_trace_swstim_enable_all_ports (cs_device_t dev) |
| int | cs_trace_swstim_set_sync_repeat (cs_device_t dev, unsigned int value) |
| int | cs_stm_config_master (cs_device_t dev, unsigned int master, cs_physaddr_t port_0_addr) |
| Define STM master address. More... | |
| int | cs_stm_select_master (cs_device_t dev, unsigned int master) |
| int | cs_stm_ext_write (cs_device_t dev, const unsigned int port, const unsigned char *value, const int length, const int trans_type) |
| int | cs_stm_config_get (cs_device_t dev, stm_config_t *dyn_config) |
| int | cs_stm_config_put (cs_device_t dev, stm_config_t *dyn_config) |
Basic API functions are common and can be used with both ITM or STM.
Advanced functions with _stm_
in the name are for the stm device only.
The following code will initialise and ITM dev
for basic use, with all ports enabled for operation:-
cs_trace_swstim_enable_all_ports(dev); cs_trace_swstim_set_sync_repeat(dev,32); cs_trace_enable(dev);
A similar sequence can be used to initialise the STM. However, if the STM has extended ports then an additional step is needed to configure at least one master.
int master_index = 0; cs_physaddr_t mast_addr = 0x70000000; cs_stm_config_master(dev, master_index, mast_addr); cs_stm_select_master(dev,master_index); cs_trace_swstim_enable_all_ports(dev); cs_trace_swstim_set_sync_repeat(dev,32); cs_trace_enable(dev);
| int cs_stm_config_get | ( | cs_device_t | dev, |
| stm_config_t * | dyn_config | ||
| ) |
Reads a set of configuration registers from the STM. Registers accessed controlled by the config_op_flags parameter in the stm_config_t structure. Use for advanced configuration of the STM device.
| dev | : STM device |
| *dyn_config | : configuration structure for data read from device. |
| int cs_stm_config_master | ( | cs_device_t | dev, |
| unsigned int | master, | ||
| cs_physaddr_t | port_0_addr | ||
| ) |
Define STM master address.
This function defines the address for a given master and maps that memory into the application space, to enable ports to be written.
A STM master is a 16MB large memory address space providing up to 65536 stimulus ports, 256 bytes each. STM architecture supports more than one groups like this, each group being a single master aligned to a 16MB boundary.
The software view of the masters in a system and the relationship to master IDs in STPv2 is implementation dependent. For example on the ARM Juno development board, all cores see a single master at the same address, but the master ID mapped into STPv2 is different depending on the core used and the security state of the access.
| dev | STM device |
| master | STM master index |
| port_0_addr | Physical address of the first stimulus port for this master. (this will be implementation dependent and on the AXI bus). |
| int cs_stm_config_put | ( | cs_device_t | dev, |
| stm_config_t * | dyn_config | ||
| ) |
Writes a set of configuration registers to the STM. Registers accessed controlled by the config_op_flags parameter in the stm_config_t structure. Use for advanced configuration of the STM device.
| dev | : STM device |
| *dyn_config | : configuration structure for data written to device. |
| int cs_stm_ext_write | ( | cs_device_t | dev, |
| const unsigned int | port, | ||
| const unsigned char * | value, | ||
| const int | length, | ||
| const int | trans_type | ||
| ) |
Write data to the STM extended stimulus port.
The current master is used for the memory base address, with the port index and operation type defining the offset within that master.
Large writes are broken into multiple writes of the size of the fundamental data size for the implemented STM.
Writes use the supplied transaction type. None data writes will ignore any input data and write 0 to the port.
| dev | : STM to use. |
| port | : Extended stimulus port to use. |
| *value | : pointer to write data |
| length | : length of data to write. |
| trans_type | : Transaction type. |
| int cs_stm_select_master | ( | cs_device_t | dev, |
| unsigned int | master | ||
| ) |
Select STM master to be used in cs_trace_stimulus() or cs_stm_ext_write()
| dev | : STM device |
| master | : STM master index |
| int cs_trace_stimulus | ( | cs_device_t | dev, |
| unsigned int | port, | ||
| unsigned int | value | ||
| ) |
Generate a software trace message on a given port.
This is a generic operation that can target either ITM or STM.
I_DMTS
type, on the currently configured master using the supplied port index. Index range is 0
to num_ports_implemented - 1
. Number of ports can be up to 65536 for the STM.| dev | the software trace device (ITM or STM) |
| port | the stimulus port index - must be in valid range for the device |
| value | the stimulus message value (payload) |
| int cs_trace_swstim_enable_all_ports | ( | cs_device_t | dev | ) |
Enable all SW stimulus ports on the device.
| dev | : STM or ITM device to use. |
| int cs_trace_swstim_enable_trigger | ( | cs_device_t | dev, |
| unsigned int | mask, | ||
| unsigned int | value | ||
| ) |
Enable triggers on stimulus port write.
| dev | : STM or ITM device to use. |
| mask | : bit mask for ports to change |
| value | : bit values for ports to change. |
| int cs_trace_swstim_get_port_count | ( | cs_device_t | dev | ) |
Return the number of software stimulus ports implemented
| dev | : ITM or STM trace device |
| int cs_trace_swstim_set_sync_repeat | ( | cs_device_t | dev, |
| unsigned int | value | ||
| ) |
Set the Sync packet frequency count.
This sets the frequncy that SYNC packets appear in the trace stream.
ITMSYNCCTRL
register.STMSYNCR[11:0]
. STMSYNCR[12]
(MODE) set to 0.| dev | : STM or ITM device to use. |
| value | : Value of counter. |


Welcome
{{user.name}}
to the SUPERSEDE DMGame app
List of unscheduled requirements
Plan Decision Making Process
Execute plan
Results


Davide L Rizzo User Experience and Front-end Designer
Twitter
@davidelrizzo
LinkedIn
au.linkedin.com/pub/davide-rizzo
Website
www.davidelrizzo.com
Blog
davidelrizzo.tumblr.com
Web experiments
codepen.io/davidelrizzo
I am a Melbourne-based User Experience and Front-End Designer with more than 15 years experience across various industries. I live on the line between design and development, with UX and Front-End being the perfect synergy for my skills. I am currently employed at the Suncorp Group as a Senior UX Designer working on personal insurance sites and web applications for some of the largest insurance brands in Australia. I am the founder of Suncorp’s front-end multi-brand styleguide.
Employment history
Senior UX Designer – Suncorp Group 2012 to current
- Pioneer and creator of the Suncorp Web Styleguide - a living multi-brand front-end framework. This supported Suncorp in implementing Australia’s first responsive insurance quote flow and permits scaling of application design never before possible.
- Sole specialist in component based and responsive design, HTML prototyping, progressive enhancement, icon curation, font-end mult-brand architecture and design for reusable patterns.
- Design, development, information architecture, user testing and UX research for the Suncorp Insurance brands: AAMI, GIO, Suncorp, Bingle, IMR, Just Car, Terry Sheer, Apia quote flow applications for home, car and motorcycle insurance.
Internet Team Leader – The Just Group 2006 to 2012
- 2006 to 2012 Manager of The Just Group Web Design team responsible for website maintenance and EDM campaign to hundreds of thousands of customers each week across 7 brands.
- Implemented front-end integration for company-wide rollout of WebSphere Commerce, including site wide prototypes and dynamic marketing - Jay Jays and Dotti (in 2010), Portmans and Jacqui E (in 2011), Smiggle Peter and Alexander (in 2012).
- Primary interface designer and front end developer for The Just Group websites, with builds including Just Jeans (2006 and again in 2009), Dotti (2007), Jacqui E (2007), The Just Group (2007), Smiggle (2008) and Peter Alexander (2008 to 2009).
- Overhaul of The Just Group eCommerce platform front-end on the Interworld platform. Comprehensive work on customer registration, online product catalogues and checkout systems.
- Animation and game design. Pioneered technique for Progressive Enhanced Flash site for Dotti.
- Management, mentoring and training of junior and senior web designers. Project and team time management under continual heavy deadlines.
Lead Web Designer – ANZ Bank (anz.com) 2004 to 2005
- Full responsibility for ANZ website graphics (anz.com), including homepage, promotions, banners, landing pages, animations and games.
- Management of design standards for anz.com, including the creation of an online Web Styleguide.
- Management and mentoring of web designers located in India.
Usability and Graphic Designer – ANZ Bank 2002 to 2004
- Graphic design for ANZ Internet and Intranet including ANZ Private, ANZ Pacific and ANZ Royal Cambodia websites. Construction of interactive animated promotions for anz.com and Esanda finance.
- Construction of Flash applications and Screensavers, Product demos, CD ROM applications and ATM screens.
- Involvement with Intranet strategy groups for the construction of best practice Intranet sites and overall Intranet design guidelines and policy.
Publishing administrator – INT Press educational bookshop 1996 – 2000
- Desktop publishing (printed educational books), mail order and invoicing with MYOB.
Freelance work
- Site design and development for the Da Vinci Machines and Ancient Rome exhibitions. A dedicated responsive website for prospective patrons wanting information on exhibitions around Australia. (2008, 2009, 2011)
- Abstract Creative full development of a fluid, progressive enhanced and content managed website in Flash. (2006)
- Shantaram website design and development, to support stories and essays from the author of the best selling Australian novel. (2004)
Technical Skills
Languages & Tools
Applications
Techniques
Wireframing
Prototyping
Design for Reuse and Maintenance
Information architecture
User Testing
Accessibility
Version control
Versatility
(Design and Development)
Websites
Web apps
Emails
Games
Real-time apps
Content management
Icons
Animation
Native Apps
Documentation
Public Speaking
The Secret Life of InputsUnderstanding input behaviour across browsers and devices is essential to best practice form design.
- Aug 2015: UX Australia
- June 2015: IxDA Melbourne Meetup
- Mar 2015: CSSConf Australia (Decompress)
Multibrand StyleguidesHow the Suncorp Front-End Styleguide was built to support multiple components, brands and platforms.
- Dec 2014: Melb CSS Meetup
Education history
Bachelor of Computer Science Melbourne University 1999 – 2003
- Study areas included: Programming, Software lifecycle and development, Artificial Intelligence, Database management, Usability, Interface Design, Classics, History, Photography.
Victorian Certificate of Education Strathmore Secondary College Completed 1998
- TER Score of 92.5, received straight A+ in Mathematical Methods, Information Process and Management, and Information Systems.
- Graphics Common Assessment Task (CAT) was nominated for entry in Scienceworks Top CATs exhibition.
Professional training
- 2015: UX Australia, Brisbane
- 2015: CSSConf Australia, Melbourne
- 2014: 1st CSS & JS Conference Melbourne
- 2013: UX Australia conference + workshops, Melbourne
- 2009: eCommerce & Marketing conference, Sydney
- 2008: WACAG 2.0 Accessibility standards seminar
- 2006: Vision Australia, Web Accessibility Training
- 2006: Max Design, Advanced CSS Programming course
- 2005: Semi-Permanent Design conference, Sydney
- 2004: Macromedia certified course, Advanced application development
- 2002: ANZ Breakout performance and culture 2 day workshop


Permissions for an implementation guide determine who can view and who can edit the implementation guide and the templates that the implementation guide owns.
Changes to the permissions of the implementation guide are not persisted until the implementation guide's Save button has been selected.
The "Add Permission" dialog allows you to select one of the following types of concepts:
When permitting a user access to the implementation guide, you may select "Notify new users and groups that they have been granted permissions". This option sends an email to any users with new permissions informing them of the change in permissions.
The email message includes their user information, what permission they have been granted, and a link to the imlementation guide they have been granted permissions to.
Notification messages are not sent to "Entire organization" permissions. They are only sent to individual users that have been granted permissions, and users within groups that have been granted permissions to the implementation guide.
When sending notifications to a group, be aware of the users that are included in the group. The notification will be sent to every user in the group.
When the implementation guide (IG) has an access manager and allows access requests, the display name (or name, if no display name is specified) of the IG will be available in a list of IG's that a user does not have access to. The Browse Implementation Guides screen prompts the user with a message indicating that they may not have access to an IG they are looking for. When the user selects the "request access" link, a dialog is presented to the user listing each IG that meets the following criteria:
Trifolia does not enumerate users from groups in the "access manager" drop-down. In order for a user to be available for selection in the "access manager" field, the user must have a separate "edit" permission (and not just be part of a group that has "edit" access to the IG).


--- layout: page title: my publications subtitle: ML Theory, Graph Theory, and Set Theory ---
Citation informaiton.
Citation information.


--- layout: post title: Hit on Custer's Hill date: '2016-04-06T18:30:24+02:00' categories: - Sketchbooks - Sketches picture_url: https://film-Storyboards.tumblr.com/post/142374620423 ---


A preorder that is antisymmetric.
Such relations are often written ≤ . Compare strict partial ordering, total ordering.


#define CV_TREE_NODE_FIELDS(node_type) \ int flags; /* micsellaneous flags */ \ int header_size; /* size of sequence header */ \ struct node_type* h_prev; /* previous sequence */ \ struct node_type* h_next; /* next sequence */ \ struct node_type* v_prev; /* 2nd previous sequence */ \ struct node_type* v_next; /* 2nd next sequence */
The macro CV_TREE_NODE_FIELDS()
is used to declare structures
that can be organized into hierarchical strucutures (trees), such as CvSeq -
the basic type for all dynamical structures.
The trees made of nodes declared using this macro can be processed using
the functions described below in this section.
Opens existing or creates new file storage
typedef struct CvTreeNodeIterator { const void* node; int level; int max_level; } CvTreeNodeIterator;
The structure CvTreeNodeIterator is used to traverse trees.
The tree node declaration should start with CV_TREE_NODE_FIELDS(...)
macro.
Initializes tree node iterator
void cvInitTreeNodeIterator( CvTreeNodeIterator* tree_iterator, const void* first, int max_level );
first
node assumed to be at the first level) to
traverse up to. For example, 1 means that only nodes at the same level as first
should be visited, 2 means that the nodes on the same level as first
and
their direct children should be visited etc.
The function cvInitTreeNodeIterator
initializes tree iterator.
The tree is traversed in depth-first order.
Returns the currently observed node and moves iterator toward the next node
void* cvNextTreeNode( CvTreeNodeIterator* tree_iterator );
The function cvNextTreeNode
returns the currently observed node and then
updates the iterator - moves it toward the next node. In other words, the function behavior
is similar to *p++ expression on usual C pointer or C++ collection iterator.
The function returns NULL if there is no more nodes.
Returns the currently observed node and moves iterator toward the previous node
void* cvPrevTreeNode( CvTreeNodeIterator* tree_iterator );
The function cvPrevTreeNode
returns the currently observed node and then
updates the iterator - moves it toward the previous node. In other words, the function behavior
is similar to *p-- expression on usual C pointer or C++ collection iterator.
The function returns NULL if there is no more nodes.
Gathers all node pointers to the single sequence
CvSeq* cvTreeToNodeSeq( const void* first, int header_size, CvMemStorage* storage );
The function cvTreeToNodeSeq
puts pointers of all nodes reacheable from first
to the single sequence. The pointers are written subsequently in the depth-first order.
Adds new node to the tree
void cvInsertNodeIntoTree( void* node, void* parent, void* frame );
parent
and frame
are the same, v_prev
field of node
is set to NULL rather than parent
.
The function cvInsertNodeIntoTree
adds another node into tree. The function does not
allocate any memory, it can only modify links of the tree nodes.
Removes node from tree
void cvRemoveNodeFromTree( void* node, void* frame );
node->v_prev = NULL
and
node->h_prev
is NULL (i.e. if node
is the first child of frame
),
frame->v_next
is set to node->h_next
(i.e. the first child or frame is changed).
The function cvRemoveNodeFromTree
removes node from tree. The function does not
deallocate any memory, it can only modify links of the tree nodes.
Drawing functions work with matrices/images or arbitrary depth.
Antialiasing is implemented only for 8-bit images.
All the functions include parameter color that means rgb value (that may be
constructed with CV_RGB
macro or cvScalar
function)
for color images and brightness for grayscale images.
If a drawn figure is partially or completely outside the image, it is clipped.
For color images the order channel is: Blue Green Red ...
If one needs a different channel order, it is possible to construct color
via cvScalar
with the particular channel order, or
convert the image before and/or after drawing in it with
cvCvtColor or
cvTransform.
Constructs a color value
#define CV_RGB( r, g, b ) cvScalar( (b), (g), (r) )
Draws a line segment connecting two points
void cvLine( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int line_type=8, int shift=0 );
8
(or 0
) - 8-connected line.4
- 4-connected line.CV_AA
- antialiased line.
The function cvLine
draws the line segment between pt1
and pt2
points
in the image. The line is clipped by the image or ROI rectangle. For non-antialiased lines
with integer coordinates the 8-connected or 4-connected Bresenham algorithm is used.
Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering.
To specify the line color, the user may use the macro CV_RGB( r, g, b )
.
Draws simple, thick or filled rectangle
void cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int line_type=8, int shift=0 );
The function cvRectangle
draws a rectangle with
two opposite corners pt1
and pt2
.
Draws a circle
void cvCircle( CvArr* img, CvPoint center, int radius, CvScalar color, int thickness=1, int line_type=8, int shift=0 );
The function cvCircle
draws a simple or filled circle with given center and
radius. The circle is clipped by ROI rectangle. To specify the circle color, the user may
use the macro CV_RGB ( r, g, b )
.
Draws simple or thick elliptic arc or fills ellipse sector
void cvEllipse( CvArr* img, CvPoint center, CvSize axes, double angle, double start_angle, double end_angle, CvScalar color, int thickness=1, int line_type=8, int shift=0 );
The function cvEllipse
draws a simple or thick elliptic arc or fills an ellipse
sector. The arc is clipped by ROI rectangle. A piecewise-linear
approximation is used for antialiased arcs and thick arcs. All the angles are
given in degrees. The picture below explains the meaning of the parameters.
Parameters of Elliptic Arc
Draws simple or thick elliptic arc or fills ellipse sector
void cvEllipseBox( CvArr* img, CvBox2D box, CvScalar color, int thickness=1, int line_type=8, int shift=0 );
The function cvEllipseBox
draws a simple or thick ellipse outline,
or fills an ellipse. The functions provides a convenient way to draw an ellipse
approximating some shape; that is what cvCamShift
and cvFitEllipse do.
The ellipse drawn is clipped by ROI rectangle. A piecewise-linear
approximation is used for antialiased arcs and thick arcs.
Fills polygons interior
void cvFillPoly( CvArr* img, CvPoint** pts, int* npts, int contours, CvScalar color, int line_type=8, int shift=0 );
The function cvFillPoly
fills an area bounded by several polygonal contours.
The function fills complex areas, for example, areas with holes, contour self-intersection, etc.
Fills convex polygon
void cvFillConvexPoly( CvArr* img, CvPoint* pts, int npts, CvScalar color, int line_type=8, int shift=0 );
The function cvFillConvexPoly
fills convex polygon interior.
This function is much faster than The function cvFillPoly
and can fill
not only the convex polygons but any monotonic polygon, i.e. a polygon whose contour intersects every
horizontal line (scan line) twice at the most.
Draws simple or thick polygons
void cvPolyLine( CvArr* img, CvPoint** pts, int* npts, int contours, int is_closed, CvScalar color, int thickness=1, int line_type=8, int shift=0 );
The function cvPolyLine
draws a single or multiple polygonal curves.
Initializes font structure
void cvInitFont( CvFont* font, int font_face, double hscale, double vscale, double shear=0, int thickness=1, int line_type=8 );
CV_FONT_HERSHEY_SIMPLEX
- normal size sans-serif fontCV_FONT_HERSHEY_PLAIN
- small size sans-serif fontCV_FONT_HERSHEY_DUPLEX
- normal size sans-serif font (more complex than CV_FONT_HERSHEY_SIMPLEX
)CV_FONT_HERSHEY_COMPLEX
- normal size serif fontCV_FONT_HERSHEY_TRIPLEX
- normal size serif font (more complex than CV_FONT_HERSHEY_COMPLEX
)CV_FONT_HERSHEY_COMPLEX_SMALL
- smaller version of CV_FONT_HERSHEY_COMPLEX
CV_FONT_HERSHEY_SCRIPT_SIMPLEX
- hand-writing style fontCV_FONT_HERSHEY_SCRIPT_COMPLEX
- more complex variant of CV_FONT_HERSHEY_SCRIPT_SIMPLEX
CV_FONT_ITALIC
flag,
that means italic or oblique font.
1.0f
, the characters have the original
width depending on the font type. If equal to 0.5f
, the characters are of half
the original width.
1.0f
, the characters have the original
height depending on the font type. If equal to 0.5f
, the characters are of half
the original height.
1.0f
means ≈45°
slope, etc.
thickness Thickness of lines composing letters outlines. The function cvLine
is
used for drawing letters.
The function cvInitFont
initializes the font structure that can be passed to
text rendering functions.
Draws text string
void cvPutText( CvArr* img, const char* text, CvPoint org, const CvFont* font, CvScalar color );
The function cvPutText
renders the text in the image with the specified font and
color. The printed text is clipped by ROI rectangle. Symbols that do not belong
to the specified font are replaced with the rectangle symbol.
Retrieves width and height of text string
void cvGetTextSize( const char* text_string, const CvFont* font, CvSize* text_size, int* baseline );
The function cvGetTextSize
calculates the binding rectangle for the given text
string when a specified font is used.
Draws contour outlines or interiors in the image
void cvDrawContours( CvArr *img, CvSeq* contour, CvScalar external_color, CvScalar hole_color, int max_level, int thickness=1, int line_type=8, CvPoint offset=cvPoint(0,0) );
contour
is drawn. If
1, the contour and all contours after it on the same level are drawn. If 2, all
contours after and all contours one level below the contours are drawn, etc.
If the value is negative, the function does not draw the contours following after contour
but draws child contours of contour
up to abs(max_level
)-1 level.
The function cvDrawContours
draws contour outlines in the image if thickness
>=0
or fills area bounded by the contours if thickness
<0.
#include "cv.h" #include "highgui.h" int main( int argc, char** argv ) { IplImage* src; // the first command line parameter must be file name of binary (black-n-white) image if( argc == 2 && (src=cvLoadImage(argv[1], 0))!= 0) { IplImage* dst = cvCreateImage( cvGetSize(src), 8, 3 ); CvMemStorage* storage = cvCreateMemStorage(0); CvSeq* contour = 0; cvThreshold( src, src, 1, 255, CV_THRESH_BINARY ); cvNamedWindow( "Source", 1 ); cvShowImage( "Source", src ); cvFindContours( src, storage, &contour, sizeof(CvContour), CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE ); cvZero( dst ); for( ; contour != 0; contour = contour->h_next ) { CvScalar color = CV_RGB( rand()&255, rand()&255, rand()&255 ); /* replace CV_FILLED with 1 to see the outlines */ cvDrawContours( dst, contour, color, color, -1, CV_FILLED, 8 ); } cvNamedWindow( "Components", 1 ); cvShowImage( "Components", dst ); cvWaitKey(0); } }
Replace CV_FILLED with 1 in the sample below to see the contour outlines
Initializes line iterator
int cvInitLineIterator( const CvArr* image, CvPoint pt1, CvPoint pt2, CvLineIterator* line_iterator, int connectivity=8, int left_to_right=0 );
pt1
and pt2
(left_to_right≠0
),
or it is scanned in the specified order, from pt1
to pt2
(left_to_right=0
).
The function cvInitLineIterator
initializes the line iterator and returns the
number of pixels between two end points. Both points must be inside the image.
After the iterator has been initialized, all the points on the raster line that
connects the two ending points may be retrieved by successive calls of
CV_NEXT_LINE_POINT
point. The points on the line are calculated one by one using
4-connected or 8-connected Bresenham algorithm.
CvScalar sum_line_pixels( IplImage* image, CvPoint pt1, CvPoint pt2 ) { CvLineIterator iterator; int blue_sum = 0, green_sum = 0, red_sum = 0; int count = cvInitLineIterator( image, pt1, pt2, &iterator, 8, 0 ); for( int i = 0; i < count; i++ ){ blue_sum += iterator.ptr[0]; green_sum += iterator.ptr[1]; red_sum += iterator.ptr[2]; CV_NEXT_LINE_POINT(iterator); /* print the pixel coordinates: demonstrates how to calculate the coordinates */ { int offset, x, y; /* assume that ROI is not set, otherwise need to take it into account. */ offset = iterator.ptr - (uchar*)(image->imageData); y = offset/image->widthStep; x = (offset - y*image->widthStep)/(3*sizeof(uchar) /* size of pixel */); printf("(%d,%d)\n", x, y ); } } return cvScalar( blue_sum, green_sum, red_sum ); }
Clips the line against the image rectangle
int cvClipLine( CvSize img_size, CvPoint* pt1, CvPoint* pt2 );
The function cvClipLine
calculates a part of the line segment which is entirely in the image.
It returns 0 if the line segment is completely outside the image and 1 otherwise.
Approximates elliptic arc with polyline
int cvEllipse2Poly( CvPoint center, CvSize axes, int angle, int arc_start, int arc_end, CvPoint* pts, int delta );
The function cvEllipse2Poly
computes vertices of the polyline that approximates the specified elliptic arc.
It is used by cvEllipse.
File Storage
typedef struct CvFileStorage { ... // hidden fields } CvFileStorage;
The structure CvFileStorage is "black box" representation of
file storage that is associated with a file on disk. Several functions that are described below
take CvFileStorage
on input and allow user to save or to load hierarchical collections
that consist of scalar values, standard CXCore objects (such as matrices, sequences, graphs) and
user-defined objects.
CXCore can read and write data in XML (http://www.w3c.org/XML)
or YAML (http://www.yaml.org) formats. Below is the example of
3×3 floating-point identity matrix A
, stored in XML and YAML files using CXCore functions:
<?xml version="1.0"> <opencv_storage>  <rows>3</rows> <cols>3</cols>
f
 <data>1. 0. 0. 0. 1. 0. 0. 0. 1.</data>  </opencv_storage>
%YAML:1.0 A: !!opencv-matrix rows: 3 cols: 3 dt: f data: [ 1., 0., 0., 0., 1., 0., 0., 0., 1.]
As it can be seen from the examples, XML uses nested tags to represent hierarchy, while YAML uses indentation for that purpose (similarly to Python programming language).
The same CXCore functions can read and write data in both formats, the particular format is determined by the extension of the opened file, .xml for XML files and .yml or .yaml for YAML.
File Storage Node
/* file node type */ #define CV_NODE_NONE 0 #define CV_NODE_INT 1 #define CV_NODE_INTEGER CV_NODE_INT #define CV_NODE_REAL 2 #define CV_NODE_FLOAT CV_NODE_REAL #define CV_NODE_STR 3 #define CV_NODE_STRING CV_NODE_STR #define CV_NODE_REF 4 /* not used */ #define CV_NODE_SEQ 5 #define CV_NODE_MAP 6 #define CV_NODE_TYPE_MASK 7 /* optional flags */ #define CV_NODE_USER 16 #define CV_NODE_EMPTY 32 #define CV_NODE_NAMED 64 #define CV_NODE_TYPE(tag) ((tag) & CV_NODE_TYPE_MASK) #define CV_NODE_IS_INT(tag) (CV_NODE_TYPE(tag) == CV_NODE_INT) #define CV_NODE_IS_REAL(tag) (CV_NODE_TYPE(tag) == CV_NODE_REAL) #define CV_NODE_IS_STRING(tag) (CV_NODE_TYPE(tag) == CV_NODE_STRING) #define CV_NODE_IS_SEQ(tag) (CV_NODE_TYPE(tag) == CV_NODE_SEQ) #define CV_NODE_IS_MAP(tag) (CV_NODE_TYPE(tag) == CV_NODE_MAP) #define CV_NODE_IS_COLLECTION(tag) (CV_NODE_TYPE(tag) >= CV_NODE_SEQ) #define CV_NODE_IS_FLOW(tag) (((tag) & CV_NODE_FLOW) != 0) #define CV_NODE_IS_EMPTY(tag) (((tag) & CV_NODE_EMPTY) != 0) #define CV_NODE_IS_USER(tag) (((tag) & CV_NODE_USER) != 0) #define CV_NODE_HAS_NAME(tag) (((tag) & CV_NODE_NAMED) != 0) #define CV_NODE_SEQ_SIMPLE 256 #define CV_NODE_SEQ_IS_SIMPLE(seq) (((seq)->flags & CV_NODE_SEQ_SIMPLE) != 0) typedef struct CvString { int len; char* ptr; } CvString; /* all the keys (names) of elements in the readed file storage are stored in the hash to speed up the lookup operations */ typedef struct CvStringHashNode { unsigned hashval; CvString str; struct CvStringHashNode* next; } CvStringHashNode; /* basic element of the file storage - scalar or collection */ typedef struct CvFileNode { int tag; struct CvTypeInfo* info; /* type information (only for user-defined object, for others it is 0) */ union { double f; /* scalar floating-point number */ int i; /* scalar integer number */ CvString str; /* text string */ CvSeq* seq; /* sequence (ordered collection of file nodes) */ struct CvMap* map; /* map (collection of named file nodes) */ } data; } CvFileNode;
The structure is used only for retrieving data from file storage (i.e. for loading data from file). When data is written to file, it is done sequentially, with minimal buffering. No data is stored in the file storage.
In opposite, when data is read from file, the whole file is parsed and represented in memory
as a tree. Every node of the tree is represented by CvFileNode. Type of the file node
N
can be retrieved as CV_NODE_TYPE(N->tag)
. Some file nodes (leaves) are scalars:
text strings, integer or floating-point numbers. Other file nodes are collections of file nodes, which can
be scalars or collections in their turn. There are two types of collections: sequences and maps
(we use YAML notation, however, the same is true for XML streams). Sequences (do not mix them with
CvSeq) are ordered collections of unnamed file nodes,
maps are unordered collections of named file nodes. Thus, elements of sequences are
accessed by index (cvGetSeqElem),
while elements of maps are accessed by name
(cvGetFileNodeByName).
The table below describes the different types of a file node:
| Type | CV_NODE_TYPE(node->tag) | Value |
| Integer | CV_NODE_INT | node->data.i |
| Floating-point | CV_NODE_REAL | node->data.f |
| Text string | CV_NODE_STR | node->data.str.ptr |
| Sequence | CV_NODE_SEQ | node->data.seq |
| Map | CV_NODE_MAP | node->data.map* |
map
field directly (BTW, CvMap
is a hidden structure).
The elements of the map can be retrieved with cvGetFileNodeByName
function that takes pointer to the "map" file node.
A user (custom) object is instance of either one of standard CxCore types, such as CvMat, CvSeq etc., or any type registered with cvRegisterTypeInfo. Such an object is initially represented in file as a map (as shown in XML and YAML sample files above), after file storage has been opened and parsed. Then the object can be decoded (coverted to the native representation) by request - when user calls cvRead or cvReadByName function.
List of attributes
typedef struct CvAttrList { const char** attr; /* NULL-terminated array of (attribute_name,attribute_value) pairs */ struct CvAttrList* next; /* pointer to next chunk of the attributes list */ } CvAttrList; /* initializes CvAttrList structure */ inline CvAttrList cvAttrList( const char** attr=NULL, CvAttrList* next=NULL ); /* returns attribute value or 0 (NULL) if there is no such attribute */ const char* cvAttrValue( const CvAttrList* attr, const char* attr_name );
In the current implementation attributes are used to pass extra parameters when writing user objects
(see cvWrite).
XML attributes inside tags are not supported, besides the object type specification
(type_id
attribute).
Opens file storage for reading or writing data
CvFileStorage* cvOpenFileStorage( const char* filename, CvMemStorage* memstorage, int flags );
CV_STORAGE_READ
- the storage is open for readingCV_STORAGE_WRITE
- the storage is open for writing
The function cvOpenFileStorage
opens file storage for
reading or writing data. In the latter case a new file is created or existing file is
rewritten. Type of the read of written file is determined by the filename extension: .xml
for XML, and .yml
or .yaml
for YAML.
The function returns pointer to CvFileStorage structure.
Releases file storage
void cvReleaseFileStorage( CvFileStorage** fs );
The function cvReleaseFileStorage
closes the file
associated with the storage and releases all the temporary structures.
It must be called after all I/O operations with the storage are finished.
Starts writing a new structure
void cvStartWriteStruct( CvFileStorage* fs, const char* name, int struct_flags, const char* type_name=NULL, CvAttrList attributes=cvAttrList());
CV_NODE_SEQ
- the written structure is a sequence (see discussion of
CvFileStorage), that is,
its elements do not have a name. CV_NODE_MAP
- the written structure is a map (see discussion of
CvFileStorage), that is,
all its elements have names. CV_NODE_FLOW
- the optional flag that has sense only for YAML streams.
It means that the structure is written as a flow (not as a block), which is more
compact. It is recommended to use this flag for structures or arrays whose elements are
all scalars.
type_id
attribute of the structure opening tag. In case of YAML
it is written after a colon following the structure name (see the example in
CvFileStorage description).
Mainly it comes with user objects.
When the storage is read, the encoded type name is used to determine
the object type (see CvTypeInfo and
cvFindTypeInfo).
The function cvStartWriteStruct
starts writing
a compound structure (collection) that can be a sequence or a map. After all the structure
fields, which can be scalars or structures, are written,
cvEndWriteStruct should be called.
The function can be used to group some objects or to implement write function for a
some user object (see CvTypeInfo).
Ends writing a structure
void cvEndWriteStruct( CvFileStorage* fs );
The function cvEndWriteStruct
finishes the
currently written structure.
Writes an integer value
void cvWriteInt( CvFileStorage* fs, const char* name, int value );
The function cvWriteInt
writes a single integer value
(with or without a name) to the file storage.
Writes a floating-point value
void cvWriteReal( CvFileStorage* fs, const char* name, double value );
The function cvWriteReal
writes a single
floating-point value (with or without a name) to the file storage. The special
values are encoded: NaN (Not A Number) as .NaN, ±Infinity as +.Inf (-.Inf).
The following example shows how to use the low-level writing functions to store custom structures, such as termination criteria, without registering a new type.
void write_termcriteria( CvFileStorage* fs, const char* struct_name, CvTermCriteria* termcrit ) { cvStartWriteStruct( fs, struct_name, CV_NODE_MAP, NULL, cvAttrList(0,0)); cvWriteComment( fs, "termination criteria", 1 ); // just a description if( termcrit->type & CV_TERMCRIT_ITER ) cvWriteInteger( fs, "max_iterations", termcrit->max_iter ); if( termcrit->type & CV_TERMCRIT_EPS ) cvWriteReal( fs, "accuracy", termcrit->epsilon ); cvEndWriteStruct( fs ); }
Writes a text string
void cvWriteString( CvFileStorage* fs, const char* name, const char* str, int quote=0 );
The function cvWriteString
writes a text string
to the file storage.
Writes comment
void cvWriteComment( CvFileStorage* fs, const char* comment, int eol_comment );
The function cvWriteComment
writes a comment into the
file storage. The comments are skipped when the storage is read, so they may be
used only for debugging or descriptive purposes.
Starts the next stream
void cvStartNextStream( CvFileStorage* fs );
The function cvStartNextStream
starts the next
stream in the file storage. Both YAML and XML supports multiple "streams". This
is useful for concatenating files or for resuming the writing process.
Writes user object
void cvWrite( CvFileStorage* fs, const char* name, const void* ptr, CvAttrList attributes=cvAttrList() );
The function cvWrite
writes the object to file storage.
First, the appropriate type info is found using cvTypeOf.
Then, write
method of the type info is called.
Attributes are used to customize the writing procedure.
The standard types support the following attributes
(all the *dt
attributes have the same format as in
cvWriteRawData):
header_dt
- description
of user fields of the sequence header that follow CvSeq, or CvChain
(if the sequence is Freeman chain) or CvContour (if the sequence is a contour
or point sequence)
dt
- description of the sequence elements.
recursive
- if the attribute is present and is not equal to "0" or "false",
the whole tree of sequences (contours) is stored.
CvGraph
header_dt
- description of user fields
of the graph header that follow CvGraph;
vertex_dt
- description of
user fields of graph vertices
edge_dt
- description of user fields of graph edges (note, that
edge weight is always written, so there is no need to specify it explicitly)
Below is the code that creates the YAML file shown in CvFileStorage
description:
#include "cxcore.h" int main( int argc, char** argv ) { CvMat* mat = cvCreateMat( 3, 3, CV_32F ); CvFileStorage* fs = cvOpenFileStorage( "example.yml", 0, CV_STORAGE_WRITE ); cvSetIdentity( mat ); cvWrite( fs, "A", mat, cvAttrList(0,0) ); cvReleaseFileStorage( &fs ); cvReleaseMat( &mat ); return 0; }
Writes multiple numbers
void cvWriteRawData( CvFileStorage* fs, const void* src, int len, const char* dt );
([count]{'u'|'c'|'w'|'s'|'i'|'f'|'d'})...
, where the characters
correspond to fundamental C types:
count
is the optional counter of values of the certain type.
For example, dt='2if'
means that each array element is a structure
of 2 integers, followed by a single-precision floating-point number. The equivalent
notations of the above specification are 'iif'
, '2i1f'
etc.
Other examples: dt='u'
means that the array consists of bytes,
dt='2d'
- the array consists of pairs of doubles.
The function cvWriteRawData
writes array,
which elements consist of a single of multiple numbers. The function call can
be replaced with a loop containing a few cvWriteInt
and cvWriteReal calls,
but a single call is more efficient. Note, that because none of the elements
have a name, they should be written to a sequence rather than a map.
Writes file node to another file storage
void cvWriteFileNode( CvFileStorage* fs, const char* new_node_name, const CvFileNode* node, int embed );
cvGetFileNodeName(node)
.
node
are
written into the currently written structure. Of course, map elements may be
written only to map, and sequence elements may be written only to sequence.
The function cvWriteFileNode
writes a copy of file node to file storage. The possible application of the function are:
merging several file storages into one. Conversion between XML and YAML formats etc.
Data are retrieved from file storage in 2 steps:
first, the file node containing the requested data is found;
then, data is extracted from the node manually or using custom read
method.
Retrieves one of top-level nodes of the file storage
CvFileNode* cvGetRootFileNode( const CvFileStorage* fs, int stream_index=0 );
The function cvGetRootFileNode
returns
one of top-level file nodes. The top-level nodes do not have a name, they correspond to
the streams, that are stored one after another in the file storage.
If the index is out of range, the function returns NULL pointer, so all the top-level
nodes may be iterated by subsequent calls to the function with stream_index=0,1,...
,
until NULL pointer is returned. This function may be used as a base for recursive traversal of the
file storage.
Finds node in the map or file storage
CvFileNode* cvGetFileNodeByName( const CvFileStorage* fs, const CvFileNode* map, const char* name );
The function cvGetFileNodeByName
finds
a file node by name
. The node is searched either in map
or, if the pointer is NULL, among the top-level file nodes of the storage.
Using this function for maps and cvGetSeqElem
(or sequence reader) for sequences, it is possible to nagivate through the file storage.
To speed up multiple queries for a certain key (e.g. in case of array of structures)
one may use a pair of cvGetHashedKey and
cvGetFileNode.
Returns a unique pointer for given name
CvStringHashNode* cvGetHashedKey( CvFileStorage* fs, const char* name, int len=-1, int create_missing=0 );
The function cvGetHashedKey
returns
the unique pointer for each particular file node name. This pointer can be
then passed to cvGetFileNode function that
is faster than cvGetFileNodeByName
because it compares text strings by comparing pointers rather than the
strings' content.
Consider the following example: an array of points is encoded as a sequence of 2-entry maps, e.g.:
%YAML:1.0 points: - { x: 10, y: 10 } - { x: 20, y: 20 } - { x: 30, y: 30 } # ...Then, it is possible to get hashed "x" and "y" pointers to speed up decoding of the points.
#include "cxcore.h" int main( int argc, char** argv ) { CvFileStorage* fs = cvOpenFileStorage( "points.yml", 0, CV_STORAGE_READ ); CvStringHashNode* x_key = cvGetHashedNode( fs, "x", -1, 1 ); CvStringHashNode* y_key = cvGetHashedNode( fs, "y", -1, 1 ); CvFileNode* points = cvGetFileNodeByName( fs, 0, "points" ); if( CV_NODE_IS_SEQ(points->tag) ) { CvSeq* seq = points->data.seq; int i, total = seq->total; CvSeqReader reader; cvStartReadSeq( seq, &reader, 0 ); for( i = 0; i < total; i++ ) { CvFileNode* pt = (CvFileNode*)reader.ptr; #if 1 /* faster variant */ CvFileNode* xnode = cvGetFileNode( fs, pt, x_key, 0 ); CvFileNode* ynode = cvGetFileNode( fs, pt, y_key, 0 ); assert( xnode && CV_NODE_IS_INT(xnode->tag) && ynode && CV_NODE_IS_INT(ynode->tag)); int x = xnode->data.i; // or x = cvReadInt( xnode, 0 ); int y = ynode->data.i; // or y = cvReadInt( ynode, 0 ); #elif 1 /* slower variant; does not use x_key & y_key */ CvFileNode* xnode = cvGetFileNodeByName( fs, pt, "x" ); CvFileNode* ynode = cvGetFileNodeByName( fs, pt, "y" ); assert( xnode && CV_NODE_IS_INT(xnode->tag) && ynode && CV_NODE_IS_INT(ynode->tag)); int x = xnode->data.i; // or x = cvReadInt( xnode, 0 ); int y = ynode->data.i; // or y = cvReadInt( ynode, 0 ); #else /* the slowest yet the easiest to use variant */ int x = cvReadIntByName( fs, pt, "x", 0 /* default value */ ); int y = cvReadIntByName( fs, pt, "y", 0 /* default value */ ); #endif CV_NEXT_SEQ_ELEM( seq->elem_size, reader ); printf("%d: (%d, %d)\n", i, x, y ); } } cvReleaseFileStorage( &fs ); return 0; }
Please note that, whatever method of accessing map you are using, it is still much slower than using plain sequences, for example, in the above sample, it is more efficient to encode the points as pairs of integers in the single numeric sequence.
Finds node in the map or file storage
CvFileNode* cvGetFileNode( CvFileStorage* fs, CvFileNode* map, const CvStringHashNode* key, int create_missing=0 );
map
and key
are NULLs,
the function returns the root file node - a map
that contains top-level nodes.
The function cvGetFileNode
finds a file node. It is
a faster version cvGetFileNodeByName
(see cvGetHashedKey discussion). Also,
the function can insert a new node, if it is not in the map yet (which is used
by parsing functions).
Returns name of file node
const char* cvGetFileNodeName( const CvFileNode* node );
The function cvGetFileNodeName
returns name of the file node
or NULL, if the file node does not have a name, or if node
is NULL
.
Retrieves integer value from file node
int cvReadInt( const CvFileNode* node, int default_value=0 );
node
is NULL.
The function cvReadInt
returns integer that is
represented by the file node. If the file node is NULL, default_value
is returned (thus, it is convenient to call the function right after
cvGetFileNode without checking for NULL pointer),
otherwise if the file node has type CV_NODE_INT
,
then node->data.i
is returned, otherwise if the file node has
type CV_NODE_REAL
, then node->data.f
is converted to integer and returned, otherwise the result is not determined.
Finds file node and returns its value
int cvReadIntByName( const CvFileStorage* fs, const CvFileNode* map, const char* name, int default_value=0 );
The function cvReadIntByName
is a simple
superposition of cvGetFileNodeByName and
cvReadInt.
Retrieves floating-point value from file node
double cvReadReal( const CvFileNode* node, double default_value=0. );
node
is NULL.
The function cvReadReal
returns floating-point value that is
represented by the file node. If the file node is NULL, default_value
is returned (thus, it is convenient to call the function right after
cvGetFileNode without checking for NULL pointer),
otherwise if the file node has type CV_NODE_REAL
,
then node->data.f
is returned, otherwise if the file node has
type CV_NODE_INT
, then node->data.f
is converted to floating-point and returned, otherwise the result is not determined.
Finds file node and returns its value
double cvReadRealByName( const CvFileStorage* fs, const CvFileNode* map, const char* name, double default_value=0. );
The function cvReadRealByName
is a simple
superposition of cvGetFileNodeByName and
cvReadReal.
Retrieves text string from file node
const char* cvReadString( const CvFileNode* node, const char* default_value=NULL );
node
is NULL.
The function cvReadString
returns text string that is
represented by the file node. If the file node is NULL, default_value
is returned (thus, it is convenient to call the function right after
cvGetFileNode without checking for NULL pointer),
otherwise if the file node has type CV_NODE_STR
,
then node->data.str.ptr
is returned, otherwise the result is not determined.
Finds file node and returns its value
const char* cvReadStringByName( const CvFileStorage* fs, const CvFileNode* map, const char* name, const char* default_value=NULL );
The function cvReadStringByName
is a simple
superposition of cvGetFileNodeByName and
cvReadString.
Decodes object and returns pointer to it
void* cvRead( CvFileStorage* fs, CvFileNode* node, CvAttrList* attributes=NULL );
The function cvRead
decodes user object (creates object
in a native representation from the file storage subtree) and returns it.
The object to be decoded must be an instance of registered type that supports read
method (see CvTypeInfo). Type of the object is determined by
the type name that is encoded in the file. If the object is dynamic structure, it is
created either in memory storage, passed to cvOpenFileStorage
or, if NULL pointer was passed, in temporary memory storage, which is release when
cvReleaseFileStorage is called.
Otherwise, if the object is not a dynamic structure, it is created in heap and should be
released with a specialized function or using generic cvRelease.
Finds object and decodes it
void* cvReadByName( CvFileStorage* fs, const CvFileNode* map, const char* name, CvAttrList* attributes=NULL );
The function cvReadByName
is a simple
superposition of cvGetFileNodeByName and
cvRead.
Reads multiple numbers
void cvReadRawData( const CvFileStorage* fs, const CvFileNode* src, void* dst, const char* dt );
The function cvReadRawData
reads elements
from a file node that represents a sequence of scalars
Initializes file node sequence reader
void cvStartReadRawData( const CvFileStorage* fs, const CvFileNode* src, CvSeqReader* reader );
The function cvStartReadRawData
initializes
sequence reader to read data from file node. The initialized reader can be then
passed to cvReadRawDataSlice.
Initializes file node sequence reader
void cvReadRawDataSlice( const CvFileStorage* fs, CvSeqReader* reader, int count, void* dst, const char* dt );
The function cvReadRawDataSlice
reads one
or more elements from the file node, representing a sequence, to user-specified
array. The total number of read sequence elements is a product of total
and the number of components in each array element.
For example, if dt='2if'
, the function will read total*3
sequence elements.
As with any sequence, some parts of the file node sequence may be skipped or read repeatedly
by repositioning the reader using cvSetSeqReaderPos.
Type information
typedef int (CV_CDECL *CvIsInstanceFunc)( const void* struct_ptr ); typedef void (CV_CDECL *CvReleaseFunc)( void** struct_dblptr ); typedef void* (CV_CDECL *CvReadFunc)( CvFileStorage* storage, CvFileNode* node ); typedef void (CV_CDECL *CvWriteFunc)( CvFileStorage* storage, const char* name, const void* struct_ptr, CvAttrList attributes ); typedef void* (CV_CDECL *CvCloneFunc)( const void* struct_ptr ); typedef struct CvTypeInfo { int flags; /* not used */ int header_size; /* sizeof(CvTypeInfo) */ struct CvTypeInfo* prev; /* previous registered type in the list */ struct CvTypeInfo* next; /* next registered type in the list */ const char* type_name; /* type name, written to file storage */ /* methods */ CvIsInstanceFunc is_instance; /* checks if the passed object belongs to the type */ CvReleaseFunc release; /* releases object (memory etc.) */ CvReadFunc read; /* reads object from file storage */ CvWriteFunc write; /* writes object to file storage */ CvCloneFunc clone; /* creates a copy of the object */ } CvTypeInfo;
The structure CvTypeInfo contains information about one of standard or user-defined types. Instances of the type may or may not contain pointer to the corresponding CvTypeInfo structure. In any case there is a way to find type info structure for given object - using cvTypeOf function. Aternatively, type info can be found by the type name using cvFindType, which is used when object is read from file storage. User can register a new type with cvRegisterType that adds the type information structure into the beginning of the type list - thus, it is possible to create specialized types from generic standard types and override the basic methods.
Registers new type
void cvRegisterType( const CvTypeInfo* info );
The function cvRegisterType
registers a new type,
which is described by info
. The function creates a copy of the structure,
so user should delete it after calling the function.
Unregisters the type
void cvUnregisterType( const char* type_name );
The function cvUnregisterType
unregisters the type
with the specified name. If the name is unknown, it is possible to locate the type info
by an instance of the type using cvTypeOf or by iterating
the type list, starting from cvFirstType, and then
call cvUnregisterType(info->type_name)
.
Returns the beginning of type list
CvTypeInfo* cvFirstType( void );
The function cvFirstType
returns the first type of the list
of registered types. Navigation through the list can be done via prev
and next
fields of CvTypeInfo structure.
Finds type by its name
CvTypeInfo* cvFindType( const char* type_name );
The function cvFindType
finds a registered type by its name.
It returns NULL, if there is no type with the specified name.
Returns type of the object
CvTypeInfo* cvTypeOf( const void* struct_ptr );
The function cvTypeOf
finds the type of given object. It iterates through the list
of registered types and calls is_instance
function/method of every type info structure with
the object until one of them return non-zero or until the whole list has been traversed. In the latter
case the function returns NULL.
Releases the object
void cvRelease( void** struct_ptr );
The function cvRelease
finds the type of given object and calls
release
with the double pointer.
Makes a clone of the object
void* cvClone( const void* struct_ptr );
The function cvClone
finds the type of given object and calls
clone
with the passed object.
Saves object to file
void cvSave( const char* filename, const void* struct_ptr, const char* name=NULL, const char* comment=NULL, CvAttrList attributes=cvAttrList());
filename
.
The function cvSave
saves object to file. It provides a simple interface
to cvWrite.
Loads object from file
void* cvLoad( const char* filename, CvMemStorage* memstorage=NULL, const char* name=NULL, const char** real_name=NULL );
name=NULL
).
The function cvLoad
loads object from file.
It provides a simple interface to cvRead.
After object is loaded,
the file storage is closed and all the temporary buffers are deleted. Thus, to load a dynamic structure,
such as sequence, contour or graph, one should pass a valid destination
memory storage to the function.
Checks every element of input array for invalid values
int cvCheckArr( const CvArr* arr, int flags=0, double min_val=0, double max_val=0); #define cvCheckArray cvCheckArr
CV_CHECK_RANGE
- if set, the function checks that every value of
array is within [minVal,maxVal) range,
otherwise it just checks that every element
is neigther NaN nor ±Infinity.CV_CHECK_QUIET
- if set, the function does not raises an
error if an element is invalid or out of range
CV_CHECK_RANGE
is set.
CV_CHECK_RANGE
is set.
The function cvCheckArr
checks that every array element
is neither NaN nor ±Infinity.
If CV_CHECK_RANGE
is set, it also checks that every element is
greater than or equal to minVal
and less than maxVal
.
The function returns nonzero if the check succeeded, i.e. all elements
are valid and within the range, and zero otherwise.
In the latter case if CV_CHECK_QUIET
flag is not set, the function
raises runtime error.
Splits set of vectors by given number of clusters
void cvKMeans2( const CvArr* samples, int cluster_count, CvArr* labels, CvTermCriteria termcrit );
The function cvKMeans2
implements k-means algorithm that finds centers of cluster_count
clusters
and groups the input samples around the clusters. On output labels(i)
contains a cluster index
for sample stored in the i-th row of samples
matrix.
#include "cxcore.h" #include "highgui.h" void main( int argc, char** argv ) { #define MAX_CLUSTERS 5 CvScalar color_tab[MAX_CLUSTERS]; IplImage* img = cvCreateImage( cvSize( 500, 500 ), 8, 3 ); CvRNG rng = cvRNG(0xffffffff); color_tab[0] = CV_RGB(255,0,0); color_tab[1] = CV_RGB(0,255,0); color_tab[2] = CV_RGB(100,100,255); color_tab[3] = CV_RGB(255,0,255); color_tab[4] = CV_RGB(255,255,0); cvNamedWindow( "clusters", 1 ); for(;;) { int k, cluster_count = cvRandInt(&rng)%MAX_CLUSTERS + 1; int i, sample_count = cvRandInt(&rng)%1000 + 1; CvMat* points = cvCreateMat( sample_count, 1, CV_32FC2 ); CvMat* clusters = cvCreateMat( sample_count, 1, CV_32SC1 ); /* generate random sample from multigaussian distribution */ for( k = 0; k < cluster_count; k++ ) { CvPoint center; CvMat point_chunk; center.x = cvRandInt(&rng)%img->width; center.y = cvRandInt(&rng)%img->height; cvGetRows( points, &point_chunk, k*sample_count/cluster_count, k == cluster_count - 1 ? sample_count : (k+1)*sample_count/cluster_count ); cvRandArr( &rng, &point_chunk, CV_RAND_NORMAL, cvScalar(center.x,center.y,0,0), cvScalar(img->width/6, img->height/6,0,0) ); } /* shuffle samples */ for( i = 0; i < sample_count/2; i++ ) { CvPoint2D32f* pt1 = (CvPoint2D32f*)points->data.fl + cvRandInt(&rng)%sample_count; CvPoint2D32f* pt2 = (CvPoint2D32f*)points->data.fl + cvRandInt(&rng)%sample_count; CvPoint2D32f temp; CV_SWAP( *pt1, *pt2, temp ); } cvKMeans2( points, cluster_count, clusters, cvTermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0 )); cvZero( img ); for( i = 0; i < sample_count; i++ ) { CvPoint2D32f pt = ((CvPoint2D32f*)points->data.fl)[i]; int cluster_idx = clusters->data.i[i]; cvCircle( img, cvPointFrom32f(pt), 2, color_tab[cluster_idx], CV_FILLED ); } cvReleaseMat( &points ); cvReleaseMat( &clusters ); cvShowImage( "clusters", img ); int key = cvWaitKey(0); if( key == 27 ) // 'ESC' break; } }
Splits sequence into equivalency classes
typedef int (CV_CDECL* CvCmpFunc)(const void* a, const void* b, void* userdata); int cvSeqPartition( const CvSeq* seq, CvMemStorage* storage, CvSeq** labels, CvCmpFunc is_equal, void* userdata );
seq->storage
for output labels.
is_equal
function.
The function cvSeqPartition
implements quadratic algorithm for splitting
a set into one or more classes of equivalency. The function returns the number of equivalency classes.
#include "cxcore.h" #include "highgui.h" #include <stdio.h> CvSeq* point_seq = 0; IplImage* canvas = 0; CvScalar* colors = 0; int pos = 10; int is_equal( const void* _a, const void* _b, void* userdata ) { CvPoint a = *(const CvPoint*)_a; CvPoint b = *(const CvPoint*)_b; double threshold = *(double*)userdata; return (double)(a.x - b.x)*(a.x - b.x) + (double)(a.y - b.y)*(a.y - b.y) <= threshold; } void on_track( int pos ) { CvSeq* labels = 0; double threshold = pos*pos; int i, class_count = cvSeqPartition( point_seq, 0, &labels, is_equal, &threshold ); printf("%4d classes\n", class_count ); cvZero( canvas ); for( i = 0; i < labels->total; i++ ) { CvPoint pt = *(CvPoint*)cvGetSeqElem( point_seq, i, 0 ); CvScalar color = colors[*(int*)cvGetSeqElem( labels, i, 0 )]; cvCircle( canvas, pt, 1, color, -1 ); } cvShowImage( "points", canvas ); } int main( int argc, char** argv ) { CvMemStorage* storage = cvCreateMemStorage(0); point_seq = cvCreateSeq( CV_32SC2, sizeof(CvSeq), sizeof(CvPoint), storage ); CvRNG rng = cvRNG(0xffffffff); int width = 500, height = 500; int i, count = 1000; canvas = cvCreateImage( cvSize(width,height), 8, 3 ); colors = (CvScalar*)cvAlloc( count*sizeof(colors[0]) ); for( i = 0; i < count; i++ ) { CvPoint pt; int icolor; pt.x = cvRandInt( &rng ) % width; pt.y = cvRandInt( &rng ) % height; cvSeqPush( point_seq, &pt ); icolor = cvRandInt( &rng ) | 0x00404040; colors[i] = CV_RGB(icolor & 255, (icolor >> 8)&255, (icolor >> 16)&255); } cvNamedWindow( "points", 1 ); cvCreateTrackbar( "threshold", "points", &pos, 50, on_track ); on_track(pos); cvWaitKey(0); return 0; }
Error handling in OpenCV is similar to IPL (Image Processing Library). In case of error functions do not return the error code. Instead, they raise an error using CV_ERROR macro that calls cvError that, in its turn, sets the error status with cvSetErrStatus and calls a standard or user-defined error handler (that can display a message box, write to log etc., see cvRedirectError, cvNulDevReport, cvStdErrReport, cvGuiBoxReport). There is global variable, one per each program thread, that contains current error status (an integer value). The status can be retrieved with cvGetErrStatus function.
There are three modes of error handling (see cvSetErrMode and cvGetErrMode):
Actually, the semantics of Leaf and Parent modes is implemented by error handlers and the above description is true for cvNulDevReport, cvStdErrReport. cvGuiBoxReport behaves slightly differently, and some custom error handler may implement quite different semantics.
Macros for raising an error, checking for errors etc.
/* special macros for enclosing processing statements within a function and separating them from prologue (resource initialization) and epilogue (guaranteed resource release) */ #define __BEGIN__ { #define __END__ goto exit; exit: ; } /* proceeds to "resource release" stage */ #define EXIT goto exit /* Declares locally the function name for CV_ERROR() use */ #define CV_FUNCNAME( Name ) \ static char cvFuncName[] = Name /* Raises an error within the current context */ #define CV_ERROR( Code, Msg ) \ { \ cvError( (Code), cvFuncName, Msg, __FILE__, __LINE__ ); \ EXIT; \ } /* Checks status after calling CXCORE function */ #define CV_CHECK() \ { \ if( cvGetErrStatus() < 0 ) \ CV_ERROR( CV_StsBackTrace, "Inner function failed." ); \ } /* Provies shorthand for CXCORE function call and CV_CHECK() */ #define CV_CALL( Statement ) \ { \ Statement; \ CV_CHECK(); \ } /* Checks some condition in both debug and release configurations */ #define CV_ASSERT( Condition ) \ { \ if( !(Condition) ) \ CV_ERROR( CV_StsInternal, "Assertion: " #Condition " failed" ); \ } /* these macros are similar to their CV_... counterparts, but they do not need exit label nor cvFuncName to be defined */ #define OPENCV_ERROR(status,func_name,err_msg) ... #define OPENCV_ERRCHK(func_name,err_msg) ... #define OPENCV_ASSERT(condition,func_name,err_msg) ... #define OPENCV_CALL(statement) ...Instead of a discussion, here are the documented example of typical CXCORE function and the example of the function use.
#include "cxcore.h" #include <stdio.h> void cvResizeDCT( CvMat* input_array, CvMat* output_array ) { CvMat* temp_array = 0; // declare pointer that should be released anyway. CV_FUNCNAME( "cvResizeDCT" ); // declare cvFuncName __BEGIN__; // start processing. There may be some declarations just after this macro, // but they couldn't be accessed from the epilogue. if( !CV_IS_MAT(input_array) || !CV_IS_MAT(output_array) ) // use CV_ERROR() to raise an error CV_ERROR( CV_StsBadArg, "input_array or output_array are not valid matrices" ); // some restrictions that are going to be removed later, may be checked with CV_ASSERT() CV_ASSERT( input_array->rows == 1 && output_array->rows == 1 ); // use CV_CALL for safe function call CV_CALL( temp_array = cvCreateMat( input_array->rows, MAX(input_array->cols,output_array->cols), input_array->type )); if( output_array->cols > input_array->cols ) CV_CALL( cvZero( temp_array )); temp_array->cols = input_array->cols; CV_CALL( cvDCT( input_array, temp_array, CV_DXT_FORWARD )); temp_array->cols = output_array->cols; CV_CALL( cvDCT( temp_array, output_array, CV_DXT_INVERSE )); CV_CALL( cvScale( output_array, output_array, 1./sqrt((double)input_array->cols*output_array->cols), 0 )); __END__; // finish processing. Epilogue follows after the macro. // release temp_array. If temp_array has not been allocated before an error occured, cvReleaseMat // takes care of it and does nothing in this case. cvReleaseMat( &temp_array ); } int main( int argc, char** argv ) { CvMat* src = cvCreateMat( 1, 512, CV_32F ); #if 1 /* no errors */ CvMat* dst = cvCreateMat( 1, 256, CV_32F ); #else CvMat* dst = 0; /* test error processing mechanism */ #endif cvSet( src, cvRealScalar(1.), 0 ); #if 0 /* change 0 to 1 to suppress error handler invocation */ cvSetErrMode( CV_ErrModeSilent ); #endif cvResizeDCT( src, dst ); // if some error occurs, the message box will popup, or a message will be // written to log, or some user-defined processing will be done if( cvGetErrStatus() < 0 ) printf("Some error occured" ); else printf("Everything is OK" ); return 0; }
Returns the current error status
int cvGetErrStatus( void );
The function cvGetErrStatus
returns the current error status -
the value set with the last cvSetErrStatus call. Note, that
in Leaf mode the program terminates immediately after error occured, so to
always get control after the function call, one should call cvSetErrMode
and set Parent or Silent error mode.
Sets the error status
void cvSetErrStatus( int status );
The function cvSetErrStatus
sets the error status to
the specified value. Mostly, the function is used to reset the error status (set to it CV_StsOk
)
to recover after error. In other cases it is more natural to call cvError or
CV_ERROR.
Returns the current error mode
int cvGetErrMode( void );
The function cvGetErrMode
returns the current error mode -
the value set with the last cvSetErrMode call.
Sets the error mode
#define CV_ErrModeLeaf 0 #define CV_ErrModeParent 1 #define CV_ErrModeSilent 2 int cvSetErrMode( int mode );
The function cvSetErrMode
sets the specified error mode.
For description of different error modes see the beginning of the section.
Raises an error
int cvError( int status, const char* func_name, const char* err_msg, const char* file_name, int line );
The function cvError
sets the error status
to the specified value (via cvSetErrStatus)
and, if the error mode is not Silent, calls the error handler.
Returns textual description of error status code
const char* cvErrorStr( int status );
The function cvErrorStr
returns the textual description
for the specified error status code. In case of unknown status the function returns NULL pointer.
Sets a new error handler
typedef int (CV_CDECL *CvErrorCallback)( int status, const char* func_name, const char* err_msg, const char* file_name, int line ); CvErrorCallback cvRedirectError( CvErrorCallback error_handler, void* userdata=NULL, void** prev_userdata=NULL );
The function cvRedirectError
sets a new error handler that
can be one of standard handlers or a custom handler that has
the certain interface. The handler takes the same parameters as cvError
function. If the handler returns non-zero value, the program is terminated, otherwise, it continues.
The error handler may check the current error mode with cvGetErrMode
to make a decision.
Provide standard error handling
int cvNulDevReport( int status, const char* func_name, const char* err_msg, const char* file_name, int line, void* userdata ); int cvStdErrReport( int status, const char* func_name, const char* err_msg, const char* file_name, int line, void* userdata ); int cvGuiBoxReport( int status, const char* func_name, const char* err_msg, const char* file_name, int line, void* userdata );
The functions cvNullDevReport, cvStdErrReport
and cvGuiBoxReport
provide standard error handling. cvGuiBoxReport
is the default
error handler on Win32 systems, cvStdErrReport
- on other systems.
cvGuiBoxReport
pops up message box with the error description and
suggest a few options. Below is the sample message box that may be recieved with the
sample code above, if one introduce an error as described
in the sample
If the error handler is set
cvStdErrReport
, the above message will
be printed to standard error output and program will be terminated or continued, depending on the
current error mode.
OpenCV ERROR: Bad argument (input_array or output_array are not valid matrices) in function cvResizeDCT, D:\User\VP\Projects\avl_proba\a.cpp(75) Terminating the application...
Allocates memory buffer
void* cvAlloc( size_t size );
The function cvAlloc
allocates size
bytes and
returns pointer to the allocated buffer. In case of error
the function reports an error and returns NULL pointer.
By default cvAlloc calls icvAlloc which itself calls malloc,
however it is possible to assign user-defined memory allocation/deallocation
functions using cvSetMemoryManager function.
Deallocates memory buffer
void cvFree( T** ptr );
The function cvFree
deallocates memory buffer allocated by cvAlloc.
It clears the pointer to buffer upon exit, that is why the double pointer is
used. If *buffer is already NULL, the function does nothing
Returns number of tics
int64 cvGetTickCount( void );
The function cvGetTickCount
returns number of tics
starting from some platform-dependent event (number of CPU ticks from the startup, number of milliseconds
from 1970th year etc.). The function is useful for accurate measurement of
a function/user-code execution time. To convert the number of tics to time units, use
cvGetTickFrequency.
Returns number of tics per microsecond
double cvGetTickFrequency( void );
The function cvGetTickFrequency
returns number of tics
per microsecond. Thus, the quotient of cvGetTickCount() and
cvGetTickFrequency() will give a number of microseconds
starting from the platform-dependent event.
Registers another module
typedef struct CvPluginFuncInfo { void** func_addr; void* default_func_addr; const char* func_names; int search_modules; int loaded_from; } CvPluginFuncInfo; typedef struct CvModuleInfo { struct CvModuleInfo* next; const char* name; const char* version; CvPluginFuncInfo* func_tab; } CvModuleInfo; int cvRegisterModule( const CvModuleInfo* module_info );
The function cvRegisterModule
adds module to the list of registered
modules. After the module is registered, information about it can be retrieved
using cvGetModuleInfo function. Also, the registered module
makes full use of optimized plugins (IPP, MKL, ...), supported by CXCORE.
CXCORE itself, CV (computer vision), CVAUX (auxilary computer vision) and HIGHGUI
(visualization & image/video acquisition) are examples of modules. Registration is usually done
then the shared library is loaded. See cxcore/src/cxswitcher.cpp and cv/src/cvswitcher.cpp
for details, how registration is done and
look at cxcore/src/cxswitcher.cpp, cxcore/src/_cxipp.h on how IPP and MKL are connected to the modules.
Retrieves information about the registered module(s) and plugins
void cvGetModuleInfo( const char* module_name, const char** version, const char** loaded_addon_plugins );
The function cvGetModuleInfo
returns information about one of
or all of the registered modules. The returned information is stored inside the libraries, so
user should not deallocate or modify the returned text strings.
Switches between optimized/non-optimized modes
int cvUseOptimized( int on_off );
The function cvUseOptimized
switches between the mode, where
only pure C implementations from cxcore, OpenCV etc. are used, and the mode, where
IPP and MKL functions are used if available. When cvUseOptimized(0)
is called,
all the optimized libraries are unloaded. The function may be useful for debugging, IPP&MKL upgrade
on the fly, online speed comparisons etc. It returns the number of optimized functions loaded.
Note that by default the optimized plugins are loaded, so it is not necessary to
call cvUseOptimized(1)
in the beginning of the program (actually, it will only
increase the startup time)
Assings custom/default memory managing functions
typedef void* (CV_CDECL *CvAllocFunc)(size_t size, void* userdata); typedef int (CV_CDECL *CvFreeFunc)(void* pptr, void* userdata); void cvSetMemoryManager( CvAllocFunc alloc_func=NULL, CvFreeFunc free_func=NULL, void* userdata=NULL );
malloc
, except that userdata
may be used to determine the context.
free
.
The function cvSetMemoryManager
sets user-defined memory managment functions (substitutors for malloc and free) that
will be called by cvAlloc, cvFree and higher-level functions (e.g. cvCreateImage).
Note, that the function should be called when there is data allocated using cvAlloc.
Also, to avoid infinite recursive calls, it is not allowed to call cvAlloc
and cvFree from the custom allocation/deallocation functions.
If alloc_func
and free_func
pointers are NULL
,
the default memory managing functions are restored.
Switches to IPL functions for image allocation/deallocation
typedef IplImage* (CV_STDCALL* Cv_iplCreateImageHeader) (int,int,int,char*,char*,int,int,int,int,int, IplROI*,IplImage*,void*,IplTileInfo*); typedef void (CV_STDCALL* Cv_iplAllocateImageData)(IplImage*,int,int); typedef void (CV_STDCALL* Cv_iplDeallocate)(IplImage*,int); typedef IplROI* (CV_STDCALL* Cv_iplCreateROI)(int,int,int,int,int); typedef IplImage* (CV_STDCALL* Cv_iplCloneImage)(const IplImage*); void cvSetIPLAllocators( Cv_iplCreateImageHeader create_header, Cv_iplAllocateImageData allocate_data, Cv_iplDeallocate deallocate, Cv_iplCreateROI create_roi, Cv_iplCloneImage clone_image ); #define CV_TURN_ON_IPL_COMPATIBILITY() \ cvSetIPLAllocators( iplCreateImageHeader, iplAllocateImage, \ iplDeallocate, iplCreateROI, iplCloneImage )
The function cvSetIPLAllocators
makes CXCORE to use IPL functions for image allocation/deallocation operations.
For convenience, there is the wrapping macro CV_TURN_ON_IPL_COMPATIBILITY
.
The function is useful for applications where IPL and CXCORE/OpenCV are used together and still
there are calls to iplCreateImageHeader
etc. The function is not necessary if
IPL is called only for data processing and all the allocation/deallocation is done by CXCORE,
or if all the allocation/deallocation is done by IPL and some of OpenCV functions are used to
process the data.
Returns the current number of threads used
int cvGetNumThreads(void);
The function cvGetNumThreads
return the current number of threads
that are used by parallelized (via OpenMP) OpenCV functions.
Sets the number of threads
void cvSetNumThreads( int threads=0 );
The function cvSetNumThreads
sets the number of threads
that are used by parallelized OpenCV functions. When the argument
is zero or negative, and at the beginning of the program,
the number of threads is set to the number of processors in the system,
as returned by the function omp_get_num_procs()
from OpenMP runtime.
Returns index of the current thread
int cvGetThreadNum( void );
The function cvGetThreadNum
returns the index, from 0 to
cvGetNumThreads()-1, of the thread that called the function.
It is a wrapper for the function omp_get_thread_num()
from OpenMP runtime.
The retrieved index may be used to access local-thread data inside the parallelized code fragments.
| AbsDiff | AddWeighted | Avg |
| AbsDiffS | Alloc | AvgSdv |
| Add | And | |
| AddS | AndS |
| BackProjectPCA |
| DCT | Det | DrawContours |
| DFT | Div | |
| DecRefData | DotProduct |
| EigenVV | EllipseBox | Error |
| Ellipse | EndWriteSeq | ErrorStr |
| Ellipse2Poly | EndWriteStruct | Exp |
| FastArctan | FindGraphEdgeByPtr | FlushSeqWriter |
| FillConvexPoly | FindType | Free |
| FillPoly | FirstType | |
| FindGraphEdge | Flip |
| InRange | InitLineIterator | InsertNodeIntoTree |
| InRangeS | InitMatHeader | InvSqrt |
| IncRefData | InitMatNDHeader | Invert |
| InitFont | InitSparseMatIterator | IsInf |
| InitImageHeader | InitTreeNodeIterator | IsNaN |
| KMeans2 |
| LUT | Load | |
| Line | Log |
| Mahalonobis | MemStorageAlloc | MinS |
| MakeSeqHeaderForArray | MemStorageAllocString | MixChannels |
| Mat | Merge | Mul |
| Max | Min | MulSpectrums |
| MaxS | MinMaxLoc | MulTransposed |
| NextGraphItem | Norm | Not |
| NextTreeNode | Normalize | NulDevReport |
| OpenFileStorage | Or | OrS |
| PerspectiveTransform | Pow | Ptr*D |
| PolarToCart | PrevTreeNode | PutText |
| PolyLine | ProjectPCA |
| Trace | Transpose | TypeOf |
| Transform | TreeToNodeSeq |
| UnregisterType | UseOptimized |
| Write | WriteInt | WriteString |
| WriteComment | WriteRawData | |
| WriteFileNode | WriteReal |
| Xor | XorS |


Custom Weighting Schemes¶
You can also implement your own weighting scheme, provided it can be expressed in the form of a sum over the matching terms, plus an extra term which depends on term-independent statistics (such as the normalised document length).
Currently it is only possible to implement custom weighting schemes in C++.
The API could probably be wrapped with a bit of effort, but performance is
likely to be disappointing as the get_sumpart()
method
gets called a lot (approximately once per matching term in each considered
document), so the overhead of routing a method call from C++ to the wrapped
language will matter.
For example, here’s an implementation of “coordinate matching” - each matching term scores one point:
class CoordinateWeight : public Xapian::Weight {
public:
CoordinateWeight * clone() const { return new CoordinateWeight; }
CoordinateWeight() { }
~CoordinateWeight() { }
std::string name() const { return "Coord"; }
std::string serialise() const { return std::string(); }
CoordinateWeight * unserialise(const std::string &) const {
return new CoordinateWeight;
}
double get_sumpart(Xapian::termcount, Xapian::doclength) const {
return 1;
}
double get_maxpart() const { return 1; }
double get_sumextra(Xapian::doclength) const { return 0; }
double get_maxextra() const { return 0; }
bool get_sumpart_needs_doclength() const { return false; }
};
Implement a custom weighting scheme that requires various statistics¶
The Coordinate scheme given above does not require any statistics. However, custom weighting schemes that require various statistics such as average document length in the database, the query length, total number of documents in the collection etc. can also be implemented.
For that, the weighting scheme subclassed from Xapian::Weight
simply needs
to “tell” Xapian::Weight
which statistics it will be needing. This is done by
calling the need_stat(STATISTIC REQUIRED)
method in the
constructor of the subclassed weighting scheme. Note however, that only those
statistics which are absolutely required must be asked for as collecting
statistics is expensive. For a full list of statistics currently available
from Xapian::Weight
and the enumerators required to access them, please
refer to the API documentation.
Todo
Sort out doxygen visibility of protected stat_flags so the link above can be to the apidocs
The statistics can then be obtained by the subclass by simply calling the
corresponding function of the Xapian::Weight
class. For eg:- The document
frequency (Term frequency) of the term can be obtained by calling
get_termfreq()
. For a full list of functions required to
obtain various statistics, refer to
the xapian/weight.h header file.
Example:- Consider a simple weighting scheme such as a pseudo Tf-Idf weighting scheme which returns the document weight as the product of the within document frequency of the term and the inverse of the document frequency of the term (Inverse of the number of documents the term appears in).
The implementation will be as follows:
class TfIdfWeight : public Xapian::Weight {
public:
TfIdfWeight * clone() const { return new TfIdfWeight; }
TfIdfWeight() {
need_stat(WDF);
need_stat(TERMFREQ);
need_stat(WDF_MAX);
}
~TfIdfWeight() { }
std::string name() const { return "TfIdf"; }
std::string serialise() const { return std::string(); }
TfIdfWeight * unserialise(const std::string &) const {
return new TfIdfWeight;
}
double get_sumpart(Xapian::termcount wdf, Xapian::doclength) const {
Xapian::doccount df = get_termfreq();
double wdf_double(wdf);
double wt = wdf_double / df;
return wt;
}
double get_maxpart() const {
Xapian::doccount df = get_termfreq();
double max_wdf(get_wdf_upper_bound());
double max_weight = max_wdf / df;
return max_weight;
}
double get_sumextra(Xapian::doclength) const { return 0; }
double get_maxextra() const { return 0; }
};
Note: The get_maxpart()
method returns an upper bound on
the weight returned by get_sumpart()
. In order to do
that, it requires the WDF_MAX
statistic (the maximum
wdf of the term among all documents).


League
Home
Standings
Schedule
Results
Top Scorers
Profile Club
Profile Players
News
News
News Single
Shop
Shop
Product Details
Wishlist
Shopping Cart
Checkout
Pages
Faq
Testimonial
404 Page
Contact Us
Login
Register
Shop
Amazing Football
$23
Gloves Sport
$40
Football T-shirt
$17
Football Shoes
$30
Gloves Football
$17
Football Shoes
$30
First
1
2
3
4
Last


Faith Guitars launches its first ever nylon model, The Lyra
by Rob LaingFaith Guitars launches its first ever nylon model, The Lyra
Faith Guitars never sit still for long but its latest design is quite a departure for the UK-designed / Indonesian-built company. The Lyra is its first nylon string model and the build specs are impressive.
The neck profile is slimmer than traditional classicals but still wide enough for fingerstyle technique. A solid red cedar top and solid rosewood back and sides are finished in high gloss lacquer. The neck is mahogany with an ebony fingerboard and bridge, while the soundhole rosette is Indonesian rosewood with Abalone border.
The Lyra also features a Fishman Sonitone preamp and pickup specifically designed for nylon stringed guitars. Anyone familiar with the Sonitone's steel string version will know the volume and tone controls are mounted inside the soundhole of the guitar.
The Faith HiGloss Lyra Nylon String is available to order from retailers now with a list price of £865.


Lecture 14
Qi Wang, Department of Statistics
Sep 21, 2018
In Eric’s STAT 225 class, 80% of the students passed on Exam 1. If we were to pick a student at random and asked them whether or not they passed, let X be the number of students who passed. What type of random variable is this? How do you know? Additionally, write down the pmf, the expected value, and the variance of X.
Now pick 10 students from Eric’s class, with the same probability of having passed. Let X be the total number of students who passed. What type of random variable is this? What values can X take? Please write down the pmf, the expected value, and the variance of X.
Theorem: Let $X_1, X_2, \cdots, X_n$ be independent Bernoulli random variables, each with the same parameter p. Then the sum $X= X_1 + X_2 + \cdots + X_n$ is a binomial random variable with parameters $n$ and $p$


The video below will step you through the creation of a paper airplane. Feel free to follow along and rewatch the video as often as you'd like.


UK PM Johnson says Brexit transition period will not be extended
by ReutersLONDON (Nov 15): Prime Minister Boris Johnson said Britain he will “absolutely guarantee” that his government will not extend the Brexit transition period before the end of year.
“I don’t want an extension,” Johnson told the BBC. “If we can get a working majority, all we need is 9 more seats, then can absolutely guarantee” not seeking an extension.


Automotive ASIC Applications
Triad Semiconductor is a trusted partner for the design and manufacture of custom integrated circuits for automotive applications.
Drivers for Automotive ASIC Integration
Today, automotive technology is undergoing rapid and continual evolution. At the same time, automotive applications must achieve superior quality. We see customers in the automotive market embracing and addressing the following needs with Triad’s innovative custom IC solutions:
- Support for mobility and connectivity
- Safety improvements throughout the vehicle
- An exponential increase in sensors throughout all parts of the automobile
- Stringent quality & reliability requirements
- Need to protect intellectual property
- Electronics with demanding high-voltage and high-temperature requirements
Semiconductor Process Capabilities
- Automotive-specific process technologies
- Automotive qualified non-volatile memory for high-voltage and high-temperature environments
- High-voltage drivers (up to 120V)
- Under-the-hood temperature ranges (-40C to 150C)
- Automotive qualified semiconductor foundries, package and assembly partners


Blacksmith Pushkin:
You brought all the materials needed! Well done, Elf! Now, let's get to work. I will make you a fine container, more wonderful than in your diagram!
Don't worry! I know that the design on the cup's surface is important. I will carve it accurately! However it will take time to finish... Do you care to wait?
Wait until he finishes.