- #1
atie
- 3
- 0
hello,
i'm kinda new in this programming thingy so i hope you guys can help me.
i wanted to code a program that can identify whether a banana is ripe or not. basically, i have two image of banana; one yellow in color and another one is green. so I'm thinking about using AI technique (backpropagation maybe) to identify the banana ripeness.
i search for some article on how to do it and most of them start with loading the image and extract the rgb value. this is what I've done. its not much because i don't know what to do next. can anybody help?
import java.io.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
public class banana
{
public static void main(String [] args)throws Exception
{
//get image
File imageFile= new File("yellowbanana.jpg");
BufferedImage image = ImageIO.read(imageFile);
//if file not exist
if(!(imageFile.exists())){
System.out.println("File NOT exists");
System.exit(0);}
int w = image.getWidth();
int h = image.getHeight();
System.out.println("w=" + w + ", h=" + h);
next i should get the pixel of the image. is it correct?
i'm kinda new in this programming thingy so i hope you guys can help me.
i wanted to code a program that can identify whether a banana is ripe or not. basically, i have two image of banana; one yellow in color and another one is green. so I'm thinking about using AI technique (backpropagation maybe) to identify the banana ripeness.
i search for some article on how to do it and most of them start with loading the image and extract the rgb value. this is what I've done. its not much because i don't know what to do next. can anybody help?
import java.io.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
public class banana
{
public static void main(String [] args)throws Exception
{
//get image
File imageFile= new File("yellowbanana.jpg");
BufferedImage image = ImageIO.read(imageFile);
//if file not exist
if(!(imageFile.exists())){
System.out.println("File NOT exists");
System.exit(0);}
int w = image.getWidth();
int h = image.getHeight();
System.out.println("w=" + w + ", h=" + h);
next i should get the pixel of the image. is it correct?