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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.1. LOOP MACROS 93ÀÖÖÓÖ ÁÈËÐÆÛ´ÀÖÐÖÓÒÀÑÀÑßÁÆÌ ¸Ð¸ÒÓÙÐ ÖÓÒ¸ÑÒ¸ÑÓÙظÐÓÖ ´¼ ÖÓÒ¹ÒÙÑ ··µ ßÒ ´ÖÓÒ¹Öи¸ÑÒ¹ÛصÓÖ ´Ð´ÖÓÒ¹Öи¸ÑÒ¹Ûص ÐÒ Ð··µ ßÀÁÑ´¸ÑҸеÀÁÑ´ÑÓÙظÑÙÐظеРÐÖØÙÖÒ´ÀÅËÇõÀÍ×ÖÜÔÓÖØ ÀÖÖÓÖ ÁÈËÐÆÛ´ÀÔÖÓÒÐ ÔÖÓÒеßÀÔÖ ÑÙÐØÀÖÐÖÓÒ ÖÓÒÀÑ ÑÒ¸ÑÓÙØÁÆÌ ÐÀØËÈÖ´ÔÖÓÒи½¸ÄÇÌÈʸ²ÑÙÐظ½µÀÐÐÐØÖ´ÔÖÓÒи²ÖÓÒ¸²ÑÒ¸²ÑÓÙظ½¸µ ßÀÈ´ÁÈËÐÆÛ´ÖÓÒ¸²ÑÒ¸ÑÙÐغÔÖº¸²ÑÓÙصµÐÖØÙÖÒ´ÀÅËÌÊ͵Figure 6.5: A typical application of ÀÐÐÐØÖ: A filter operator.1. The simplest method is to implement the operator just for the most common pixel typeÌ ÁÅ and return an error message (À ÊÊ ÏÁÌ) for any other pixel type.2. Another way is to provide several action procedures – one for every pixel type – and callthe appropriate procedure via ×ÛØ´Ñ ÒºÒµ.3. The third (generic) method makes use of the macros ÀÁÑ and ÀÁÑ, seeFig. 6.6. They encapsulate the access to gray values by buffering them in a ÓÙÐvariable.By writing pixel values via ÀÁÑ, theÓÙÐ value ÚÐ is converted into the currentpixel type of Ñ Ò (and therefore may be clipped) and stored in the pixel specifiedby the linear coordinate ÐÒ ÓÓÖ, see section 4.1.The other way around, the specified pixel value is converted to ÓÙÐ and returned inÚÐ when using ÀÁÑ to read image data.The third method has been used in our example, as it allows a very compact source code. Butthis variant naturally shows drawbacks in terms of computation time: Two type conversionshave to be computed with every pixel access and all pixel arithmetic has to be done in ÓÙÐ.<strong>HALCON</strong> 6.0

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

Saved successfully!

Ooh no, something went wrong!