{"id":576,"date":"2012-11-26T10:26:42","date_gmt":"2012-11-26T10:26:42","guid":{"rendered":"http:\/\/www.bardecode.com\/en1\/?p=576"},"modified":"2012-11-26T10:26:42","modified_gmt":"2012-11-26T10:26:42","slug":"reading-barcodes-from-color-images","status":"publish","type":"post","link":"https:\/\/www.bardecode.com\/en1\/reading-barcodes-from-color-images\/","title":{"rendered":"Reading barcodes from color images"},"content":{"rendered":"<p>The graph below is a representation of a single scan line bisecting the image of the barcode shown underneath. The scale on the Y-axis represents pixel values\u00a0with\u00a0distance in pixels on the X-axis. Note that the\u00a0value of a pixel is derived from the RGB value using the formula (R + G + B) \/ 3. The peaks on the graph represent white spaces between bars and the troughs represent the black bars.<\/p>\n<p>Now, the barcode shown below consists of 30 black bars, and\u00a0with care it&#8217;s possible to count 30\u00a0troughs between points A and B along with the 29 peaks between the troughs.\u00a0The lowest peak\u00a0between A and B has a value of 159 and the highest trough has a value of 145.\u00a0This means that only\u00a0color threshold values between 146 and 158 will\u00a0stand a chance of decoding the barcode value on this scan line. If the difference between the lowest peak and the\u00a0highest trough can be increased then so\u00a0are the chances of\u00a0an SDK of being able to decode the barcode value.<\/p>\n<p><img decoding=\"async\" style=\"border: 0px;\" src=\"http:\/\/bardecode.com\/images\/color_graph.jpg\" alt=\"\" width=\"NaN\" height=\"452\" border=\"0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The graph below is a representation of a single scan line bisecting the image of the barcode shown underneath. The scale on the Y-axis represents pixel values\u00a0with\u00a0distance in pixels on the X-axis. Note that the\u00a0value of a pixel is derived from the RGB value using the formula (R + G + B) \/ 3. The<\/p>\n<p><a href=\"https:\/\/www.bardecode.com\/en1\/reading-barcodes-from-color-images\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":320,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[19,56,120,121,52,51,27,35,50,48],"class_list":["post-576","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-image","tag-barcode","tag-barcode-reader","tag-color","tag-colour","tag-document","tag-image-2","tag-pixels","tag-specification","tag-tiff","tag-toolkit"],"_links":{"self":[{"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/posts\/576"}],"collection":[{"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/comments?post=576"}],"version-history":[{"count":2,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/posts\/576\/revisions"}],"predecessor-version":[{"id":578,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/posts\/576\/revisions\/578"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/media\/320"}],"wp:attachment":[{"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/media?parent=576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/categories?post=576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/tags?post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}