OpenCV

How to detect Blur rate of a face effectively in c++?

风格不统一 提交于 2021-02-20 05:24:23
问题 I am trying to detect blur rate of the face images with below code. cv::Mat greyMat; cv::Mat laplacianImage; cv::Mat imageClone = LapMat.clone(); cv::resize(imageClone, imageClone, cv::Size(150, 150), 0, 0, cv::INTER_CUBIC); cv::cvtColor(imageClone, greyMat, CV_BGR2GRAY); Laplacian(greyMat, laplacianImage, CV_64F); cv::Scalar mean, stddev; // 0:1st channel, 1:2nd channel and 2:3rd channel meanStdDev(laplacianImage, mean, stddev, cv::Mat()); double variance = stddev.val[0] * stddev.val[0]; cv:

How to detect Blur rate of a face effectively in c++?

安稳与你 提交于 2021-02-20 05:23:04
问题 I am trying to detect blur rate of the face images with below code. cv::Mat greyMat; cv::Mat laplacianImage; cv::Mat imageClone = LapMat.clone(); cv::resize(imageClone, imageClone, cv::Size(150, 150), 0, 0, cv::INTER_CUBIC); cv::cvtColor(imageClone, greyMat, CV_BGR2GRAY); Laplacian(greyMat, laplacianImage, CV_64F); cv::Scalar mean, stddev; // 0:1st channel, 1:2nd channel and 2:3rd channel meanStdDev(laplacianImage, mean, stddev, cv::Mat()); double variance = stddev.val[0] * stddev.val[0]; cv:

OpenPose linking error on std::thread

▼魔方 西西 提交于 2021-02-20 04:21:25
问题 So trying to build OpenPose from source, and was running into a linking problem. Current environment is Ubuntu 16.04.4. OpenCV version is 3.3.1. GCC version is 5.4.0. [ 87%] Built target openpose [ 87%] Linking CXX executable 1_extract_from_image.bin [ 87%] Linking CXX executable openpose.bin [ 87%] Linking CXX executable 3_user_input_processing_and_output.bin [ 87%] Linking CXX executable 2_extract_pose_or_heatmat_from_image.bin [ 87%] Linking CXX executable 1_custom_post_processing.bin [ 87

How to resize the window obtained from cv2.imshow()?

懵懂的女人 提交于 2021-02-20 04:15:26
问题 I started learning OpenCV today and I wrote a short code to upload (I don't know, if it's the right term) a random image: 1 It works fine, and I can open the image, but what I get is a big window and I can't see the full image unless I scroll it: 2 So, I'd like to know a way that I could see the whole image pretty and fine in a shorter window. 回答1: You can resize the image keeping the aspect ratio same and display it. #Display image def display(img, frameName="OpenCV Image"): h, w = img.shape

OpenCV - Blob/ Defect/ Anomaly Detection

旧街凉风 提交于 2021-02-20 04:11:33
问题 I'm doing an at-home project basically just for fun but I'm having more trouble than anticipated. I want to be able to find the pitch mark in this sample image. enter image description here I've followed some tutorials and things to load the image from a location and run simple blob detection on the image. My code currently is as follows -> import cv2 import numpy as np # Read in the image in grayscale img = cv2.imread('/home/pi/Downloads/divot1.jpeg', cv2.IMREAD_GRAYSCALE) params = cv2

How can I put a degree symbol (º) on an OpenCv Video?

孤街浪徒 提交于 2021-02-20 04:07:49
问题 I made a program which make a HUD over a video, getting info from sensors and plotting the results on the video frames, refreshing every frame, and for representing degrees (inclination) I need to plot a degree symbol, but what I get it's 2 symbols ("??") in the video show. I search through this site and others too. I can't do it!!!! please, I don't know what to do, it's just that little thing that I can't do it. This is the beginning of my program: import cv2 from random import * import

OpenCV - Blob/ Defect/ Anomaly Detection

丶灬走出姿态 提交于 2021-02-20 04:03:27
问题 I'm doing an at-home project basically just for fun but I'm having more trouble than anticipated. I want to be able to find the pitch mark in this sample image. enter image description here I've followed some tutorials and things to load the image from a location and run simple blob detection on the image. My code currently is as follows -> import cv2 import numpy as np # Read in the image in grayscale img = cv2.imread('/home/pi/Downloads/divot1.jpeg', cv2.IMREAD_GRAYSCALE) params = cv2

openCV imread limit for large or huge images Mat bug #3258

倖福魔咒の 提交于 2021-02-20 02:52:42
问题 I've been searching for days about this issue and didn't find any solved thread. I need loading pretty large images (4 GB and beyond, either .tiff / .png) into openCV code, by means of a simple src = imread(filepath, 1); I'm using Visual Studio 2013, C++. Though I'm using a 96Gb-RAM machine, runtime alerts are coming out when loading these large images by OpenCV's "imread" function. Been trying with smaller and smaller images/files untill the point they are indeed read/loaded, so we know it's

连Python都不熟也能跑通AI人脸识别?“隐藏Boss”竟是它!

*爱你&永不变心* 提交于 2021-02-19 17:06:29
摘要 :先把AI人脸识别跑起来,然后研究它是如何实现的,整个过程中确实收获不少。所谓先跟着做,再跟着学,实践与理论结合,自己感觉有理解了一些基础概念入个门,在此分享一下自己的捣鼓经验。 1、买台小“电脑” 既然要做人脸识别,那得找台带摄像头的小电脑啊。首先得价格便宜,简单搜了下,基本有以下几个选择: 树莓派4: ARM系统,生态好。价格合适,55刀。CPU在3个中最好,算力0.1TFLOPS K210:RISC-V的(非ARM),价格是最实惠的,299元。算力有0.8TOPS Jetson Nano:ARM系统,比树莓派4还贵,但是多一个英伟达的GPU(当然是丐版的GPU),价格99刀。算力0.47TFLOPS 这3个里面,考虑到人脸识别应该有更多的AI属性,那么带GPU能做AI推理不是更香么,于是就选择了英伟达的Jetson Nano开发板(主要也是想先入门英伟达的GPU派系,谁叫现在NVIDIA比较香呢)。 参考链接: https://www.zhihu.com/question/384561694 https://zhuanlan.zhihu.com/p/81969854 2、启动系统 这里需要先把“系统image”刷到 tf 卡里面,然后把tf卡插到开发板上,然后开机启动。启动有2个点需要注意: 跳线帽,需要插上(不然电源点不亮)。 第一次开机会卡住,需要重启一次。 启动后

How to detect water level in a transparent container?

社会主义新天地 提交于 2021-02-19 08:59:20
问题 I am using opencv-python library to do the liquid level detection. So far I was able to convert the image to gray scale and applying canny edge detection the container has been identified. import numpy as np import cv2 import math from matplotlib import pyplot as plt from cv2 import threshold, drawContours img1 = cv2.imread('botone.jpg') kernel = np.ones((5,5),np.uint8) #convert the image to grayscale imgray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) edges = cv2.Canny(imgray,120,230) I need to