Labview : numbering color box array - arrays

I have a color box array as below.
Now, I want to do numbering the array as below picture.
In order to do numbering, I just put texts on the array elements, manually.
I would like to do numbering automatically.
Can anyone give me a solution how to do numbering the array elements automatically?
Thank you in advance.

I would add 2D numerical array. Resize it to have a size of the color box, make it transparent and show there what I wanted.
Please download example code from my dropbox (LV 15): https://www.dropbox.com/s/wevy0sgqnhgvh8p/Example%20on%20color%20box.vi?dl=0
and LV11:
https://www.dropbox.com/s/zmrg66fai8cg3w6/Example%20on%20color%20box_11.vi?dl=0

I'd use a different approach.
1) Build a cluster containing both color box and a transparent number indicator
2) Put the cluster in a 2D array
Make a typedef of the cluster if you want.
In this way you can easily play with colors and numbers all around your program.

Related

Mail merge picture size using Gembox Document

I’m using the mailmerge feature of Gembox.Document to produce reports.
I’m having issues with the sizing of a picture.
I have created a merge field inside a table cell, and I would like the picture to occupy the maximum of the cell size without changing it’s aspect ratio.
For now it’s inserting the picture, but the ratio is all messed up.
I’ve read in the help page that I could put a shape my merge field but after many attempts I don’t know how to do it, when I try to draw the shape in my word template, it doesn’t go inside my merge field.
Can anybody help me with this ? Either to fix the aspect ratio, or how to use the shape…
Cheers
Take a look at the second Merge Pictures example, its input "MergePicturesWithTemplates.docx" file has MergeFields with Shapes inside.
To place a Shape inside a MergeField, draw the shape, set it as "In Line with Text", and drag it inside the field.
Now that you have a shape as a placeholder for your image, you can add switches to MergeField in order to keep the aspect ratio of the merged picture:
\x - resize resulting picture horizontally, keep the template shape's height.
\y - resize resulting picture vertically, keep the template shape's width.
\x \y - resize resulting picture either horizontally or vertically.
To add a switch, press ALT + F9 in MS Word, that will reveal field's code and then write the switch within.

How to change Construct 2 coloring pictures

I have to change pictures in a Construct 2 coloring game and i don't know how get it.
There are a some .png file that contain the old pictures:
This pictures are loaded and generated i don't know how by the data.js file that cut and put in each hole
Anybody could help me ? I'm very lost with this.
There is a solution to this problem.
https://www.construct.net/en/forum/construct-2/how-do-i-18/create-coloring-game-134338
And if you're too lazy to look at it, here it is.
*One way would be to prepare all the colorizable elements of your illustration -- the regions within the black lines -- as separate white sprites (PNGs), with the ReplaceColor effect applied. Then when the user clicks in a "color palette" sprite, store the clicked color value as a global value, and assign this to the ReplaceColor effect of any clicked illustration sprite.
Depending on the complexity of your illustration, it could be a fair amount of work to position all the illustration sprites in the appropriate positions in the layout, but it should work.
There may be other options that treat the problem more like paint fills, but I'm not aware of how to do this.* -netdzynr

Overlaying 2 or more shapes in a bitmap file created in C?

i was working on a program that will, depending on the input draw, shapes of different colors onto a bitmap file, it works fine if i just have to draw one shape, but if i for example take two or more shapes it just draws over the old picture and the old one gets lost but i need them to overlay to create more complex pictures. Is there a way when i am writing to a bitmap file to skip over parts i dont want to write over ? I also tryed making an array in which i would save all the pixel data, but that doesnt work if i take a bitmap of a size larger than 800x800, depending on the size of the type of the elements of the array. I am open for any suggestion and comment. Thank you in advance.
You need to draw the second shape using a transparent background, how you would do that is entirely up to you as you don't provide any information about what technology you are using.

how to correct a warped document?

I'm coding a software to dewarp an image.
Example : when you take a photo of a page of a book with a camera , the page is not well shaped like that:
there
So the first part of my program change the shape so the final shape is a rectangle (that almost works fine):
there
But my problem as you can see, is that at the edge of my photo the texte is smaller in the width that the texte at the middle of the image, so how what algorithm can I apply to correct that??
Thanks
From the way the text lines are morphed it seems that you are using a 2d mapping when in fact you should use 3d mapping.
See the additional reading part in http://www.vision.caltech.edu/savarese/main.htm especially the first one.

Masking image data using values generate from a histogram in OpenCV

Given a generated histogram that I got from an image I was wondering if there was any optimized way to generate a mask. Below I have added in 3 different images: the reference to use, the histogram data of the reference, and the main image that I would like to mask. I know that I could do this by each pixel and vary the color information by a certain percentage so that I would be able to get colors with lighting changes as well.
The basic idea is to find a color, given by the histogram data and within a certain range, and if it finds anything then to make it black. If it doesn't find anything then the color will be white.
Any advice would be greatly appreciated.
Reference image:
Histogram values:
Image to mask:
What you want is to mask a color in a certain range, this is what you should try with the code i posted here :
In my example, it is used to make it transparent, if you want to make it black, just skip the cvNot() step...
Making a color completely transparent in OpenCV
Hope it helped,
Julien
PS : i've just seen that you were the one who asked the question I answered about how to make a color transparent: the problem here is exactly the same... just adapt a lil bit the answer..
1) Convert your image RGB -> HSV : cvtColor()
2) Generate your histogram : calcHist()
3) Find the maximum in your Hue histogram : minMaxLoc()
4) Select thresholds around this maximum : your function
5) Use them to select only the color you want : inRange()
6) Put this mask in black : your function (a very simple way would be to remove all the RGB components on the mask) : your function
Try to use template matching approaches instead of histogram, for example, normalized cross correlation http://www.mathworks.com/products/demos/image/cross_correlation/imreg.html.

Resources