Page 34 of 60

Re: PureBasic Interface to OpenCV

Posted: Fri Oct 16, 2015 7:31 pm
by acreis
Hi JHPJHP,

That's correct. The error remains in every cvResize() call, in every example.

I apreciate your support and I'll report any news.

Thank you

AReis

Re: PureBasic Interface to OpenCV

Posted: Sat Oct 17, 2015 5:38 am
by JHPJHP
Hi acreis,
acreis wrote:That's correct. The error remains in every cvResize() call, in every example.
Does the error occur as soon as the example is run or when a new image is selected?

If the latter, what happens if you change the default image to one that previously failed?
- change the last line of code: OpenCV("images/seams1.jpg")

My thoughts:
- this has nothing to do with the function cvResize beyond it requiring a definitive amount of memory
- after the initial run the memory is not correctly released (error points to the C run-time files)

I can duplicate the error you're receiving using a combination of a very large image with the function OpenFileRequester; the system crashed when the code reached the function cvResize. I modified the code not to use this function, and it still crashed at the next memory intensive function.

Have you tried a previous version of the following C Runtime files or uninstalling any previous versions?
- msvcp120.dll, msvcr120.dll

Other things to try / consider:
- can you reproduce the error on a second computer
- do you have the latest download
- have you tried the version OpenCV 3.0 32bit

Re: PureBasic Interface to OpenCV

Posted: Sat Oct 17, 2015 12:39 pm
by AAT
Hi acreis,
How much RAM in your computer?

Re: PureBasic Interface to OpenCV

Posted: Sat Oct 17, 2015 5:17 pm
by acreis
Hi AAT,

I apreciate your help about this issue.

I have access to that desktop computer only monday to friday, 9 to 5.

Then, I'll make some tests next week and I'll post the news.

Thank you very much.

ACReis

Re: PureBasic Interface to OpenCV

Posted: Sun Oct 18, 2015 1:48 pm
by AAT
Hi,
i've got an error in example cv_inpaint.pb with very large image 19712x13056 pix 24 bit http://rghost.ru/private/7PdT5JGQF/20b0 ... 07afc614ec

Image

WindowsXP 32 bit, RAM=2GByte, OpenCV 2.4.11, msvcp120.dll, msvcr120.dll
Errors weren't with images of the smaller sizes.

Re: PureBasic Interface to OpenCV

Posted: Sun Oct 18, 2015 1:59 pm
by JHPJHP
Hi AAT,

See this post: http://www.purebasic.fr/english/viewtop ... 48#p474548
- open an image without the function OpenFileRequester

You can test this by changing the default image to one that previously failed.
- last line of code: OpenCV( [ path to image here ] )
- http://www.purebasic.fr/english/viewtop ... 10#p474610

Re: PureBasic Interface to OpenCV

Posted: Sun Oct 18, 2015 2:08 pm
by AAT
Hi, JHPJHP!
You are right, there is no error if i start the program with this large image as a default image... :oops:

Re: PureBasic Interface to OpenCV

Posted: Sun Oct 18, 2015 4:06 pm
by acreis
Hi,

I have set up a VMBOX with 192 MB RAM Windows Xp SP3 32bits

All examples run fine Please note the small amount of Ram

I think some particular config of hardware/softare is responsible by the issue I reported before, not RAM amount

I'll keep you updated about my investigation

Thanks

Acreis

Re: PureBasic Interface to OpenCV

Posted: Mon Oct 19, 2015 10:45 am
by acreis
Hi AAT,

The desktop config is: Intel Core i5-650 / 3GB RAM.

There is a lot of versions of msvc run time libraries in folder Windows\System32, including version 12.

This is a corporate computer with very restritive policies, but I have compiled and run successfuly many purebasic programs, after excluding my working folder of being verified by symantec antivirus.

I'll keep you updated about any progress in this issue.

Thanks

ACReis

Re: PureBasic Interface to OpenCV

Posted: Fri Nov 06, 2015 12:09 pm
by JHPJHP
Updated:
- modified a filter in the stitching examples producing a sharper final image
-- le_stitching_1.pb, le_stitching_2.pb
- added a new example
-- cv_steganography.pb


Steganography is the practice of concealing a file, message, image, or video within another file, message, image, or video.

There are many ways to approach this...

I chose to conceal text in an image by slightly changing pixel colors at a set increment. The pixel variance is calculated using (Ascii-Table) decimal values derived from a predefined message, then added / removed to the RGB set. By comparing the modified image to the original image the encrypted text can be extracted.

- the default image or any new images loaded using the context menu will be recalculated to include the changed pixels
- press the spacebar to decrypt the changed pixels, revealing the concealed text in notepad

Re: PureBasic Interface to OpenCV

Posted: Mon Nov 09, 2015 1:11 pm
by JHPJHP
Updated:
- added 1 example
-- cv_color_transfer.pb: performs a color transfer between two images

Based on script found here.

This example is a nice compliment to cv_pseudo_colors.pb.
- cv_color_transfer.pb: use the context-menu [ Open ] to change the filter, press Spacebar to see original image
- cv_pseudo_colors.pb: use the context-menu [ Open ] to change the main image, press Spacebar to switch between 3 image filters

NB*: I came by this example looking for a solution to equalize colors across multiple images to enhance the stitching examples. Based on some initial testing it seems to be a good start.

Re: PureBasic Interface to OpenCV

Posted: Tue Nov 10, 2015 6:55 pm
by JHPJHP
Updated:
- the following examples have been modified
-- cv_cam_logo.pb, cv_color_transfer.pb, cv_inpaint.pb, cv_norm.pb

Most notably the example cv_inpaint.pb has been rewritten to better showcase its use.
- default image opens with 20 randomly placed simulated "scratches" (white lines)
- use the [ < / > KEYS ] to adjust the inpaint size (cannot be used after pressing the Spacebar)
- use the [ I KEY ] to toggle the inpainting method (should be done before manually marking areas, cannot be used after pressing the Spacebar)
- use the mouse pointer to manually mark additional areas for correction (cannot be used after pressing the Spacebar)
- press the Spacebar the first time to mark the scratched areas, press it a second time to correct the scratched (marked) areas
- press the enter key at any time to reset the image, adding a new set of randomly placed simulated scratches

In a real-world application the detection method would be automated using various filters.

NB*: The larger the inpaint size the more noticeable the correction.

Re: PureBasic Interface to OpenCV

Posted: Wed Nov 11, 2015 1:29 pm
by AAT
Hi, JHPJHP,
Thank you for your new examples!

I tested the example cv_steganography.pb, it incorrectly works for me.
The problem is in ExtractText procedure:

Code: Select all

...
  hWnd = FindWindow_(#Null, "Untitled - Notepad")
...
In my version of Windows with Russian language this line should be

Code: Select all

...
  hWnd = FindWindow_(#Null, "Безымянный - Блокнот")
...
I think the same problem will take place in Windows with others not English languages.

Good luck!

Re: PureBasic Interface to OpenCV

Posted: Wed Nov 11, 2015 1:37 pm
by RSBasic
Maybe this code?

Code: Select all

...
  hWnd = FindWindow_("notepad", #Null)
...
Or EnumWindows_().

Re: PureBasic Interface to OpenCV

Posted: Wed Nov 11, 2015 2:46 pm
by AAT
RSBasic,

Code: Select all

hWnd = FindWindow_("notepad", #Null)
it works, thanks!

Good luck!