EXHIBIT 23.1

                         CONSENT OF INDEPENDENT AUDITORS

We consent to the incorporation by reference in this Annual Report (Form 10-K)
of Cognex Corporation of our report dated January 23, 2004, included in the 2003
Annual Report to Stockholders of Cognex Corporation.

We consent to the incorporation by reference in the Registration Statements on
Form S-8 (File Nos. 33-81150, 333-04621, 333-02151, 333-60807, 33-32815,
333-44824, 333-68158, 333-96961, and 333-100709) of Cognex Corporation of our
report dated January 23, 2004, with respect to the consolidated financial
statements of Cognex Corporation incorporated by reference in this Annual Report
(Form 10-K) for the year ended December 31, 2003 and our report dated January
23, 2004 with respect to the financial statement schedule of Cognex Corporation
for the year ended December 31, 2003 included in this Annual Report (Form 10-K).

/s/ Ernst & Young LLP

Boston, Massachusetts
March 12, 2004