tim charles

Greenhorn
+ Follow
since Oct 09, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by tim charles

Hi,

Does anyone know of a good Java implementation of the k-means image segmentation technique? Preferably based around RGB color of pixel rather than pixel intensity.

Regards
Tim
14 years ago
What would be the most efficient way to grab a number of random pixels (RGB value) from a BufferedImage. Preferably equidistant from each other.
14 years ago
java.awt.Rectangle[x=0,y=0,width=991,height=536]

Which is far larger than the JPanel (jpModel) itself. I have no idea why its doing this
14 years ago
Has anyone got an idea to why the following is capturing my entire screen rather than just what's inside the bounds of jpModel?




Regards
Tim
14 years ago
Hi,

The following code is working fine in windows xp:



which would be something like this with all the variables filled in:

cmd.exe /c cd C:\Users\Tim\Documents\My Dropbox\Dissertation\Source\Image2Model\photoPopup\src && photoPopupIjcv.exe ../data/ijcvClassifier ../images/image0.jpg pnm ../results



executeApp method is as follows:




I have recently upgraded to windows 7 and the above command has stopped working. Any ideas? Is it something to do with the way windows 7 handles cmd.exe?

Regards
Tim
14 years ago
Hi,

I'm not sure what you mean by

Counter on the "value" side of the Map

? Could you show me what you mean in code?

Tim
14 years ago
Hi,

Right I've managed to create a map containing all the RGB colors of an image using:



This creates a map as follows:



Id like to be able to pick out and store the n (based on a variable) most common colors from this map into an array. Not quite sure how I would go about doing this?

Thanks
Tim
14 years ago
Campbell Ritchie: I'm not really sure what you mean? Could you give me some code example?
14 years ago
Ok name has been changed. Any ideas on my question?

Thanks
Tim
14 years ago
Hi,

I have a vector that is storing the RGB values of each pixel of an image. I would like to search the vector to find the most common number (RGB value), actually to find the n (based on a variable) most common numbers.

Any ideas on how I would go about doing this?

Regards
Tim
14 years ago
Hi,

Does anyone know how would I go about creating a JProgressBar that displays when the following method starts and finishes when the method finishes.



14 years ago
Hi,

The follow method is run when a button in my program is clicked. The first time it is run it changes the icons on some JLabels ok, but if I run it a second time it doesn't seem to change the icon. Everything else in the method is working correctly. I have highlighted the code not working in bold. Any ideas?

Cheers
Tim

private void jbConvertActionPerformed(java.awt.event.ActionEvent evt) {

///////////////////////////////////////LOCAL VARIABLES//////////////////////////////////////////

//JPEG output directory filename
String jpgURL = System.getProperty("user.dir") + "\\photoPopup\\images\\image.jpg";
//PPM output directory filename
String ppmURL = System.getProperty("user.dir") + "\\photoPopup\\images\\image.ppm";
//PNM (Superpixel) output directory filename
String superpixelURL = System.getProperty("user.dir") + "\\photoPopup\\images\\image.pnm";
//JPEG (Superpixel) output directory filename
String superjpgURL = System.getProperty("user.dir") + "\\photoPopup\\images\\super.jpg";
//Labeled image directory filename
String labeledImageURL = System.getProperty("user.dir") + "\\photoPopup\\results\\image.l.jpg";
//Segment Algorithm application directory
String segmentURL = System.getProperty("user.dir") + "\\segment";
//Automatic PhotoPopup application directory
String photoPopupURL = System.getProperty("user.dir") + "\\photoPopup\\src";

/////////////////////////////////////////////////////////////////////////////////////////////////

System.out.println("---IMAGE CONVERSION STARTED---");
jtaLog.append("\n---IMAGE CONVERSION STARTED---\n");

//Convert input image to JPEG format for photoPopup
convertImage("jpg", jpgURL, inputImage, "Input Image");

//Convert input image to ppm format for image segementation
convertImage("ppm", ppmURL, inputImage, "Input Image");

//Execute Segmentation Application
executeApp("cmd.exe /c cd " + segmentURL + " && segment.exe 0.8 100 100 ../photoPopup/images/image.ppm ../photoPopup/images/image.pnm", "Image Segmentation");

//Put superpixel image into BufferedImage
try{
superpixelImage = ImageIO.read( new File(superpixelURL));
System.out.println("Superpixel Image Successfully Loaded");
jtaLog.append("Superpixel Image Successfully Loaded\n");
}catch (IOException e) {
System.out.println("ERROR: Unable to Load Superpixel Image");
jtaLog.append("ERROR: Unable to Load Superpixel Image\n");
}//end catch

//Convert superpixel PNM image to JPEG, so it can be displayed in JLabel
convertImage("jpg", superjpgURL, superpixelImage, "Superpixel Image");

//Execute Automatic Photo Popup Application
executeApp("cmd.exe /c cd " + photoPopupURL + " && photoPopup.exe ./classifiers_08_22_2005 ../images/image.jpg pnm ../results", "3D VRML Model Construction");

//Put labeled image into BufferedImage
try {
labeledImage = ImageIO.read( new File(labeledImageURL));
System.out.println("Labeled Image Successfully Loaded");
jtaLog.append("Labeled Image Successfully Loaded\n");
} catch (IOException e) {
System.out.println("ERROR: Unable to Load Labeled Image");
jtaLog.append("ERROR: Unable to Load Labeled Image\n");
}

//Display VRML model in "3D Model" tab
createModelViewer();

//Enable Image/Model Viewer Tabs
jTabbedPane.setEnabled(true);
System.out.println("---IMAGE CONVERSION FINISHED---");
jtaLog.append("---IMAGE CONVERSION FINISHED---\n\n");

//Display labelled image in "Labelled Image" tab
jlLabeledImage.setIcon(new ImageIcon(labeledImageURL));
//Display superpixel image in "Superpixel Image" tab
jlSuperpixel.setIcon(new ImageIcon(superjpgURL));


//Enable Save Menu Items
jmiSaveSuperpixel.setEnabled(true);
jmiSaveLabeled.setEnabled(true);
jmiSaveModel.setEnabled(true);
//Disable Convert Button
jbConvert.setEnabled(false);
}
14 years ago