Can't join two images using imagetoimage
Hello forum users!
Well I have spent a good portion of my weekend trying to get this VI to work and I am oficially out of ideas...
I'm using DataSockets to extract images from the web and I'm trying to join these two images using the ImageToImage function of IMAQ.
The images are extracted just fine but when I try to join them all I get is the first image!!!
What am I doing wrong????
My VI is attached.
Some test considerations:
To extract the images be sure to add [text] to the end of the html line
This VI only works with http and not https (DATASOCKET limitations)
Bruno Noronha
Certified LabVIEW Associate Developer
Using LabVIEW 8.6
Attachments:
Untitled 1.vi 42 KB
Sorry posted in the wrong area of the forum... I already reposted it in Machine Vision
Bruno Noronha
Certified LabVIEW Associate Developer
Using LabVIEW 8.6
Similar Messages
-
Getting a black image after joining two images
Hey Guys,
I have joined two images. In the joined image. i am getting the first image but the second one im getting as a black image. Can you please tell me what is the problem??
Below is the code:
w = inv*img[inv].getWidth(null) + img1.getWidth(null);
h = Math.max(img[inv].getHeight(null), img1.getHeight(null));
BufferedImage[] joinedImg = new BufferedImage[lnuInvoiceIndex];
Graphics2D[] g = new Graphics2D[lnuInvoiceIndex];
JPEGImageEncoder[] encoder=new JPEGImageEncoder[lnuInvoiceIndex];
for(int join=0;join<=lnuInvoiceIndex;join++){
joinedImg[join]=new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
g[join] = joinedImg[join].createGraphics();
g[join].drawImage((BufferedImage)thumbImage[inv], 0,0, null);
encoder[join] = JPEGCodec.createJPEGEncoder(response.getOutputStream());
encoder[join].encode((BufferedImage)joinedImg[join]);
}import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.swing.*;
public class JoinImages {
private JPanel getContent(BufferedImage[] images) {
JPanel panel = new JPanel(new BorderLayout());
panel.add(wrap(join(images, 4)), "Before");
panel.add(wrap(join(images, 1)), "Last");
panel.add(wrap(join(images, 2)));
return panel;
private BufferedImage join(BufferedImage[] images, int rows) {
int cols = images.length/rows;
// For all images having the same size.
int iw = images[0].getWidth();
int ih = images[0].getHeight();
int w = cols*iw;
int h = rows*ih;
int type = BufferedImage.TYPE_INT_RGB;
BufferedImage image = new BufferedImage(w, h, type);
Graphics2D g2 = image.createGraphics();
for(int j = 0, index = 0; j < rows; j++) {
for(int k = 0; k < cols; k++) {
int x = k*iw;
int y = j*ih;
g2.drawImage(images[index++], x, y, null);
g2.dispose();
return image;
private JLabel wrap(BufferedImage image) {
return new JLabel(new ImageIcon(image),
JLabel.CENTER);
public static void main(String[] args) throws IOException {
String[] ids = { "-c---", "--g--", "---h-", "----t" };
BufferedImage[] images = new BufferedImage[ids.length];
for(int j = 0; j < images.length; j++) {
String path = "images/geek/geek" + ids[j] + ".gif";
images[j] = javax.imageio.ImageIO.read(new File(path));
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(new JoinImages().getContent(images));
f.pack();
f.setLocation(200,200);
f.setVisible(true);
}Geek images from [Using Swing Components: Examples|http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html]. -
Hi Sir/ Madam,
My name is Rishav and I am facing some problem with my Photoshop CC. Actually I have a question. If you guys could help me out i will be very obliged. The quest in "Can you please help me by saying me how can i join two different picture to make it as one picture.??"Maybe you should post over at
Photoshop for Beginners
or start with the "Get Started" section of the Help:
Photoshop Help | Photoshop Help
And your question
Can you please help me by saying me how can i join two different picture to make it as one picture.??
does not seem particularly specific – do you want to simply combine two images as they are, do you want to clip elements from the one and insert them into the other, …?
Could you post (lores of) the images and explain what you intend to achieve? -
Can we join two totals tables in ABAP Query
Hey Gurus!
Can we join two totals tables in ABAP query.
I am tyring to join FAGFLEXT with internal orders totals table.
Thanks
SHi,
Report painter majorily operates around characteristics and key figures.
ABAP query comes even more handy. The advantage is -
1. You can link many tables
2. Create selection screen as you like to have
3. User friendly report creation
4. Logic can also be coded.
5. Authorization can be set
I have written a article in SDN, which gives you an idea as to how to go about using ABAP query. Have a look on this - [Article - Practical Usage of ABAP Query|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f6b256-23be-2b10-8b93-cad83a617634]
Regards,
Sridevi -
I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
[ABCTABLE]
ABCORDER
ABCPART
ABCSERIAL
ABCDATE
[ZYXTABLE]
XYZORDER
XYZPART
XYZSERIAL
XYZDATE1
XYZDATE2Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
on this computer. There are no "Null" fields in either of the tables.
This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
[MSORDR]
MSORDER
MSPART
MSSERIAL
MSOPNDATE
11111111
4444444
55555
2/4/2015
22222222
6666666
11111
1/6/2015
33333333
6666666
11111
3/5/2015
This table has one order for every part number and every serial number.
[GLORDR]
GLORDER
GLPART
GLSERIAL
GLSTARTDATE
GLENDDATE
ABC11111
444444
55555
1/2/2015
4/4/2015
ABC22222
666666
11111
1/5/2015
4/10/2015
AAA11111
555555
22222
3/2/2015
4/10/2015
Post Query table
GLORDER
MSORDER
GLSTARTDATE
GLENDDATE
MSOPNDATE
ABC11111
11111111
1/2/2015
4/4/2015
2/4/2015
ABC22222
22222222
1/5/2015
4/10/2015
1/6/2015
ABC22222
33333333
1/5/2015
4/10/2015
3/5/2015
This is the SQL minus the between date join.
SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART); -
Can I sort the images used in a book's browser by the # of times used?
I'm also producing a DVDSP slideshow of the event's (selected) photos not included in the book.
Q2: Can I sort the images used in a book's browser by the # of times used?
That way I don't have to search thru hundreds of photos. When used in a book, each photo gets a badge showing the # of times used. Can this badge be used in a sort?
Or must I apply a keyword to the used (or unused) photos?
Thanks.But if the file has been embedded, the file name is lost.
-
Can't Open Two images at same time
I can't have two images open at the same timer in PhotoShop CS4.
I open a file and it displays.
Then go to File, Open...menu and open a secomd file.
Result THe second image opens and the first image goes away. Both files are shown in the Window menu, but I can't get both to display at the same time..
I've the CS4 upgrade from CS3 Extended. INtel Mac Pro
I'm sure thjere is a simple answer to this problem. I've been trying to find an answer, but haven't seen this posted.
Yhanks
Hoagy99Have You tried disabling Application Frame and turning off Preferences – Interface – Open Documents as Tabs and Enable Floating Document Window Docking?
And please do a forum-search, because I seem to have come across this problem repeatedly. -
How can i join two libraries from two different users
how can i join two libraries from two different users in the same computer?
I should add that you can turn on SHARING where each user can see the other user's library and play stuff out of it. But they can not import those tracks to their own library or put them into their own playlists or burn CDs of the shared library.
Also note, to do this you need to have the fast switching option enabled with the accounts so both can be running at the same time and both must have iTunes running at the same time.
Patrick -
Why I can't subtract two images in imaq vision builder?
Hi,
I have many times tried but failed to get the objects in a image by subtraction with another image which is background, in imaq vision builder(ver. 6.0). I totally can't use the "operators" command under "greyscale" to subtract the two images becauee all commands under the "greyscale" are always unactivated after two images have been stored in 2 idfferent buffers. I really don't know why and this vision builder is so difficult to use, unbelievable! I followed the instructions in its Help and it's quite simple but I totally failed to make this operation!
Two samples of images have been attached and maybe it's very ease for you to filter out objects(fibers) by subtraction each other. Show me your scrip
t if you can. It's urgent to me.
Or the idea of the way I thought for filtering the objects is wrong? Point out please if you know.
Thanks and Merry Christmas and Happy New year!!
Swedlin
Attachments:
10Img0.jpg 27 KB
123Img0.jpg 25 KBOkay, this is not quite as straightforward as it could be, but you can do image subtraction in Vision Builder. The basic idea is as follows:
- select first object image and copy it to buffer 1
- select "image >> get new image" and load your background image from a file.
- put this in buffer 2
- retrieve object image from buffer 1
- perform subtraction. Even though these images appear to be greyscale, they are actually saved as 24-bit RGB images, so you need to use the color operators instead. Vision Builder will only allow you to select steps that are valid for the image you have loaded. You could extract the luminance plane from all of your images to work with 8-bit images if you like.
I have attached below a background image, several object i
mages, my script, and the results of batch processing. You will need to edit the "get new image" step with the correct path to the background image on your machine.
Bruce is right though. This is a bit easier in LabVIEW.
Regards,
Brent R.
Applications Engineer
National Instruments -
Joining two tables using PL/SQL
here i am trying to join two tables can any one tell me what is wrong with this syntex
CREATE OR REPLACE PROCEDURE test IS
CURSOR c1 IS SELECT seq,fname,lname from t1;
CURSOR c2 IS SELECT seq1,q,a from t2;
userjob number;
BEGIN
OPEN c1;
insert into t3 values(c1.seq,c1.fname,c1.lname);
FETCH c1.seq INTO userjob;
FOR c1rec IN c2 LOOP
IF (c1rec.seq=c1.seq and c1rec.q1='why') THEN
insert into t3 values(c1rec.q1,c1rec.a1);
elsif (c1rec.seq=c1.seq and c1rec.q1='what') then
insert into t3 values(c1rec.q2,c1rec.a2);
elsif (c1rec.seq=c1.seq and c1rec.q1='when') then
insert into t3 values(c1rec.q3,c1rec.a3);
elsif (c1rec.seq=c1.seq and c1rec.q1='where') then
insert into t3 values(c1rec.q4,c1rec.a4);
END IF;
END LOOP;
END;
/You should always fetch a cursor before using it's values. All columns in the select should be fetched into variables or a record-variable. You can't refer to the cursor-columns values with c1.seq etc.
r1 c1%rowtype;
l_found boolean;
BEGIN
OPEN c1;
FETCH c1 INTO r1;
insert into t3 values(r1.seq,r1.fname,r1.lname);
l_found := c1%found;
close c1;
if l_found
then
It is also better to close the cursor and check if the select resulted in a row. With this code you will only retrieve one row even if the select will result in multiple rows.
But I agree with all the others that this can probably be done more efficiently with one SQL statement. -
We have tried joining two DSO's and are getting the warning that "more than one datasource has been used in this report". It appears that the DSO driver does not support joins. The report runs but it is VERY slow, the same sort of performance you get when you try to join data from two datasources that are actually different (like two different SQL Server databases or an Oracle table joined to a SQL Server table). It appears that this is not a supported function with the DSO driver. Any thoughts?
Yes, we have created the joins between the two DSOs. We are looking into using the Open SQL driver to go against the base tables to see if that will work. This is how the original ODS driver used to work.
Update: After changing the join type to a left outer join the performance improved signficantly. Although not ideal it looks like it will be fine for our requirements. This particular report will be run monthly and scheduled to run overnight.
Edited by: Mike Garrett on Oct 27, 2009 4:28 PM -
Can't save an image used as link
After I updated my iPhone 3GS to iOS 5.0.1, I noticed I can no longer save images that are being used as links on websites. Using the usual method of holding my finger on these type of images, brings up the following options: "Open", "Open in New Page", and "Add to Reading List". It doesn't seem to have the option to save this type of images any more. (I can still save images that aren't being used as links just fine.)
Try doing a "Save As".
-
Can I link to images using absolute paths in HTML Help and still see them locally?
I'm publishing HTML help pages to a Web server. All .htm files on the Web server are in their own folder, and all image files are in a separate folder. Links to images are generally of the form <img src="/images/clear.png" height="14" width="8">. That is, the images use an absolute path reference from the doc root folder (rather than relative path from the current file folder, such as "../images/myImg.png").
I can modify the HTML for the images to follow this convention, but then I cannot see the images locally within RoboHelp, but must instead wait until the files are integrated with the Web server. Is there a way to set up a RoboHelp project so that I can force an image path of "/images" both locally and in the HTML?
Using RoboHelp 9.0.1.232.
Thanks.RoboHelp expects the images to be within the project and will need that if you are to see them when working. It then uploads them to the server when you publish. There is a check box when you publish so that only updated files get uploaded.
You could point Resource Manager to the server folder with the images and then link to those images. What happens then is the image gets downloaded into your project so that you see it when working. If the server image changes you will see the icon in Project Manager changes so that you can update the local copy. It would be a one-off exercise changing your workflow.
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge -
Hi Gurus,
I have three tables. I want to join all tables using union in SQL statement. The query is returning all the records from both tables but i only require unique rows based on a specific column value. Here is my table structure -
TableA -
LIC_ID NUMBER(10) NOT NULL
LIC_NUMBER VARCHAR2(20)
COMMENCE_DATE DATE
EXPIRY_DATE DATE
TERM VARCHAR2(20)LIC_ID is the primary key in this table -
Sample data from TableA
LIC_ID LIC_NUMBER COMMENCE_DATE EXPIRY_DATE TERM
2 TR4323 12/04/2008 11/03/2010 2 Years
34 TR5432 23/07/2009 22/07/2010 1 Year
45 TR5321 24/06/2009 23/06/2010 1 Year
65 TR6666 23/07/2010 22/07/2011 1 Year
32 TR2423 30/05/2010 29/05/2011 1 YearTableB -
MAR_ID NUMBER(10) NOT NULL
LIC_ID NUMBER(10) NOT NULL
ZONE_NAME VARCHAR2(20)
DEPARTMENT VARCHAR2(20)
ACTIVITIES VARCHAR2(200)
COMMENTS VARCHAR2(200)MAR_ID is the primary key in this table and LIC_ID is the foreign key on TableA
Sample data from TableB -
MAR_ID LIC_ID ZONE_NAME DEPARTMENT ACTIVITIES COMMENTS
23 2 ZONE A IT NONE
43 34 ZONE B IT NONE
33 65 ZONE C ACCOUNT NONE
TableC
REC_ID NUMBER(10) NOT NULL
LIC_ID NUMBER(10) NOT NULL
DIST_NAME VARCHAR2(20)
REGION VARCHAR2(20)
ACTIVITIES VARCHAR2(200)
COMMENTS VARCHAR2(200)REC_ID is the primary key in this table and LIC_ID is the foreign key.
Sample data -
REC_ID LIC_ID DIST_NAME REGION ACTIVITIES COMMENTS
2 45 SA NORTH NONE
3 65 TA NORTH NONE
5 32 NT SOUTH NONEHere is my sql query -
select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
TableA a, TableB b
where a.lic_id=b.lic_id
union
select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
TableA a, TableC c
where a.lic_id=c.lic_idThe above query returns -
lic_id lic_number commence_date expiry_date
2 TR4323 12/04/2008 11/03/2010
34 TR5432 23/07/2009 22/07/2010
45 TR5321 24/06/2009 23/06/2010
65 TR6666 23/07/2010 22/07/2011
32 TR2423 30/05/2010 29/05/2011
65 TR6666 23/07/2010 22/07/2011 LIC_ID 65 exists in both table TableB and TableC hence it repeats in query but I want to display that only once. How can I do that? I want to return unique record on LIC_NUMBER.
Hope this make sence.
Many thanks,
TajuddinThanks for all your reply and suggestions. David altering session did not work.
Sven your idea helped me to figure it out what to do. I found a way around to fix it. Here is my current code -
select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
TableA a, TableB b
where a.lic_id=b.lic_id
union
select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
TableA a, TableC c
where a.lic_id=c.lic_id and c.lic_id not in ( select lic_id from TableB)This will exclude any LIC_ID exists in TableB.
Thanks again for your help guys.
Regards,
M Tajuddin
Web: http://tajuddin.whitepagesbd.com
Blog: http://aspblog.whitepagesbd.com -
Can i download the images used in the adobe PSH 13 manual that accompanied the CD's
Can I download the images contained in the PSE 13 electronic manual
Thank you. I already figured it out by searching the whole internet
But there's a thing bugging me. I want to delete the log file in which all paths are stored because everytime I run the plugin I get duplicates of the paths.
So I thought of removing the existing log file before every time I use the plugin.
I tried LrTasks.execute("del %HOMEPATH%\\Documents\\photosPath.log"). But nothing happens. When I use my personal path then it works pretty well. But I want it to work on any computer....
Maybe you are looking for
-
Sun Java System Application Server8 can not startup (help me )
I work in an japanese compay in China. recently, my JSC can not work who can help me the error infomation is : The Sun Java System Application Server could not start: Possible reasons: 1.port conflict 2.Incorrect server configuartion 3.corrputed depl
-
MacBook Air: Will 802.11n Wi-Fi work in a 'remote' location.
Hello, could I seek some guidance from Macbook Air users? Brief Background: I live in a small town in Thailand some 320 kms south of Bangkok. This is not at the end of the world and technology is slowly catching up e.g. but no 3G here. There is Wifi
-
Separate CSS for IE and Firefox
Hi all, older versions of Robohelp generated to separate CSS files in the Wephelp for IE and Firefox. Evidently this feature was dropped somewhen. However I need it now to resolve some specific Firefox problems in a project. I thought I could add the
-
Cracking and hissing sounds on I tunes/I touch
Can CD's be played if purchased from other than the Itunes store? I have several new CD's purchased from Amazon way before I had my 4th generation ITouch. I've tried to convert it to the Apple extension while being downloaded from the CD to the Libra
-
Hello , Why some of the discounts are not included in the credit price field calculation VBRP-CMPRE? Is this customizing issue of the discount conditions? Thanks and Best regards L