{
  "generatedAt": "2026-11-14T16:35:49.608Z",
  "meta": {
    "slug": "opencv-lane-detection-basics",
    "type": "library",
    "status": "published",
    "publishAt": "2026-04-07T12:00:00+09:00",
    "updatedAt": "2026-05-13T13:37:42.686Z",
    "category": "autonomous-driving",
    "tags": [
      "computer-vision",
      "opencv"
    ],
    "authors": [
      "kwon-minjae"
    ],
    "series": "autonomous-driving-basics",
    "seriesOrder": 1,
    "project": "autonomous-driving-lane-study",
    "thumbnail": "/data/img/cover.d15f11107b.1200.webp",
    "ogImage": "/data/og/opencv-lane-detection-basics.jpg?v=bdca1e3e71",
    "noindex": false,
    "hasCover": true,
    "thumbnailSrcset": "/data/img/cover.d15f11107b.480.webp 480w, /data/img/cover.d15f11107b.1200.webp 1200w"
  },
  "locales": {
    "ko": {
      "language": "ko",
      "filename": "ko.html",
      "format": "html",
      "title": "OpenCV 차선 인식 주요 기능 정리",
      "summary": "HSV, Grayscale, Canny, ROI, Hough Transform, Gaussian Blur를 중심으로 차선 인식에 자주 쓰이는 OpenCV 기능을 정리했습니다.",
      "description": "차선 인식과 자율주행 기초 구현에 자주 쓰이는 OpenCV 기능을 쉽게 정리한 글입니다.",
      "content": "<h3>개요</h3><p>OpenCV의 기능을 확인하고 다양한 프로젝트에서 어떠한 차선인식 방법이 사용되는지, <br>어떠한 방법으로 자율주행을 구현하는 것이 적합한지에 관해 알아보겠습니다.</p><h3><br><br>주요 기능</h3><ul><li><p>HSV 색상/채도/명도 방식 변환</p></li><li><p>Grayscale Conversion&nbsp; 흑백 이미지 변환</p></li><li><p>Canny Edge Detection 경계선 검출</p></li><li><p>Region of Interest 관심영역 지정</p></li><li><p>Hough Transformation 직선검출</p></li><li><p>Gaussian Blur 노이즈제거&nbsp;</p></li></ul><h3><br>각 주요기능에 대해 하나씩 알아보도록 하겠습니다.<br></h3><h3>1. HSV 색상/채도/명도&nbsp;방식&nbsp;변환</h3><p>HSV는 색상/채도/명도로 색인식을 하는 방식입니다. 보통 RGB방식을 잘 아실텐데요, RGB방식은 Red, Green, Blue 3색으로 색상의 색을 인식합니다. 이러한 방법 중 HSV를 사용하는 이유는 첫째, 조명변화에 둔감합니다. RGB방식의 경우 조명이 변화하면 세가지의 값들이 모두 흔들리기 시작합니다. 하지만 HSV는 밝기(V)와 색상(H)을 분리해두기때문에&nbsp; 같은색이여도 더 안정적인 출력이 가능합니다. 실제로 코드를 제작하여 테스트를 해보면서 확인해본결과, RGB 방식에서 흰색에 그림자가 드리워지면 흰색으로 인식을 못하는 반면, HSV는 흰색으로 잘 인식하는것을 알 수 있습니다.&nbsp; <br></p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775580810418.8fa73790a3.1024.webp\" alt=\"Hue·Saturation·Value를 나타낸 HSV 색 공간 원통\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775580810418.8fa73790a3.640.webp 640w, /data/img/opencv-lane-detection-basics-1775580810418.8fa73790a3.1024.webp 1024w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1024\" height=\"768\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3><br>2. Grayscale Conversion 흑백 이미지 변환</h3><p>Grayscale 변환은 RGB 방식에서 사용가능한 변환방법으로, RGB 3가지로 변환된 값을 흑백이미지로 바꾸는 방법입니다. 이렇게 흑백으로 변환하는 이유는 연산처리를 빠르게 하여 주행라인을 찾아내는 속도를 빠르게 하기 위해 사용하는 경우가 많습니다. HSV에서는 따로 처리를 더 거칠수록 느려지기 때문에 기본 HSV만 사용합니다.<br></p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775614594531.79a4efd535.832.webp\" alt=\"HSV\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775614594531.79a4efd535.640.webp 640w, /data/img/opencv-lane-detection-basics-1775614594531.79a4efd535.832.webp 832w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"832\" height=\"437\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3>3. Canny&nbsp;Edge&nbsp;Detection&nbsp;경계선&nbsp;검출</h3><p>Canny Edge Detection은 그림의 경계선을 검출해내는 기능입니다. 이렇게 경계면을 찾는 원리는 급격하게 색이 변화하는 부분을 검출해내어 그림의 경계면만 검출 해낼 수 있습니다. 마찬가지로 연산처리속도가 좋아진다는 장점이 있습니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775623808235.6d26ddf62f.1280.webp\" alt=\"그레이스케일 이미지와 Sobel x·y 방향 미분 결과\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775623808235.6d26ddf62f.640.webp 640w, /data/img/opencv-lane-detection-basics-1775623808235.6d26ddf62f.960.webp 960w, /data/img/opencv-lane-detection-basics-1775623808235.6d26ddf62f.1280.webp 1280w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1280\" height=\"451\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3>4. Region&nbsp;of&nbsp;Interest&nbsp;관심영역&nbsp;지정</h3><p>Region of Interest, ROI라고도 하는 관심영역 지정은 특정 부분만을 지정하여 연산범위에 넣는 기능입니다. 사실 자율주행에서 연산속도가 가장중요하지않을까 싶습니다. 따라서 해당 기능도 원하는 특정 부분, 보통 중앙하단을 ROI로 지정하여 해당 부분의 차선이나 어디로 차선이 꺾이는지에 대해 검출하고, 전체를 영역을 지정하는 것보다더 빠르게 검출해낼 수 있다는 장점이 있습니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775623821048.e055feaf69.459.webp\" alt=\"차선 인식 결과 화면: 검출한 두 차선과 주행 영역, 차선 유지 상태 표시\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" width=\"459\" height=\"272\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3>5. Hough&nbsp;Transformation&nbsp;직선검출</h3><p>허프변환이라고 하는 이 기능은, 이미지에서 직선을 검출해내는 기능입니다. 요 기능을 사용하는 이유는 차선이 일직선인가, 주변 구조물의 파악, 차량의 현재 방향등을 확인하기 위해 사용합니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775623827525.a95ac0ea23.1280.webp\" alt=\"사막 도로 위에 허프 변환으로 검출한 직선들\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775623827525.a95ac0ea23.640.webp 640w, /data/img/opencv-lane-detection-basics-1775623827525.a95ac0ea23.960.webp 960w, /data/img/opencv-lane-detection-basics-1775623827525.a95ac0ea23.1280.webp 1280w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1280\" height=\"840\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3>6. Gaussian&nbsp;Blur&nbsp;노이즈제거</h3><p>가우시안 블러는 이미지에 환경적이유나 카메라 스펙에 의해 노이즈가 발생하게 되는데 이를 먼저 말한 캐니 엣지 디텍션, 경계면을 검출하는 과정에서 일일이 다 점으로 인식을하기 때문에! 연산이 또 느려지거나 오류를 일으킬 수 있기때문에 노이즈를 제거하기 위한 기능입니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775623834566.ebb0666a77.1096.webp\" alt=\"잡음이 낀 책장 이미지(왼쪽)와 블러로 잡음을 줄인 결과(오른쪽)\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775623834566.ebb0666a77.640.webp 640w, /data/img/opencv-lane-detection-basics-1775623834566.ebb0666a77.1096.webp 1096w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1096\" height=\"554\" data-img-tone=\"mixed\" decoding=\"async\"></figure><p></p>",
      "rendered": true
    },
    "en": {
      "language": "en",
      "filename": "en.html",
      "format": "html",
      "title": "Summary of Key Features of OpenCV Lane Detection",
      "summary": "I have compiled a list of OpenCV functions commonly used for lane detection, focusing on HSV, Grayscale, Canny, ROI, Hough Transform, and Gaussian Blur.",
      "description": "This article provides a concise overview of OpenCV functions commonly used for lane detection and basic autonomous driving implementation.",
      "content": "<h3>Overview</h3><p>We will explore OpenCV’s capabilities and examine which lane detection methods are used in various projects,<br>as well as determine the most suitable approach for implementing autonomous driving.</p><h3><br><br>Key Features</h3><ul><li><p>HSV Color/Saturation/Luminance Conversion</p></li><li><p>Grayscale Conversion</p></li><li><p>Canny Edge Detection</p></li><li><p>Region of Interest (ROI) Definition</p></li><li><p>Hough Transformation - Line Detection</p></li><li><p>Gaussian Blur - Noise Reduction </p></li></ul><h3><br>Let’s take a look at each of these key features one by one.<br></h3><h3>1. HSV Color/Saturation/Brightness Conversion</h3><p>HSV is a method of color recognition based on hue, saturation, and value. You are likely familiar with the RGB method, which recognizes color using the three primary colors: Red, Green, and Blue. The reason we use HSV over RGB is, first, that it is less sensitive to changes in lighting. With the RGB method, all three values begin to fluctuate when lighting changes. However, since HSV separates brightness (V) and hue (H), it can produce more stable results even for the same color. In fact, when I tested this by writing code, I found that while the RGB method fails to recognize white when a shadow is cast over it, HSV recognizes it as white without issue.  <br></p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775580810418.8fa73790a3.1024.webp\" alt=\"The HSV colour cylinder: hue, saturation and value\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775580810418.8fa73790a3.640.webp 640w, /data/img/opencv-lane-detection-basics-1775580810418.8fa73790a3.1024.webp 1024w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1024\" height=\"768\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3><br>2. Grayscale Conversion</h3><p>Grayscale conversion is a method available in the RGB system that converts values represented by the three RGB components into a grayscale image. This conversion is often used to speed up computational processing and thereby accelerate the detection of driving lines. In the HSV system, additional processing tends to slow things down, so we use only the basic HSV values.<br></p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775614594531.79a4efd535.832.webp\" alt=\"HSV\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775614594531.79a4efd535.640.webp 640w, /data/img/opencv-lane-detection-basics-1775614594531.79a4efd535.832.webp 832w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"832\" height=\"437\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3>3. Canny Edge Detection</h3><p>Canny Edge Detection is a function that detects edges in an image. The principle behind finding these edges involves detecting areas where color changes abruptly, allowing only the image edges to be detected. Similarly, this method has the advantage of improving computational processing speed.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775623808235.6d26ddf62f.1280.webp\" alt=\"A grayscale image and its Sobel x and y derivatives\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775623808235.6d26ddf62f.640.webp 640w, /data/img/opencv-lane-detection-basics-1775623808235.6d26ddf62f.960.webp 960w, /data/img/opencv-lane-detection-basics-1775623808235.6d26ddf62f.1280.webp 1280w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1280\" height=\"451\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3>4. Region of Interest (ROI)</h3><p>Region of Interest (ROI) designation is a function that selects only specific areas to include in the processing scope. In fact, processing speed is arguably the most critical factor in autonomous driving. Therefore, this feature allows you to designate a specific area—typically the lower center—as the ROI to detect lane markings or where the lane curves, offering the advantage of faster detection compared to processing the entire image.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775623821048.e055feaf69.459.webp\" alt=\"Lane detection output: both lanes found, the driving area filled and the lane-keeping status shown\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" width=\"459\" height=\"272\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3>5. Hough Transformation for Line Detection</h3><p>The Hough Transformation is a function used to detect straight lines in an image. This function is used to verify whether lane markings are straight, identify surrounding structures, and determine the vehicle’s current direction.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775623827525.a95ac0ea23.1280.webp\" alt=\"Straight lines found with the Hough transform, drawn over a desert road\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775623827525.a95ac0ea23.640.webp 640w, /data/img/opencv-lane-detection-basics-1775623827525.a95ac0ea23.960.webp 960w, /data/img/opencv-lane-detection-basics-1775623827525.a95ac0ea23.1280.webp 1280w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1280\" height=\"840\" data-img-tone=\"mixed\" decoding=\"async\"></figure><h3>6. Gaussian Blur for Noise Reduction</h3><p>Gaussian Blur is used to remove noise that occurs in images due to environmental factors or camera specifications. Since the previously mentioned Canny edge detection process recognizes every boundary as a separate point, this can slow down computations or cause errors; therefore, this feature is used to remove such noise.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\"><img src=\"/data/img/opencv-lane-detection-basics-1775623834566.ebb0666a77.1096.webp\" alt=\"A noisy bookshelf image (left) and the result after blurring (right)\" title=\"\" data-width=\"72\" data-align=\"center\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: min(100%, 72%); height: auto;\" srcset=\"/data/img/opencv-lane-detection-basics-1775623834566.ebb0666a77.640.webp 640w, /data/img/opencv-lane-detection-basics-1775623834566.ebb0666a77.1096.webp 1096w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1096\" height=\"554\" data-img-tone=\"mixed\" decoding=\"async\"></figure><p></p>",
      "rendered": true
    }
  }
}
