In an agreement valued at up to $19 million in cash, Cognex Corp. of Natick, Mass., plans to purchase the machine vision business of Tokyo-based Komatsu Ltd. Under its terms, Cognex would acquire the rights to Komatsu's machine vision technologies and products, such as the Fapex high-speed, gray-scale machine vision system, and would hire its software and sales engineers.