From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-06-2016 10:54 AM
Hello,
As a test set up I have created a BMP image, which I then decompose and then want to reconstruct.
Decomposition:
Into 1D array, 30pixels at a time, row by row (180 pixel wide image = 6 iterations) as can be seen in the first while loop of the image.
Hence first 30 elements of the 1D array will be pixels 0,0 - 0,29, next thirty will be 1,0-1,29 etc.
I then attempt to reconstruct the image, and it looks like it works except for the last row of 30 pixels where the image does WEIRD stuff, it looks skewed...
I have attached both my labview code, and picture of the reconstructed image.
The decomposition is a little confusing and if necessary I can provide a picture description.
Thank you.
Solved! Go to Solution.
06-06-2016 11:08 AM - edited 06-06-2016 11:14 AM
algoballer wrote:I have attached both my labview code, and picture of the reconstructed image.
No, you have not! A picture of LabVIEW code is not LabVIEW code.
Please attach the actual VI and the image you are processing.
(Your code image show quite a few very (very!) questionable constructs that make no sense whatsoever. e.g. use while loops as for loops, reshape...build...concatenate tunnel, overuse of insert into and delete from array. etc.etc.).
06-06-2016 11:26 AM - edited 06-06-2016 11:26 AM
I have attached the labview VI, the picture however is a .bmp format so I can't attach it. I have attached it as a .png.
Thank you.
06-06-2016 12:54 PM
Just to clear thing up: while loops instead of for are a personal preference. The reshape array and everything on the "left half" of the VI is for the decomposition of the 2D array into an appropriate 1D array format. This part will be done by the FPGA, I'm just doing it for testing purposes.
The "right half" is reconstruction back into the 2D array.
06-06-2016 01:06 PM
Your PNG does not contain a color ramp, thus the outputs are blank. Can you zip the actual bmp file instead?
06-06-2016 01:32 PM - edited 06-06-2016 01:33 PM
Attached zip .bmp file. The file is Black and white intentionally.
06-06-2016 01:47 PM
Just as an update, I fixed the problem it was silly. But if you have any suggestion on how to do the "reconstruction" more efficiently I would really appreciate the help.
06-06-2016 02:07 PM
Yes, your bug was in the first loop. Here's what I would do instead.
(I modified so it works on the png and without the color map). There are quite a few things that can still be improved, but this should get you started.
I think the use of "insert into array" in your last loop is incorrect, because it pushes the initialized array elements over, making the result twice the size. Replace array subset seems more correct, keeping the array at the initialized size.
06-06-2016 03:28 PM
Thank you for your help, did not know how to use those functions before!