Ask Your Question
0

Odd issue with OpenCV

asked 2017-02-20 18:51:24 -0600

trickbiker121 gravatar image

I have created a classification python script using openCV and Tensorflow. One issue I have is that after running the script in a loop the captured frames from the camera just become noise. I am using is a Creative 720P live cam. Running this script with another camera runs without any issues. Any idea what could cause the camera frames to go bad after awhile? Running just imread and imshow with the creative camera works fine for days.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-21 03:55:15 -0600

Running this script with another camera runs without any issues.

Then that means your Creative720P live cam will return a not standard image format. Make sure you know which format is returned and capture it in the correct way.

Any idea what could cause the camera frames to go bad after awhile?

No because we did not get any piece of code. Also, if it works on another camera, it would be strange if it is due to your code, more likely its the grabbing interface.

edit flag offensive delete link more

Comments

This issue does not seem to be my code or not standard image format because opencv is able to properly read the images when starting the loop. This code works on other PC's with different cameras for days without any issues. If it helps the CPU usage fluctuates when the image goes bad.

trickbiker121 gravatar imagetrickbiker121 ( 2017-02-22 19:25:05 -0600 )edit

So some images from the creative cam are actually visualised correctly? If so it could be an issue in the data transfer protocol. Do you perform an empty check on each frame before using it further?

StevenPuttemans gravatar imageStevenPuttemans ( 2017-02-25 02:40:40 -0600 )edit

I do check for empty frames but it does not consider the images with just noise as empty. What I did to get around this is by creating two scripts one script that just takes photos and saves it to the HDD and another that reads the image analyzes it with Tensorflow. This has been running for two weeks with no issues of bad images.

trickbiker121 gravatar imagetrickbiker121 ( 2017-03-05 11:13:32 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-02-20 18:51:24 -0600

Seen: 250 times

Last updated: Feb 21 '17