crash in cvBlobsLib VS2008 - opencv

I am using cvBlobsLib library for a blob detection work, however, i am facing a crash in the program in the code.
My code crashes at this point:
CBlobResult blobs;
blobs = CBlobResult(imageSkinPixels, NULL, 0);

imageSkinPixels must be a single-channel image: in other words, you need to convert your RGB image to GRAY before passing it to CBlobResult().
Also, we don't know what is the type of imageSkinPixels, but it should be a pointer to IplImage.
That's all I can say with the code you shared. If this doesn't fix the problem you'll need to share more code.

Related

FFT in C++ AMP Throw CLIPBRD_E_CANT_OPEN error

I am trying to use C++ AMP in Visual C++ 2017 on Windows 10 (updated to the latest) and I find the archived FFT library from C++ AMP team on codeplex. I try to run the sample code, however the program throws ran out of memory error when creating DirectX FFT. I solve that problem by following the thread on Microsoft forum.
However, the problem doesn't stop. When the FFT library tries to create Unordered Access View, it throws error of CLIPBRD_E_CANT_OPEN. I did not try to operate on clipboard anyhow.
Thank you for reading this!
It seems I solve the problem. The original post mentioned that we need to create a new DirectX device and then create accelerator view upon it. Then I pass that view to ctor of fft as the second parameter.
fft(
concurrency::extent<_Dim> _Transform_extent,
const concurrency::accelerator_view& _Av = concurrency::accelerator().default_view,
float _Forward_scale = 0.0f,
float _Inverse_scale = 0.0f)
However, I still have crashes of the CLIPBRD_E_CANT_OPEN.
After reading the code, I realize that I need to create array on that DirectX views too. So I started to change:
array<std::complex<float>,dims> transformed_array(extend, directx_acc_view);
The idea comes from the different behaviors of create_uav(). The internal buffers and the precomputing caused no problem, but the samples' calls trigger the clipboard error. I guess the device matters here, so I do that change.
I hope my understanding is correct and anyway there is no such errors now.

Acces Violation during .png saving

When I try to call SaveToFile method on TPNGImage object I get Acces Violation Error.
PNG Construction:
pngTest:=TPngImage.CreateBlank(COLOR_GRAYSCALE, 16, 2048, 2048);
Method Call: pngTest.SaveToFile('testtttt.png');
PNG object is created correctly because I can assign it to TImage and it works.
This is a defect in the Delphi PNG library code. Please report it to Embarcadero.
The defect seems to be triggered by the use of 16 bit colour depth. If you switch the code to use 8 bit colour then the code runs successfully.
There's no simple workaround, and so you'll need to find a different PNG library if you wish to continue with 16 bit colour. I would expect that Microsoft's Windows Imaging Component library will function correctly. Or you might consider Graphics32 with the GR32PNG extension.

Moving an image with fs causes it to corrupt

I'm using AdonisJS framework, and it has its own method move(), that uses fs.
The issue is that when making use of this method, the image that's moved is corrupted, and when oepning it, this message is shown:
Error interpreting JPEG image file (Not JPEG file: starts with 0xef 0xbf)
The documentation I based on is this, so my code is no much different than it.

Using OSVR camera in OpenCV 3

I'm trying to use the OSVR IR camera in OpenCV 3.1.
Initialization works OK.
Green LED is lit on camera.
When I call VideoCapture.read(mat) it returns false and mat is empty.
Other cameras work fine with the same code and VLC can grab the stream from the OSVR camera.
Some further testing reveals: grab() return true, whereas retrieve(mat) again returns false.
Getting width and height from the camera yields expected results but MODE and FORMAT gets me 0.
Is this a config issue? Can it be solved by a combination of VideoCapture.set calls?
Alternative Official answer received from the developers (after my own solution below):
The reason my camera didn't work out of the box with OpenCV might be that it has old firmware (pre-v7).
Work around (or just update firmware):
I found the answer here while browsing anything remotely linked to the issue:
Fastest way to get frames from webcam
You need to specify that it should use DirectShow.
VideoCapture capture( CV_CAP_DSHOW + id_of_camera );

OpenCV Line-Mod problems with Images

I'm trying to use line-mod (in special line-2d) in opencv 2.4 to compare images. At the moment I try to change the test-implementation linemod.cpp to use an input images instead of the camera, but without any success.
I tried to load an image via imread('...', CV_LOAD_IMAGE_COLOR); and pushed that in the sources vector but got a 'OpenCV Error: Assertion failed (response_map.rows % T == 0) in linearize' error.
If I load a CV_LOAD_IMAGE_GRAYSCALE image the run stops at detector->match with the error 'Thread 1: EXC_BAD_ACCESS (code=1, address=0x11310f000)'.
I don't understand what makes the difference between images coming from a VideoCapturer and from imread...
Is there anyone out there that may help me? I'm totally lost ... again ;-)
(For example sample code for matching two objects from images with linemod would be absolutely great!)
I use opencv 2.4 with xcode on a mac.
Maybe it is too late for an answer, but I am also interested in the algorithm
In the OpenCV Minutes 2012-06-26 ( http://code.opencv.org/projects/opencv/wiki/2012 ) you can read:
Will work with Stefan Hinterstoisser for final version of LINEMOD by September
So if you did not already solve it, you may want to wait.

Resources