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-36262, 33-36263, 33-72636, 33-72638, 33-81150, 33-81152, 333-2151, and 333-4621) of our reports dated January 28, 1997 on our audits of the consolidated financial statements and financial statement schedule of Cognex Corporation as of December 31, 1996 and 1995, and for each of the three years in the period ended December 31, 1996, which reports are incorporated by reference or included in this Annual Report on Form 10-K. /s/ COOPERS & LYBRAND L.L.P. Boston, Massachusetts March 24, 1997