10.07.2015 Views

HALCON Extension Package Programmer's Manual

HALCON Extension Package Programmer's Manual

HALCON Extension Package Programmer's Manual

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

94 CHAPTER 6. SPECIAL ROUTINES FOR TYPICAL SUPPLY PROCEDURESNamesÀÁѸ ÀÁÑSynopsisÒÐÙ ÀÐÓÒºÀÁÑ´ ÓÙÐÀÑÁÆÌÀÁÑ´ ÀÑÓÙÐÁÆ̲ÚиѸÐÒÓÓֵѸÚиÐÒÓÓÖµFigure 6.6: Auxiliary macros for generic access to pixel data. “&” denotes an output parameterof ÀÁÑ. This is only a special notation to make clear that this parameter is changed bythe macro. So do not pass a pointer to ÓÙÐ but the ÓÙÐ variable itself to the macro.6.1.4 ÀÐÐÐØÖ¾The macro ÀÐÐÐØÖ¾ (see Fig. 6.1) is a variation of ÀÐÐÐØÖ introduced in the previoussection. It facilitates the implementation of filters with two input object parameters. Examplesfor this technique are the <strong>HALCON</strong> operators Ñ, ÑÙÐØ Ñ, Ø Ò, andÑÜ ¾ Ñ×.ÀÐÐÐØÖ¾ extends ÀÐÐØÖ so that with every image object of the first input object parameteralso the corresponding image object (with the same object index Ó ÒÜ) ofthesecond input object parameter is provided. Moreover, it checks the image sizes of both imageobjects for equality. If the sizes are equal, the images are provided in the loop variablesÑ Ò½ and Ñ Ò¾, otherwise an error is returned.Moreover, ÀÐÐÐØÖ¾ computes a new input region (ÖÓÒ) by intersecting the areas ofdefinition of both input images. Note, that memory for this region must have been allocatedbefore (e.g. with ÀÐÐÓÊÄÌÑÔ). Furthermore, ÖÓÒ must be deallocated at the end of thesupply procedure (ÀÖÊÄÌÑÔ).Output image objects are created and returned in the first output object parameter in the sameway as decribed for ÀÐÐÐØÖ in section 6.1.3.Fig. 6.7 shows a typical application of ÀÐÐÐØÖ¾ – the implementation of an operator thatadds the gray values of two input images. As in procedure ÁÈËÐÆÛ in Fig. 6.5, the macrosÀÁÑ and ÀÁÑ are used to read and write pixel values. In this example, that exhibitsthe additional advantage that the operator can even add the gray values of two images withdifferent pixel types.<strong>HALCON</strong> <strong>Extension</strong> <strong>Package</strong> Interface / 2000-11-16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!