|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Image Threshold Produces Black Image
Awesome thanks for the info.
I will try writing out a bmp later and hopefully see some more helpful results. I'll have to take a closer look at the BinaryImage class too, I didn't look to much at it's interface because we're doing the bulk of processing in the generated C code, and only just added the HSV conversion in the calling code to try debugging this. |
|
#2
|
||||
|
||||
|
Re: Image Threshold Produces Black Image
I must say that the C++ library is quite straight forward and seems to work quite well too.
AxisCamera::GetImage returns ColorImage* ... (or HSLImage* due to inheritance) ColorImage::ThresholdHSL returns BinaryImage* and BinaryImage:: has the particle analysis routines. Tada. Right down the line...very little babysitting other than making sure to delete the pointers given back to you or handle the GetImage differently by passing in your own ColorImage address. bob |
|
#3
|
|||||
|
|||||
|
Re: Image Threshold Produces Black Image
A binary image has pixel values of 0 and 1. That will display on a grayscale indicator as black and just slightly less black. Change the color palette of the image display to binary and you'll see it in much better contrast.
|
|
#4
|
|||
|
|||
|
Re: Image Threshold Produces Black Image
So, we've had some success, though not in the way I expected.
The core issue was that we were attempting to do an HSV threshold on an RGB color image we aquired from the camera. I switched to acquiring an HSL image from the camera and performing an HSL threshold on it, and was able to get some meaningful results. On the PC, when FTPing the firefox preview (and I'm pretty sure MS Paint) does properly display a binary bitmap as black and red, I didn't try writing out a jpeg this way to see if it worked that way though. A follow up question, for the sake of discussion: (note: We are using a green light ring for activating the retroreflective tape) Are there any advantages to using HSV over HSL? Would it be worth figuring out how to use that colorspace? It doesn't seem to be directly available through ColorImage. We chose HSV semi-arbitrarily, so I'm not sure if it's worth the fight to go back to it, or if we should just tune for HSL. |
|
#5
|
||||
|
||||
|
Re: Image Threshold Produces Black Image
If you're looking to change colorspace and see what happens, go back (or start using) NI Vision Assistant. After acquiring an image and beginning to process it, if you go to the "threshold" processing area in the 2nd tab, you can select "RGB", "HSL", "HSV" etc in a drop-down list and then play with the filtering min/max values. This will give you the ability to experiment and see what works best. Then use those values in your actual call in C/C++ once you're happy with it.
The white paper on target finding this year goes into HSL/HSV to a decent degree BTW. bob |
|
#6
|
|||
|
|||
|
Re: Image Threshold Produces Black Image
The problem I encountered was occurring with the output from vision assistant, I switched to using the colorImage->threshold function after getting the black screen there. The vision assistant seems to perform some extra steps on the jpg you give it to put it into the proper color space, which doesn't get done in the generated c code.
Perhaps I need to close the loop on this whole fiasco, it maybe that it originally worked fine doing the conversion in the generated code, but combination of bad particle analysis decomposition and from writing my binary image as a jpeg caused it to look 'broken'. But, throughout this, our vision assistant script has given us the expected result, while we were unable to get any results from the C++/c code (until switching color space). |
|
#7
|
||||
|
||||
|
Re: Image Threshold Produces Black Image
So, if I read this right, you're on your way to health. Yes? If so, then we'll just close this out until there's something new or you get a rockin' great tracker!
bob |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|