LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan Line

Hi all,
I'm very new in this forum. I tried to search decision for my problem, but found nothing.


I want to divide a Picture / raster format (jpg, tiff, png, bmp, etc.) by cells by Rows and Columns. After that, I want to read an average value of Color information of any cell. I will receive a Data Matrix "A 1,1" - "A n,m", where n = number of Rows and m = number of Columns.

 

Meanwhile I want the info from every read cell to GENERATE to participate in generation of PWM Duty cycle out. 8 bit grayscale for now is enough. What I mean: When some cell is Black, the Duty cycle have to be 100 (or 255 🙂 ). When the cell is White, the Duty cycle have to be 0.

 

Why is all of this... I want to feed with this data a LED matrix, but not ALL LED's in the same time, just in serial LED by LED. Any time when I read a cell the corresponding LED have to light as brightly as is the color info.

 

Can any one help me with ideas?

 

Thank you in advance!

0 Kudos
Message 1 of 3
(2,524 Views)

Here's what you will want to do:

 

  1. Use the picture control VIs to read the image (they support all formats except TIF).
  2. Unflatten the pixmap to get the picture as a 2D array.
  3. Use Quotient and Remainder with the size of the array and your cell size to determine how many cells there are. Use a nested for loop to go over each cell and extract it from the array using Array Subset. Use the i value of the loop and multiply it by the cell size.
  4. For each subset, get its size, use Multiply Array Elements to count the number of elements and reshape it to a 1D array of that size, then use the Mean VI to get the average.
  5. If you want a straight translation from the color to a scale of 255, then divide the value by 65536.

You should find these functions in the picture control, array and numeric palettes.


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,509 Views)

Thank you VERY much !!!


0 Kudos
Message 3 of 3
(2,504 Views)