PureBasic Interface to OpenCV
-
- New User
- Posts: 4
- Joined: Fri Jan 12, 2018 8:26 am
Re: PureBasic Interface to OpenCV
Hello JHPJHP,
First of all, thanks a lot for your work, i'm using it to take photo with an integrated webcam of a HP Tablet but i have a problem to change the resolution.
The webcam is capable of streming in 1080p and can take 5mp photo (rear cam OV5670, wich works great with windows camera app) but whenever I try a resolution above 1280x960 it falls back to it.
The example "pb_webcam_resolution.pb" actually shows that the max resolution is 1280x960 but the windows camera app can take photo above that.
I tried to set FOURCC with MJPG or YUY2 but it didn't help.
Have you an idea?
Thanks!
First of all, thanks a lot for your work, i'm using it to take photo with an integrated webcam of a HP Tablet but i have a problem to change the resolution.
The webcam is capable of streming in 1080p and can take 5mp photo (rear cam OV5670, wich works great with windows camera app) but whenever I try a resolution above 1280x960 it falls back to it.
The example "pb_webcam_resolution.pb" actually shows that the max resolution is 1280x960 but the windows camera app can take photo above that.
I tried to set FOURCC with MJPG or YUY2 but it didn't help.
Have you an idea?
Thanks!
Re: PureBasic Interface to OpenCV
Hi JHPJHP!
Sorry, I will try to answer the question posed to you.
Hi, mcederavic.
Your OV5670 have 2592*1944 image size (max).
So, in the exmple pb_webcam_resolution.pb try to change
to
Sorry, I will try to answer the question posed to you.
Hi, mcederavic.
Your OV5670 have 2592*1944 image size (max).
So, in the exmple pb_webcam_resolution.pb try to change
Code: Select all
Procedure ResolutionList(MaxWidth = 1280, nInterval = 100)
Code: Select all
Procedure ResolutionList(MaxWidth = 2592, nInterval = 162)
-
- New User
- Posts: 4
- Joined: Fri Jan 12, 2018 8:26 am
Re: PureBasic Interface to OpenCV
Hello AAT,
Thanks for your reply, unfortunately it did not change. Available resolutions are still 640x360 or 1280x960
Thanks for your reply, unfortunately it did not change. Available resolutions are still 640x360 or 1280x960
Re: PureBasic Interface to OpenCV
mcederavic, specify the exact name of your HP Tablet, please.
I think, your tablet have two cams and you trying to set high resolution to cam with low resolution, forexample, to front cam.
Add one more change to example: change the cam number
to
or other number, not 0
I think, your tablet have two cams and you trying to set high resolution to cam with low resolution, forexample, to front cam.
Add one more change to example: change the cam number
Code: Select all
*capture = cvCreateCameraCapture(#CV_CAP_ANY)
Code: Select all
*capture = cvCreateCameraCapture(1)
or other number, not 0
-
- New User
- Posts: 4
- Joined: Fri Jan 12, 2018 8:26 am
Re: PureBasic Interface to OpenCV
Yes I took the rear cam (and I see the rendered preview in the window)
The tablet is a HP Notebook x2 - 10-p028nf
I tried to capture in 1920x1080 with VLC but it fail to initialize too... I'm wondering if it is a hardware / driver lock
The tablet is a HP Notebook x2 - 10-p028nf
I tried to capture in 1920x1080 with VLC but it fail to initialize too... I'm wondering if it is a hardware / driver lock
Re: PureBasic Interface to OpenCV
Hi mcederavic,
Try the following: ... OpenCV access webcam maximum resolution
- set the resolution to something larger (e.g. 3000x3000)
You may also want to try a different version of the download: PureBasic Interface to OpenCV 2.4.13.3 vs PureBasic Interface to OpenCV 3.3.
- OpenCV 3.3 was built using the World option (single DLL / LIB)
Try the following: ... OpenCV access webcam maximum resolution
- set the resolution to something larger (e.g. 3000x3000)
If you are live streaming from your tablet, have you looked at the FFMPEG / RTSP example.stackoverflow wrote:I got it to work, so this post is for others experiencing the same problem:
I am running on the Logitech C270 as well. For some reason it would only show 640x480 even though the webcam supports 1280x720. Same issue persists with the built-in webcam in my laptop.
If I set it to 800x600 in the code it shows 640x480. However, if I set it to 1024x768 it becomes 800x600. And if I set it to something silly like 2000x2000 it becomes 1280x720.
This is in C++ on OpenCV 3.0, but perhaps it applies to Python as well.
You may also want to try a different version of the download: PureBasic Interface to OpenCV 2.4.13.3 vs PureBasic Interface to OpenCV 3.3.
- OpenCV 3.3 was built using the World option (single DLL / LIB)
Re: PureBasic Interface to OpenCV
mcederavic, read this topic http://www.purebasic.fr/english/viewtop ... 12&t=69059
Download opencv libs with reordered mediaSubtypes from http://rgho.st/84FfzcJrp
Replace the opencv libraries from the JHPJHP package with downloaded ones and try your code again.
Download opencv libs with reordered mediaSubtypes from http://rgho.st/84FfzcJrp
Replace the opencv libraries from the JHPJHP package with downloaded ones and try your code again.
-
- New User
- Posts: 4
- Joined: Fri Jan 12, 2018 8:26 am
Re: PureBasic Interface to OpenCV
Hello AAT / JHPJHP
I tried both OpenCV 2.4.13 and 3.3 and got same results. I also tried all known resolution and iterating up to 8192x8192 one by one but the max alowed is always 1288x960 event with the reordered lib.
I will try with an external usb cam.
Thanks for your help!
I tried both OpenCV 2.4.13 and 3.3 and got same results. I also tried all known resolution and iterating up to 8192x8192 one by one but the max alowed is always 1288x960 event with the reordered lib.
I will try with an external usb cam.
Thanks for your help!
Re: PureBasic Interface to OpenCV
Hi JHPJHP,
thanks for these great codes and for your work.
I have a problem with tesseract and german traineddata. I downloaded this file:
https://github.com/tesseract-ocr/tessda ... raineddata
After that I copied the file into the folder "binaries\tesseract\tessdata" and changed it in the sourcecode
If I run the code I get an memory-error (Read-Error ad Address 0) in pb_tesseract.pbi - Line 104
It seems, that there is a conflict with the traineddata file. Am I missing something?
Do you have a suggestion?
Thanks,
Morty
thanks for these great codes and for your work.
I have a problem with tesseract and german traineddata. I downloaded this file:
https://github.com/tesseract-ocr/tessda ... raineddata
After that I copied the file into the folder "binaries\tesseract\tessdata" and changed it in the sourcecode
Code: Select all
hAPI = TesseractInit(#PSM_AUTO, #OEM_TESSERACT_ONLY, #PB_Compiler_FilePath + "binaries/tesseract/tessdata", "deu", #Null$)
Code: Select all
If TessBaseAPIInit1(hAPI, dictionarypath, language, OEM, @CFG, 1) : TessBaseAPIEnd(hAPI) : Else : ProcedureReturn hAPI : EndIf
Do you have a suggestion?
Thanks,
Morty
Re: PureBasic Interface to OpenCV
Hi Morty
The problem is with the traineddata version; try the following link:
- Data Files for Version 3.02
Another option is to replace the binaries with the current version, but then you may also have to update the code.
The problem is with the traineddata version; try the following link:
- Data Files for Version 3.02
Another option is to replace the binaries with the current version, but then you may also have to update the code.
Re: PureBasic Interface to OpenCV
Good morning JHPJHP,
I thank you a thousand times With these files it works. I only wonder a bit, because the german files are much smaller than the origin english wone.
Where is the donation button?
- Morty
I thank you a thousand times With these files it works. I only wonder a bit, because the german files are much smaller than the origin english wone.
Where is the donation button?
- Morty
Re: PureBasic Interface to OpenCV
Hi Morty,
I am glad I was able to help. It is nice to know that the interface has found an audience.
I am glad I was able to help. It is nice to know that the interface has found an audience.
Sorry, I cannot find any documentation on why the file sizes are so different, but it is standard across versions.Morty wrote:... I only wonder a bit, because the german files are much smaller than the origin english wone.
Not necessary, but if you still want to buy me a coffee... My PureBasic Stuff - Unfinished (website) located in the footer of my posts, has a Donate button.Morty wrote:Where is the donation button?
Re: PureBasic Interface to OpenCV
Good morning,
I've send you a few dollars for coffee
Thank you again and have a nice day.
- Morty
I've send you a few dollars for coffee
Thank you again and have a nice day.
- Morty
Re: PureBasic Interface to OpenCV
Hi Morty,
Cheers
I just noticed that you had not read my PM, and I wanted you to know that I am grateful for the coffee.Good morning,
I've send you a few dollars for coffee
Thank you again and have a nice day.
- Morty
Cheers
Re: PureBasic Interface to OpenCV
Updated: ( OpenCV 2.4.13.3 to OpenCV 2.4.13.6 )
- Demo Download: PureBasic Interface to OpenCV :: 32 bit
- Main Download: PureBasic Interface to OpenCV :: 32 bit
- Demo Download: PureBasic Interface to OpenCV :: 64 bit
- Main Download: PureBasic Interface to OpenCV :: 64 bit
Other Changes:
- replaced reference files
- removed 4 examples (might be temporary)
- removed MS Runtime DLLs (users with an older version of Windows may need to provide their own)
NB*: When time permits, I will be updating the rest of the packages.
- Demo Download: PureBasic Interface to OpenCV :: 32 bit
- Main Download: PureBasic Interface to OpenCV :: 32 bit
- Demo Download: PureBasic Interface to OpenCV :: 64 bit
- Main Download: PureBasic Interface to OpenCV :: 64 bit
Other Changes:
- replaced reference files
- removed 4 examples (might be temporary)
- removed MS Runtime DLLs (users with an older version of Windows may need to provide their own)
NB*: When time permits, I will be updating the rest of the packages.