summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandroColomar <colomar.6.4.3@gmail.com>2018-11-05 11:22:34 +0100
committerAlejandroColomar <colomar.6.4.3@gmail.com>2018-11-05 11:22:34 +0100
commit82c62780d1d850df08fe9ab2d394f32f5589017d (patch)
tree55e85afc730ef4306adfbf355d73b756e513075d
parent3dce71a8cbb5d8c26411c83c7b5131e00f5eccb8 (diff)
Print resistance +- tolerance% in eng format into log
-rw-r--r--modules/proc/src/proc.cpp78
1 files changed, 0 insertions, 78 deletions
diff --git a/modules/proc/src/proc.cpp b/modules/proc/src/proc.cpp
index a8d0097..941d637 100644
--- a/modules/proc/src/proc.cpp
+++ b/modules/proc/src/proc.cpp
@@ -906,84 +906,6 @@ static int proc_resistor (void)
user_iface_log.lvl[user_iface_log.len] = 0;
(user_iface_log.len)++;
}
-#if 0
- /* Read price in aligned image (green component) */
- {
- /* Measure time */
- time_0 = clock();
-
- proc_load_mem(1);
-
- x = rect.center.x + (0.33 * rect.size.width / 2);
- y = rect.center.y + (0.64 * rect.size.height / 2);
- w = rect.size.width * 0.225;
- h = rect.size.height * 0.15;
- proc_ROI(x, y, w, h);
- proc_smooth(IMGI_SMOOTH_MEAN, 3);
- proc_threshold(cv::THRESH_BINARY, IMG_IFACE_THR_OTSU);
- proc_dilate_erode(1);
- proc_threshold(cv::THRESH_BINARY, 1);
- proc_OCR(IMG_IFACE_OCR_LANG_DIGITS, IMG_IFACE_OCR_CONF_PRICE);
-
- /* Measure time */
- time_1 = clock();
- times = ((double) time_1 - time_0) / CLOCKS_PER_SEC;
- /* Write time into log */
- snprintf(user_iface_log.line[user_iface_log.len], LOG_LINE_LEN,
- "Time5: %.3lf", times);
- user_iface_log.lvl[user_iface_log.len] = 0;
- (user_iface_log.len)++;
- }
- /* Extract price from barcode */
- {
- /* Measure time */
- time_0 = clock();
-
- if (zb_codes.arr[0].data[8] != '0') {
- snprintf(price, 80, "%c%c.%c%c",
- zb_codes.arr[0].data[8],
- zb_codes.arr[0].data[9],
- zb_codes.arr[0].data[10],
- zb_codes.arr[0].data[11]);
- } else {
- snprintf(price, 80, "%c.%c%c",
- zb_codes.arr[0].data[9],
- zb_codes.arr[0].data[10],
- zb_codes.arr[0].data[11]);
- }
-
- /* Measure time */
- time_1 = clock();
- times = ((double) time_1 - time_0) / CLOCKS_PER_SEC;
- /* Write time into log */
- snprintf(user_iface_log.line[user_iface_log.len], LOG_LINE_LEN,
- "Time6: %.3lf", times);
- user_iface_log.lvl[user_iface_log.len] = 0;
- (user_iface_log.len)++;
- }
- /* Check label price with barcode price */
- {
- /* Measure time */
- time_0 = clock();
-
- bool price_nok;
- price_nok = strncmp(img_ocr_text, price, strlen(price));
- if (price_nok) {
- status = LABEL_NOK_PRICE;
- result_label(status);
- return status;
- }
-
- /* Measure time */
- time_1 = clock();
- times = ((double) time_1 - time_0) / CLOCKS_PER_SEC;
- /* Write time into log */
- snprintf(user_iface_log.line[user_iface_log.len], LOG_LINE_LEN,
- "Time7: %.3lf", times);
- user_iface_log.lvl[user_iface_log.len] = 0;
- (user_iface_log.len)++;
- }
-#endif
status = RESISTOR_OK;
result_resistor(status);