jcarmody Posted January 24, 2017 Report Share Posted January 24, 2017 I asked a question on the NI site about an odd difference in images in software that I inherited - http://forums.ni.com/t5/Machine-Vision/What-s-wrong-with-this-image/m-p/3573561#U3573561 I get different images in two versions of a software my predecessor wrote, but I can't get the source code to make my desired image (the first one). I've attached the Vision Acquisition Express VI that is used in the software on my NI post. Can you tell me the difference and how I can get the nicer image? Quote Link to comment
Tim_S Posted January 24, 2017 Report Share Posted January 24, 2017 Hrm... It looks almost like there is a threshold on the second image. I'm wondering if you have the same lighting and camera settings? Lighting has been the bane of many vision systems. Quote Link to comment
jcarmody Posted January 24, 2017 Author Report Share Posted January 24, 2017 The lighting & focus are the same. I expect that the camera settings are different, but I don't know what to look for. I can LabVIEW well enough, but I've never visioned. Quote Link to comment
CraigC Posted January 24, 2017 Report Share Posted January 24, 2017 (edited) Often in vision if a picture is analysed then the original is overwritten / destroyed. Is it just a case of taking the image reference before the processing and then overlaying the analysis result onto the original Image. Difficult to explain and I do not have the vision toolit to hand. You often have to copy the original image and use one copy for image processing, then overlay the results onto the original Image, not the processed one. Edited January 24, 2017 by CraigC 1 Quote Link to comment
ShaunR Posted January 24, 2017 Report Share Posted January 24, 2017 Looks like the second one has a clustering threshold (AutoBTThreshold) Quote Link to comment
jacobson Posted January 24, 2017 Report Share Posted January 24, 2017 I agree with everyone else that the second image looks like a binary image. If this is just coming straight out of the acquisition assistant express VI it might just be how the image indicator is configured to view what's being passed to it. I would try right clicking the image indicator and changing what is selected under the palette options if it is currently set to one of the binary options. If you're working in the vision assistant you'll have to select the color drop down up top to get the same options. Either way, I would suggest hovering over the images which should tell you the pixel values at the bottom of your window. That will let you know if something in the acquisition has changed or if it is just displaying the images differently for whatever reason. Quote Link to comment
shoneill Posted January 26, 2017 Report Share Posted January 26, 2017 IIRC most cameras have different acquisition modes (mono, 4-bit, 8-bit and speed and so on) but the properties needed to be set are different per camera. You can query the modes available via the IMAQ driver and find the one you need, note the index of the mode and then set that mode. Note that this may be different for each camera type and your predecessor may have set it in code or in MAX. Quote Link to comment
ShaunR Posted January 26, 2017 Report Share Posted January 26, 2017 (edited) No-one has stated categorically, so... The first image is a raw, unadulterated image of the part under inspection with a rake overlaid. Whilst you can take measurements that way, it is very lighting and part specular dependant. To make more repeatable measurements you post process (threshold in this case) to remove noise and make features more defined. The result is a binary image. You then apply the rake to the post-processed image (second of your images). None of this is camera dependant so changing camera properties does not yield the second image unless it is a smart camera with post-processing (threshold) on board. So how would you create the first image? Two ways: 1. Acquire an image and use the Horizontal Clamp to to make your measurement (it will add the rake overlay). 2. Acquire an image. Make a copy (using the IMAQ Copy Image primitive) then apply a threshold to the copy (there are a couple, one of which I gave earlier) . Next, use the Horizontal Clamp on the copy then copy the Overlay (IMAQ Copy Overlay) onto the original image. This will give you the measurement repeatability of the second image with an output of the first. Note that operations on IMAQ images are destructive so if you want to keep an image after processing you must make a copy of it before the processing. Edited January 26, 2017 by ShaunR 1 Quote Link to comment
shoneill Posted January 26, 2017 Report Share Posted January 26, 2017 Shaun makes a good point. I remember doing that decades ago when there was no RGB processing available. I did some processing on a mono version of an image but overlayed on a copy of the colour original. Imemdiately my boss asked me "How on earth did you manage to do that" because he assumed I had done the processing on the RGB image. He was kind of surprised to hear of what I did. The human brain automatically correlates the data visible (picture and results) to be a coherent pair even when they are not. I mean, Trump and President. Come on. <\joke> Quote Link to comment
Jordan Kuehn Posted January 26, 2017 Report Share Posted January 26, 2017 On 1/24/2017 at 10:12 AM, CraigC said: Often in vision if a picture is analysed then the original is overwritten / destroyed. Is it just a case of taking the image reference before the processing and then overlaying the analysis result onto the original Image. Difficult to explain and I do not have the vision toolit to hand. You often have to copy the original image and use one copy for image processing, then overlay the results onto the original Image, not the processed one. This should be a bold pop-up for the first 10 times anyone drops a vision VI. Image wires are references. 1 Quote Link to comment
jcarmody Posted March 16, 2017 Author Report Share Posted March 16, 2017 (edited) On 1/24/2017 at 11:12 AM, CraigC said: Often in vision if a picture is analysed then the original is overwritten / destroyed. Is it just a case of taking the image reference before the processing and then overlaying the analysis result onto the original Image. Difficult to explain and I do not have the vision toolit to hand. You often have to copy the original image and use one copy for image processing, then overlay the results onto the original Image, not the processed one. This is what solved the issue, I just missed the significance of what you & ShaunR said until after taking an NI Machine Vision course last month. I still need to overlay the processing parts, but the big nut has been cracked. Thank you. Edited March 16, 2017 by jcarmody Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.