GithubHelp home page GithubHelp logo

computervision's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

computervision's Issues

Gpu support not working

After succesfully building OpenCV with CUDA support for python (windows 10) and anaconda I get this error when I run a test script:

OpenCV(4.5.3) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-u4kjpz2z\opencv\modules\core\include\opencv2/core/private.cuda.hpp:106: error: (-216:No CUDA support) The library is compiled without CUDA support in function 'throw_no_cuda' File "D:\OpenCV\main.py", line 5, in <module> (Current frame) cuda.printCudaDeviceInfo(0)

Very important: the cuda.printCudaDeviceInfo(0) command worked well when I tested it in cmd

Coordinate drift in liveCameraPoseEstimation.py

Hello, I have been digging into the liveCameraPose script and am actually very impressed with the usability. However, I have noticed an issue where, if the camera is stationary, after short time the coordinates begin to exponentially drift. Is this something that is expected due to scale estimation? Are there any usable/reliable methods to reducing this coordinate drift?

I am guessing some sort of correction step would be the most logical approach but I am not sure how that would work. Anyone else have any thoughts on this?

headPoseEstimation.py

At line 126

Exception has occurred: AttributeError
module 'mediapipe.python.solutions.face_mesh' has no attribute 'FACE_CONNECTIONS'
File "C:\Users\gauravy\Music\DMS all\Head orientation\original.py", line 126, in
connections=mp_face_mesh.FACE_CONNECTIONS,
AttributeError: module 'mediapipe.python.solutions.face_mesh' has no attribute 'FACE_CONNECTIONS'

Stereo depth estimation

Hi dear nico, i guess your name is nico :-);
Thank you a lot for sharing this very rich project.
For now i m making some research about 3d reconstruction trought stereo camera and structured light procam systems using opencv.
I just want to ask you if it is possible to calibrate and get depth map using charuco board
I found that using charuco board for camera calibration is more precise and very fast

Error While model.forward ()

: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\dnn.cpp:1143: error: (-213:The function/feature is not implemented) Unknown backend identifier in function 'cv::dnn::dnn4_v20211004::wrapMat'

Can't find opencv

Following your yt tutorial "How To Install OpenCV C++ and Set It Up in Visual Studio Code with CMake" and tried "Camera Calibration With Code and Example in C++ - Computer Vision and OpenCV C++", when running camera calibration in vscode it showed "fatal error: opencv2/calib3d.hpp: No such file or directory". After watching your vids closely found out you have more files in yours (external dependencies...). I wonder did I download the wrong camera Calibration file (this one only contains pic files and main.cpp) or I missed something?

Stereo Calibration error

Hi, I tried using calibration.py and stereo_calibration.py to calibrate and remap my stereo camera system. After many attempts with my stereo camera, I tried your dataset just to ensure that it works how it should and I got this result (https://ctrlv.link/gui8). Does anyone have any idea what could be the problem, any help is greatly appreciated, I've been stuck for days trying different solutions

Missing model file

Hey, Im looking for the model file model-f6b98070.onnx (MiDaS v2.1 Large). Where can I find it?

Error running LiveCameraTrajectory

Hi,
I have a bit of problem getting the LiveCameraTrajectory running.
When I start the code it does run for 2 secounds but after that im getting this error ?
I've tried to lower the keypoints but it does not help....
Do you have any idea what it could be ?

 F:\CamTracker\venv\lib\site-packages\numpy\linalg\linalg.py:2541: RuntimeWarning: overflow encountered in multiply
  s = (x.conj() * x).real
F:\CamTracker\liveCameraPoseEstimation.py:217: RuntimeWarning: invalid value encountered in matmul
  P = np.matmul(np.concatenate((self.K, np.zeros((3, 1))), axis=1), T)
F:\CamTracker\liveCameraPoseEstimation.py:276: RuntimeWarning: invalid value encountered in matmul
  cur_pose = cur_pose @ transf
F:\CamTracker\venv\lib\site-packages\numpy\linalg\linalg.py:2542: RuntimeWarning: overflow encountered in reduce
  return sqrt(add.reduce(s, axis=axis, keepdims=keepdims))

The values in the "liveCameraPoseEstimation.py " file are going as NaN or Inf.

I calibrated the camera and when I run it, it gives certain values for a while and then writes NaN, the program throws an error.

/usr/lib/python3/dist-packages/numpy/linalg/linalg.py:2561: RuntimeWarning: overflow encountered in reduce
  return sqrt(add.reduce(s, axis=axis, keepdims=keepdims))
Traceback (most recent call last):
  File "liveCameraPoseEstimation.py", line 369, in <module>
    pc.plot_camera(ax, vo.K, camera_pose_poses[i],
  File "/home/.local/lib/python3.10/site-packages/pytransform3d/camera.py", line 266, in plot_camera
    cam2world = check_transform(cam2world, strict_check=strict_check)
  File "/home/.local/lib/python3.10/site-packages/pytransform3d/transformations/_utils.py", line 35, in check_transform
    check_matrix(A2B[:3, :3], strict_check=strict_check)
  File "/home/.local/lib/python3.10/site-packages/pytransform3d/rotations/_utils.py", line 476, in check_matrix
    raise ValueError(error_msg)
ValueError: Expected rotation matrix, but it failed the test for inversion by transposition. np.dot(R, R.T) gives array([[nan, nan, nan],
       [nan, nan, nan],
       [nan, nan, nan]])

Contact Information

Hey Nicolai,
My name is Dr. Georgi Talmazov and I am a prosthodontics resident at University of Texas School of Dentistry at Houston. I am currently working on an open source project that utilizes computer vision in dentistry. Particularly pertaining to dental occlusion and masticatory function. I tried searching for your email so I can send a more detailed description of the project but I could not find one, hence I am on here. The point where I am at in the project is beginning to stretch the limit of my knowledge in OpenCV. I watched several of your videos but I have difficulty translating this into the project. If you have a 30 mins and are interested in helping out let me know. Otherwise feel free to close and delete this ticket.

Best,
Georgi

[email protected]

depth_to_distance

Hi Nico,

I am referring to your script depthFaceTracker.py where I check the function depth_to_distance. I want to know how your choose return value -1.7 * depth + 2 ?

cv2 error at "cameraCalibration.py"

Hi there, actually i was following your open cv tutorial on youtube. I was testing your cameraCalibration.py script with my camera image. But after running the script , it's giving me a cv2 error, i.e.

File "camCalib.py", line 61, in <module>
 ret, cameraMatrix, dist, rvecs, tvecs = cv.calibrateCamera(objpoints, imgpoints, frameSize, None, None)
cv2.error: OpenCV(4.5.5) /io/opencv/modules/calib3d/src/calibration.cpp:3694: error: (-215:Assertion failed) nimages > 0 in function 'calibrateCameraRO'

I tried to print the obj_points: [] and imgPoints: [], but they're blank. so I tried to print the ret and corners, but they're false and none.

so, can you please tell me that is there any thing I'm missing?

the code:

import numpy as np
import cv2 as cv
import glob



################ FIND CHESSBOARD CORNERS - OBJECT POINTS AND IMAGE POINTS #############################

chessboardSize = (24,17)
frameSize = (1440,1080)



# termination criteria
criteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 30, 0.001)


# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((chessboardSize[0] * chessboardSize[1], 3), np.float32)
objp[:,:2] = np.mgrid[0:chessboardSize[0],0:chessboardSize[1]].T.reshape(-1,2)

size_of_chessboard_squares_mm = 20
objp = objp * size_of_chessboard_squares_mm


# Arrays to store object points and image points from all the images.
objpoints = [] # 3d point in real world space
imgpoints = [] # 2d points in image plane.


images = glob.glob('*.jpeg')

for image in images:

    img = cv.imread(image)
    gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)

    # Find the chess board corners
    ret, corners = cv.findChessboardCorners(gray, chessboardSize, None)

    # If found, add object points, image points (after refining them)
    if ret == True:

        objpoints.append(objp)
        corners2 = cv.cornerSubPix(gray, corners, (11,11), (-1,-1), criteria)
        imgpoints.append(corners)

        # Draw and display the corners
        cv.drawChessboardCorners(img, chessboardSize, corners2, ret)
        cv.imshow('img', img)
        cv.waitKey(1000)


cv.destroyAllWindows()




############## CALIBRATION #######################################################

ret, cameraMatrix, dist, rvecs, tvecs = cv.calibrateCamera(objpoints, imgpoints, frameSize, None, None)


############## UNDISTORTION #####################################################

img = cv.imread('05.png')
h,  w = img.shape[:2]
newCameraMatrix, roi = cv.getOptimalNewCameraMatrix(cameraMatrix, dist, (w,h), 1, (w,h))



# Undistort
dst = cv.undistort(img, cameraMatrix, dist, None, newCameraMatrix)

# crop the image
x, y, w, h = roi
dst = dst[y:y+h, x:x+w]
cv.imwrite('caliResult1.jpeg', dst)



# Undistort with Remapping
mapx, mapy = cv.initUndistortRectifyMap(cameraMatrix, dist, None, newCameraMatrix, (w,h), 5)
dst = cv.remap(img, mapx, mapy, cv.INTER_LINEAR)

# crop the image
x, y, w, h = roi
dst = dst[y:y+h, x:x+w]
cv.imwrite('caliResult2.jpeg', dst)




# Reprojection Error
mean_error = 0

for i in range(len(objpoints)):
    imgpoints2, _ = cv.projectPoints(objpoints[i], rvecs[i], tvecs[i], cameraMatrix, dist)
    error = cv.norm(imgpoints[i], imgpoints2, cv.NORM_L2)/len(imgpoints2)
    mean_error += error

print( "total error: {}".format(mean_error/len(objpoints)) )

Please upload back objectdetection.py file

Hi,
I have watched your video regarding 3D object detection with MediaPipe and openCV, unfortunately when I was going to check the code, it has been deleted. Can you please upload it back? appreciate for your help, thanks!

Camera calibration issue estimating camera intrinsic parameters

Hi Nicolai,
I am trying to use the code you provide in CameraCalibration.py to carry out a single camera calibration using a chessboard (7x9, 20mm square, frameSize = 640x480).
I use the RGB channel of an Intel D455, in order to use the real camera intrinics parameters and distortion coefficients as reference, from the methods directly provided by Realsense.
However, extracting camera intrinsics parameters and distortion coefficients, I get values which differs from the one provided by Realsense:

Python	       Realsense

fx 379.19 379.0404
fy 380.327 379.575531
cx 226.9 230.311981
cy 326.31 322.188538
d1 0.00053418 -0.058406677
d2 0.0016563 0.071961016
d3 0.00030966 -0.000692392
d4 0.00017886 -0.000478269
d5 -0.001937583 -0.022303361

These are the images used
Img_0
Img_1
Img_2
Img_3
Img_4
Img_5
Img_6
Img_7
Img_8
Img_9

However, the results regarding the camera's intrinsic parameters and distortion coefficients vary significantly each time I capture new images, making the captures unrepeatable.

Is there something that I am missing in carrying out the calibration procedure? Have you any suggestion to handle this issue?

I take this opportunity to thank you for all the content you create and for the examples you provide with your videos!
Best regards,

Luca D'Ambrosio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.