11-18-2021 09:30 AM
Hello,
I am trying to write a laser scanning imaging code and the front panel can show the image at each iteration. But when I save this scanned image to an png file, it is an black image. I guess it is because the average value of each pixel is below 1. How can I fix this issue when saving an grey image with pixel value range from 0~255? I did not find histogram function in my Labview-Vision&Motion panel.
Thank you very much
Yu
Solved! Go to Solution.
11-18-2021 11:22 AM
Hello,
In the process of normalize the array pixel value during 0~255, I add this code in my program. But once I add the calculation the system cannot save png image and shows error as attached. How can I fix this problem?
Thank you
Yu
11-18-2021 12:59 PM - edited 11-18-2021 01:05 PM
Hi Yu,
@Rhapsody16 wrote:
In the process of normalize the array pixel value during 0~255, I add this code in my program. But once I add the calculation the system cannot save png image and shows error as attached. How can I fix this problem?
Why do you scale the whole cluster you get from that FlattenPixmap function?
Why don't you scale your "raw" image data?
Why don't you notice those red coercion dots?
Why don't you attach the latest VI? We cannot debug/edit/run images with LabVIEW!
11-18-2021 02:45 PM
Dear GerdW,
Sorry for not attaching the old version and I have already reuploaded the 2012 version code.
I scale the whole cluster because I think it may not reduce the speed inside the loop. And I need to calculate the max and minimum values of whole image and scale them to 0~255 so I scale them outside the loop.
I noticed the red coercion dots after your mention. But I don't know what does it means and how to fix them.
Would you please help me about this?
Thank you very much
Best regards
Yu
11-18-2021 03:03 PM - edited 11-18-2021 03:05 PM
11-18-2021 03:37 PM
Hi, GerdW,
Thank you for the modified code.
I will try to save the image again in the lab tomorrow.
Thank you!
Best regards
Yu