1 EXHIBIT 23 CONSENT OF INDEPENDENT ACCOUNTANTS We consent to the incorporation by reference in the registration statements of Cognex Corporation on Form S-8 (File Nos. 33-31657, 33-32815, 33-36263, 33-72634, 33-72636, 33-72638, 33-81150, 33-81152, 333-2151, 333-4621, and 333-60807) of our reports dated January 26, 1999, on our audits of the consolidated financial statements and financial statement schedule of Cognex Corporation as of December 31, 1998 and 1997, and for each of the three years in the period ended December 31, 1998, which reports are incorporated by reference or included in this Annual Report on Form 10-K. Boston, Massachusetts /s/ PricewaterhouseCoopers LLP March 26, 1999