computer-vision

Unable to convert YOLOv4 to tflite

时间秒杀一切 提交于 2021-01-29 09:23:56
问题 I'm trying to use yolo4 in my android project but I'm having problems with conversion. The code from: https://pypi.org/project/yolov4/ has worked well on Google-Colab , though it had some problem with my CUDA version on Jupyter notebook. I got conversion error from: yolo.save_as_tflite("yolov4.tflite") Error was long and I am not sure which part I should paste here. Can someone recommend some alternative method to convert tflite version of yolo4 (preferably working on colab )? 回答1: If you

Detect object by name of card and crop it using openCV

孤街醉人 提交于 2021-01-29 08:41:21
问题 I have a image with ID card, Bank card and signature i want to get id_card.jpg and bank_card.jpg and signature.jpg . The problem ID card and Bank card has the same width and height, i don't know how to detect each other. But the color is different suggestion possible get by color or the best idea is to get name of each card and after crop each card by name ?? I'm so new in this domain and i work in emergency project that why i will very grateful if someone can help me. The image look like

Normalizing images passed to torch.transforms.Compose function

老子叫甜甜 提交于 2021-01-29 07:21:53
问题 How to find the values to pass to the transforms.Normalize function in PyTorch? Also, where in my code, should I exactly do the transforms.Normalize? Since normalizing the dataset is a pretty well-known task, I was hoping there should be some sort of script for doing that automatically. At least I couldn't find it in PyTorch forum. transformed_dataset = MothLandmarksDataset(csv_file='moth_gt.csv', root_dir='.', transform=transforms.Compose([ Rescale(256), RandomCrop(224), transforms.Normalize

how to find the template matching accuracy

别来无恙 提交于 2021-01-29 06:55:50
问题 i am doing a template matching now,what i want to do is find the accuracy of template matching I have done template matching, but how do i get the accuracy i think i have to subtract the matched region and template image. how do i achieve this CODE import cv2 as cv import numpy as np import matplotlib.pyplot as plt img = cv.imread('image.jpg',0) img1 = img.copy() template = cv.imread('template.jpg',0) w, h = template.shape[::-1] method = ['cv.TM_CCOEFF_NORMED','cv.TM_CCORR_NORMED'] for meth

Using distortion co-efficients on a distorted image to un-distort

不想你离开。 提交于 2021-01-29 05:44:36
问题 Given the distortion co-efficients D = k1,k2,p1,p2,k3 of a pinhole model which is defined by radial and tangential distortion. How to undistort an image with these co-efficients? I know about the cv2.undistort() function. Can anyone explain me how to implement the undistortion function to perform iterative minimization? # TODO: Iterative minimization required r2 = x_ * x_ + y_ * y_ # Remove tangential distortion x_tangential = x_ - (2 * distort_coeffs[2] * x_ * y_ + distort_coeffs[3] * (r2 +

How do I take an Screenshot of my camera on EMGUCV 3.1?

这一生的挚爱 提交于 2021-01-29 05:30:52
问题 I'm doing a very simple program on EMGU CV, so I need to take a screenshot of what my camera is recording and save it in a specific folder, here follows my code of camera capture: ImageViewer viewer = new ImageViewer(); VideoCapture capture = new VideoCapture(); Application.Idle += new EventHandler(delegate (object sender, EventArgs e) { viewer.Image = capture.QueryFrame(); }); viewer.ShowDialog(); I apologize for the simple terms, I still really noob in programming. 回答1: It seems like you

import pyzbar.pyzbar - Unable to find zbar shared library

廉价感情. 提交于 2021-01-28 22:44:47
问题 I want to make a script for detecting and reading QR codes from photos. I would like to use PyZbar for that, but I have a problem with some errors. I'm working in google colaboratory !sudo apt install tesseract-ocr !pip install pytesseract !pip install pyzbar[scripts] import shutil import os import random import re import cv2 import numpy as np import pytesseract from pytesseract import Output %matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.pylab

OpenCV(4.0.0) assertion failed in function 'contourArea'

左心房为你撑大大i 提交于 2021-01-28 21:12:08
问题 My aim is to identify car logos using HOG descriptors. I am following tutorial linked https://gurus.pyimagesearch.com/lesson-sample-histogram-of-oriented-gradients-and-car-logo-recognition/# . I have testing and training images in separate folders. While extracting HOG features using following code: # import the necessary packages from sklearn.neighbors import KNeighborsClassifier from skimage import exposure from skimage import feature from imutils import paths import argparse import imutils

OpenCV(4.0.0) assertion failed in function 'contourArea'

吃可爱长大的小学妹 提交于 2021-01-28 20:45:17
问题 My aim is to identify car logos using HOG descriptors. I am following tutorial linked https://gurus.pyimagesearch.com/lesson-sample-histogram-of-oriented-gradients-and-car-logo-recognition/# . I have testing and training images in separate folders. While extracting HOG features using following code: # import the necessary packages from sklearn.neighbors import KNeighborsClassifier from skimage import exposure from skimage import feature from imutils import paths import argparse import imutils

Extracting digits from image with python and OpenCV

独自空忆成欢 提交于 2021-01-28 18:10:36
问题 I am looking for some coding solution/help to extract the digits from the LCD display and then output the value from the image. Below is the code and example images and how I got so far, but I need some further help to actually extract the "digits" from the image and output the value. I have made digits lookup table from an earlier example, # import the necessary packages from imutils.perspective import four_point_transform from imutils import contours import imutils import cv2 # define the