<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2022 Workiva-->
<!--r:9a42c90f-1f2c-4255-874b-46c5c1bc9b83,g:47439a38-1ffc-44c5-b2f0-e902fcc31613-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:cgnx="http://www.cognex.com/20221002" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:dtr-types="http://www.xbrl.org/dtr/type/2020-01-21" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.cognex.com/20221002">
  <xs:import namespace="http://fasb.org/srt/2022" schemaLocation="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd"/>
  <xs:import namespace="http://fasb.org/us-gaap/2022" schemaLocation="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd"/>
  <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.xbrl.org/2003/xlink-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/2003/linkbase" schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/dtr/type/2020-01-21" schemaLocation="https://www.xbrl.org/dtr/type/2020-01-21/types.xsd"/>
  <xs:import namespace="http://xbrl.sec.gov/country/2022" schemaLocation="https://xbrl.sec.gov/country/2022/country-2022.xsd"/>
  <xs:import namespace="http://xbrl.sec.gov/currency/2022" schemaLocation="https://xbrl.sec.gov/currency/2022/currency-2022.xsd"/>
  <xs:import namespace="http://xbrl.sec.gov/dei/2022" schemaLocation="https://xbrl.sec.gov/dei/2022/dei-2022.xsd"/>
  <xs:annotation>
    <xs:appinfo>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="cgnx-20221002_lab.xml" xlink:role="http://www.xbrl.org/2003/role/labelLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="cgnx-20221002_pre.xml" xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="cgnx-20221002_cal.xml" xlink:role="http://www.xbrl.org/2003/role/calculationLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="cgnx-20221002_def.xml" xlink:role="http://www.xbrl.org/2003/role/definitionLinkbaseRef" xlink:type="simple"/>
      <link:roleType id="CoverPage" roleURI="http://www.cognex.com/role/CoverPage">
        <link:definition>0000001 - Document - Cover Page</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ConsolidatedStatementsofOperations" roleURI="http://www.cognex.com/role/ConsolidatedStatementsofOperations">
        <link:definition>0000002 - Statement - Consolidated Statements of Operations</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ConsolidatedStatementsofComprehensiveIncome" roleURI="http://www.cognex.com/role/ConsolidatedStatementsofComprehensiveIncome">
        <link:definition>0000003 - Statement - Consolidated Statements of Comprehensive Income</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ConsolidatedStatementsofComprehensiveIncomeParenthetical" roleURI="http://www.cognex.com/role/ConsolidatedStatementsofComprehensiveIncomeParenthetical">
        <link:definition>0000004 - Statement - Consolidated Statements of Comprehensive Income (Parenthetical)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ConsolidatedBalanceSheets" roleURI="http://www.cognex.com/role/ConsolidatedBalanceSheets">
        <link:definition>0000005 - Statement - Consolidated Balance Sheets</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ConsolidatedBalanceSheetsParenthetical" roleURI="http://www.cognex.com/role/ConsolidatedBalanceSheetsParenthetical">
        <link:definition>0000006 - Statement - Consolidated Balance Sheets (Parenthetical)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ConsolidatedStatementsofCashFlows" roleURI="http://www.cognex.com/role/ConsolidatedStatementsofCashFlows">
        <link:definition>0000007 - Statement - Consolidated Statements of Cash Flows</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ConsolidatedStatementofShareholdersEquity" roleURI="http://www.cognex.com/role/ConsolidatedStatementofShareholdersEquity">
        <link:definition>0000008 - Statement - Consolidated Statement of Shareholders' Equity</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ConsolidatedStatementofShareholdersEquityParenthetical" roleURI="http://www.cognex.com/role/ConsolidatedStatementofShareholdersEquityParenthetical">
        <link:definition>0000009 - Statement - Consolidated Statement of Shareholders' Equity (Parenthetical)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPolicies" roleURI="http://www.cognex.com/role/SummaryofSignificantAccountingPolicies">
        <link:definition>0000010 - Disclosure - Summary of Significant Accounting Policies</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NewPronouncements" roleURI="http://www.cognex.com/role/NewPronouncements">
        <link:definition>0000011 - Disclosure - New Pronouncements</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurements" roleURI="http://www.cognex.com/role/FairValueMeasurements">
        <link:definition>0000012 - Disclosure - Fair Value Measurements</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestments" roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestments">
        <link:definition>0000013 - Disclosure - Cash, Cash Equivalents, and Investments</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="Inventories" roleURI="http://www.cognex.com/role/Inventories">
        <link:definition>0000014 - Disclosure - Inventories</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="Leases" roleURI="http://www.cognex.com/role/Leases">
        <link:definition>0000015 - Disclosure - Leases</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="Goodwill" roleURI="http://www.cognex.com/role/Goodwill">
        <link:definition>0000016 - Disclosure - Goodwill</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssets" roleURI="http://www.cognex.com/role/IntangibleAssets">
        <link:definition>0000017 - Disclosure - Intangible Assets</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WarrantyObligations" roleURI="http://www.cognex.com/role/WarrantyObligations">
        <link:definition>0000018 - Disclosure - Warranty Obligations</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommitmentandContingencies" roleURI="http://www.cognex.com/role/CommitmentandContingencies">
        <link:definition>0000019 - Disclosure - Commitment and Contingencies</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstruments" roleURI="http://www.cognex.com/role/DerivativeInstruments">
        <link:definition>0000020 - Disclosure - Derivative Instruments</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognition" roleURI="http://www.cognex.com/role/RevenueRecognition">
        <link:definition>0000021 - Disclosure - Revenue Recognition</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpense" roleURI="http://www.cognex.com/role/StockBasedCompensationExpense">
        <link:definition>0000022 - Disclosure - Stock-Based Compensation Expense</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockRepurchaseProgram" roleURI="http://www.cognex.com/role/StockRepurchaseProgram">
        <link:definition>0000023 - Disclosure - Stock Repurchase Program</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxes" roleURI="http://www.cognex.com/role/IncomeTaxes">
        <link:definition>0000024 - Disclosure - Income Taxes</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WeightedAverageShares" roleURI="http://www.cognex.com/role/WeightedAverageShares">
        <link:definition>0000025 - Disclosure - Weighted-Average Shares</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LossfromFire" roleURI="http://www.cognex.com/role/LossfromFire">
        <link:definition>0000026 - Disclosure - Loss from Fire</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SubsequentEvents" roleURI="http://www.cognex.com/role/SubsequentEvents">
        <link:definition>0000027 - Disclosure - Subsequent Events</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesPolicies" roleURI="http://www.cognex.com/role/SummaryofSignificantAccountingPoliciesPolicies">
        <link:definition>0000028 - Disclosure - Summary of Significant Accounting Policies (Policies)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurementsTables" roleURI="http://www.cognex.com/role/FairValueMeasurementsTables">
        <link:definition>0000029 - Disclosure - Fair Value Measurements (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsTables" roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsTables">
        <link:definition>0000030 - Disclosure - Cash, Cash Equivalents, and Investments (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="InventoriesTables" roleURI="http://www.cognex.com/role/InventoriesTables">
        <link:definition>0000031 - Disclosure - Inventories (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesTables" roleURI="http://www.cognex.com/role/LeasesTables">
        <link:definition>0000032 - Disclosure - Leases (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="GoodwillTables" roleURI="http://www.cognex.com/role/GoodwillTables">
        <link:definition>0000033 - Disclosure - Goodwill (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssetsTables" roleURI="http://www.cognex.com/role/IntangibleAssetsTables">
        <link:definition>0000034 - Disclosure - Intangible Assets (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WarrantyObligationsTables" roleURI="http://www.cognex.com/role/WarrantyObligationsTables">
        <link:definition>0000035 - Disclosure - Warranty Obligations (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsTables" roleURI="http://www.cognex.com/role/DerivativeInstrumentsTables">
        <link:definition>0000036 - Disclosure - Derivative Instruments (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionTables" roleURI="http://www.cognex.com/role/RevenueRecognitionTables">
        <link:definition>0000037 - Disclosure - Revenue Recognition (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseTables" roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseTables">
        <link:definition>0000038 - Disclosure - Stock-Based Compensation Expense (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WeightedAverageSharesTables" roleURI="http://www.cognex.com/role/WeightedAverageSharesTables">
        <link:definition>0000039 - Disclosure - Weighted-Average Shares (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails" roleURI="http://www.cognex.com/role/FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails">
        <link:definition>0000040 - Disclosure - Fair Value Measurements - Assets and Liabilities Measured at Fair Value on a Recurring Basis (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurementsDetails" roleURI="http://www.cognex.com/role/FairValueMeasurementsDetails">
        <link:definition>0000041 - Disclosure - Fair Value Measurements (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsDetails" roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsDetails">
        <link:definition>0000042 - Disclosure - Cash, Cash Equivalents, and Investments (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails" roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails">
        <link:definition>0000043 - Disclosure - Cash, Cash Equivalents, and Investments - Components of Cash, Cash Equivalents, and Investments (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails" roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails">
        <link:definition>0000044 - Disclosure - Cash, Cash Equivalents, and Investments - Summary of Available-for-Sale Investments (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails" roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails">
        <link:definition>0000045 - Disclosure - Cash, Cash Equivalents, and Investments - Gross Unrealized Losses and Fair Values for Available-for-Sale Investments (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails" roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails">
        <link:definition>0000046 - Disclosure - Cash, Cash Equivalents, and Investments - Effective Maturity Dates of Available-for-Sale Investments (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="InventoriesScheduleofInventoriesDetails" roleURI="http://www.cognex.com/role/InventoriesScheduleofInventoriesDetails">
        <link:definition>0000047 - Disclosure - Inventories - Schedule of Inventories (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesNarrativeDetails" roleURI="http://www.cognex.com/role/LeasesNarrativeDetails">
        <link:definition>0000048 - Disclosure - Leases - Narrative (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesFutureMinimumLeasePaymentObligationsUnderOperatingLeasesDetails" roleURI="http://www.cognex.com/role/LeasesFutureMinimumLeasePaymentObligationsUnderOperatingLeasesDetails">
        <link:definition>0000049 - Disclosure - Leases - Future Minimum Lease Payment Obligations Under Operating Leases (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="GoodwillDetails" roleURI="http://www.cognex.com/role/GoodwillDetails">
        <link:definition>0000050 - Disclosure - Goodwill (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssetsDetails" roleURI="http://www.cognex.com/role/IntangibleAssetsDetails">
        <link:definition>0000051 - Disclosure - Intangible Assets (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssetsDetails_1" roleURI="http://www.cognex.com/role/IntangibleAssetsDetails_1">
        <link:definition>0000051 - Disclosure - Intangible Assets (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WarrantyObligationsChangesinWarrantyObligationsDetail" roleURI="http://www.cognex.com/role/WarrantyObligationsChangesinWarrantyObligationsDetail">
        <link:definition>0000052 - Disclosure - Warranty Obligations - Changes in Warranty Obligations (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommitmentandContingenciesDetails" roleURI="http://www.cognex.com/role/CommitmentandContingenciesDetails">
        <link:definition>0000053 - Disclosure - Commitment and Contingencies (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsDetails" roleURI="http://www.cognex.com/role/DerivativeInstrumentsDetails">
        <link:definition>0000054 - Disclosure - Derivative Instruments (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsOutstandingForwardContractsTableDetails" roleURI="http://www.cognex.com/role/DerivativeInstrumentsOutstandingForwardContractsTableDetails">
        <link:definition>0000055 - Disclosure - Derivative Instruments - Outstanding Forward Contracts Table (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails" roleURI="http://www.cognex.com/role/DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails">
        <link:definition>0000056 - Disclosure - Derivative Instruments - Schedule of Derivative Instruments in Statement of Financial Position, Fair Value (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsOffsettingAssetsDetails" roleURI="http://www.cognex.com/role/DerivativeInstrumentsOffsettingAssetsDetails">
        <link:definition>0000057 - Disclosure - Derivative Instruments - Offsetting Assets (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsDerivativeInstrumentsGainLossDetails" roleURI="http://www.cognex.com/role/DerivativeInstrumentsDerivativeInstrumentsGainLossDetails">
        <link:definition>0000058 - Disclosure - Derivative Instruments - Derivative Instruments, Gain (Loss) (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionRevenueDisaggregatedbyGeographyDetails" roleURI="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyGeographyDetails">
        <link:definition>0000059 - Disclosure - Revenue Recognition - Revenue Disaggregated by Geography (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails" roleURI="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails">
        <link:definition>0000060 - Disclosure - Revenue Recognition - Revenue Disaggregated by Products and Services (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionAdditionalInformationDetails" roleURI="http://www.cognex.com/role/RevenueRecognitionAdditionalInformationDetails">
        <link:definition>0000061 - Disclosure - Revenue Recognition - Additional Information (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionScheduleofAllowanceforCreditLossDetails" roleURI="http://www.cognex.com/role/RevenueRecognitionScheduleofAllowanceforCreditLossDetails">
        <link:definition>0000062 - Disclosure - Revenue Recognition - Schedule of Allowance for Credit Loss (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionDeferredRevenueActivityDetails" roleURI="http://www.cognex.com/role/RevenueRecognitionDeferredRevenueActivityDetails">
        <link:definition>0000063 - Disclosure - Revenue Recognition - Deferred Revenue Activity (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseDetails" roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseDetails">
        <link:definition>0000064 - Disclosure - Stock-Based Compensation Expense (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseSummaryofStockOptionActivityDetails" roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseSummaryofStockOptionActivityDetails">
        <link:definition>0000065 - Disclosure - Stock-Based Compensation Expense - Summary of Stock Option Activity (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseWeightedAverageAssumptionsUsedinEstimatingFairValuesofStockOptionsGrantedDetails" roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseWeightedAverageAssumptionsUsedinEstimatingFairValuesofStockOptionsGrantedDetails">
        <link:definition>0000066 - Disclosure - Stock-Based Compensation Expense - Weighted-Average Assumptions Used in Estimating Fair Values of Stock Options Granted (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails" roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails">
        <link:definition>0000067 - Disclosure - Stock-Based Compensation Expense Stock-Based Compensation Expense - Schedule of Restricted Stock Units (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseScheduleofPerformanceRestrictedStockUnitsDetails" roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseScheduleofPerformanceRestrictedStockUnitsDetails">
        <link:definition>0000068 - Disclosure - Stock-Based Compensation Expense - Schedule of Performance Restricted Stock Units (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails" roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails">
        <link:definition>0000069 - Disclosure - Stock-Based Compensation Expense - Schedule of Employee Service Share-based Compensation, Allocation of Recognized Period Costs (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockRepurchaseProgramDetails" roleURI="http://www.cognex.com/role/StockRepurchaseProgramDetails">
        <link:definition>0000070 - Disclosure - Stock Repurchase Program (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesDetails" roleURI="http://www.cognex.com/role/IncomeTaxesDetails">
        <link:definition>0000071 - Disclosure - Income Taxes (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WeightedAverageSharesCalculationofWeightedAverageSharesDetails" roleURI="http://www.cognex.com/role/WeightedAverageSharesCalculationofWeightedAverageSharesDetails">
        <link:definition>0000072 - Disclosure - Weighted-Average Shares - Calculation of Weighted-Average Shares (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WeightedAverageSharesDetails" roleURI="http://www.cognex.com/role/WeightedAverageSharesDetails">
        <link:definition>0000073 - Disclosure - Weighted-Average Shares (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LossfromFireDetails" roleURI="http://www.cognex.com/role/LossfromFireDetails">
        <link:definition>0000074 - Disclosure - Loss from Fire (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SubsequentEventsDetails" roleURI="http://www.cognex.com/role/SubsequentEventsDetails">
        <link:definition>0000075 - Disclosure - Subsequent Events (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
    </xs:appinfo>
  </xs:annotation>
  <xs:element id="cgnx_RepurchaseProgramMarch2020Member" abstract="true" name="RepurchaseProgramMarch2020Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_LesseeOperatingLeaseOptionToRenewTermOfContract" abstract="false" name="LesseeOperatingLeaseOptionToRenewTermOfContract" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:durationItemType"/>
  <xs:element id="cgnx_TaxyearsopentoexaminationbyInternalRevenueService" abstract="false" name="TaxyearsopentoexaminationbyInternalRevenueService" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_NumberOfGroupsWithinEmployeePopulation" abstract="false" name="NumberOfGroupsWithinEmployeePopulation" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="xbrli:integerItemType"/>
  <xs:element id="cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisableIntrinsicValue" abstract="false" name="SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisableIntrinsicValue" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_CustomerContractsAndRelationshipsMember" abstract="true" name="CustomerContractsAndRelationshipsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_IncreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" abstract="false" name="IncreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_EffectiveIncomeTaxRateReconciliationCatastrophicEventAmount" abstract="false" name="EffectiveIncomeTaxRateReconciliationCatastrophicEventAmount" nillable="true" xbrli:periodType="duration" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_StockRepurchasedDuringPriorPeriodSettledInCurrentPeriod" abstract="false" name="StockRepurchasedDuringPriorPeriodSettledInCurrentPeriod" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:sharesItemType"/>
  <xs:element id="cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" abstract="false" name="EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_IncomeTaxExaminationYearsUnderExaminationOtherEntities" abstract="false" name="IncomeTaxExaminationYearsUnderExaminationOtherEntities" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_NonCurrentAssetsMember" abstract="true" name="NonCurrentAssetsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" abstract="false" name="EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_ApplicationSpecificCustomerSolutionsMember" abstract="true" name="ApplicationSpecificCustomerSolutionsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_GeneralStockOptionPlanMember" abstract="true" name="GeneralStockOptionPlanMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_EmployeeServiceSharebasedCompensationNonvestedAwardsCompensationNotyetRecognizedPeriodforRecognition" abstract="false" name="EmployeeServiceSharebasedCompensationNonvestedAwardsCompensationNotyetRecognizedPeriodforRecognition" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:durationItemType"/>
  <xs:element id="cgnx_AsiaExcludingChinaMember" abstract="true" name="AsiaExcludingChinaMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" abstract="false" name="AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" abstract="false" name="AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_CatastropheAbstract" abstract="true" name="CatastropheAbstract" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_SouthboroughMassachusettsMember" abstract="true" name="SouthboroughMassachusettsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_NonCashLossFromCatastrophes" abstract="false" name="NonCashLossFromCatastrophes" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_EffectiveIncomeTaxRateReconciliationExcludingDiscreteItemsPercent" abstract="false" name="EffectiveIncomeTaxRateReconciliationExcludingDiscreteItemsPercent" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_RepurchaseProgramMarch2022Member" abstract="true" name="RepurchaseProgramMarch2022Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_StandardProductsandServicesMember" abstract="true" name="StandardProductsandServicesMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" abstract="false" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_DistributionRightsDevelopedTechnologyRightsCustomerContractsAndRelationshipsOtherIntangibleAssetsAndTrademarksMember" abstract="true" name="DistributionRightsDevelopedTechnologyRightsCustomerContractsAndRelationshipsOtherIntangibleAssetsAndTrademarksMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_ExcessAndObsoleteInventoryCharges" abstract="false" name="ExcessAndObsoleteInventoryCharges" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_CashCashEquivalentsShortTermAndLongTermInvestments" abstract="false" name="CashCashEquivalentsShortTermAndLongTermInvestments" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" abstract="false" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" abstract="false" name="AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_LossFromCatastropheTextBlock" abstract="false" name="LossFromCatastropheTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:textBlockItemType"/>
  <xs:element id="cgnx_AgencyBondsMember" abstract="true" name="AgencyBondsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_SellingGeneralAndAdministrativeMember" abstract="true" name="SellingGeneralAndAdministrativeMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_OutstandingForwardContractsTableTextBlock" abstract="false" name="OutstandingForwardContractsTableTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:textBlockItemType"/>
  <xs:element id="cgnx_EffectiveIncomeTacRateReconciliationReleaseOfTaxReserve" abstract="false" name="EffectiveIncomeTacRateReconciliationReleaseOfTaxReserve" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ExpirationPeriodOfStockOptionPlan" abstract="false" name="ExpirationPeriodOfStockOptionPlan" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:durationItemType"/>
  <xs:element id="cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" abstract="false" name="AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_GrossLossFromCatastrophes" abstract="false" name="GrossLossFromCatastrophes" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_LiabilityForUncertainTaxPositions" abstract="false" name="LiabilityForUncertainTaxPositions" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTextBlock" abstract="false" name="ComponentsOfCashCashEquivalentsAndInvestmentsTableTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:textBlockItemType"/>
  <xs:element id="cgnx_DeferredRevenueForeignCurrencyExchangeAdjustment" abstract="false" name="DeferredRevenueForeignCurrencyExchangeAdjustment" nillable="true" xbrli:periodType="duration" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsAdditionalDisclosures1Abstract" abstract="true" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsAdditionalDisclosures1Abstract" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" abstract="false" name="AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" abstract="false" name="EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_EffectiveIncomeTaxRateReconciliationDiscreteTaxExpenseBenefitAmount" abstract="false" name="EffectiveIncomeTaxRateReconciliationDiscreteTaxExpenseBenefitAmount" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_CurrencytranslationadjustmentsAbstract" abstract="true" name="CurrencytranslationadjustmentsAbstract" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_CurrentAssetsMember" abstract="true" name="CurrentAssetsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
</xs:schema>
