Recently, I've been interested in machine learning more specifically, machine learning with images, but to do that, I need to be able to process images. I want to have a more thorough understanding of how image processing libraries work along the way, so I have decided to make my own library for reading images that I can understand. However, I seem to have an issue when it comes to reading the SIZE of an image, as this error pops up when I try to compile:
./imageProcessing.go:33:11: non-constant array bound Size
This is my code:
package main
import (
// "fmt"
// "os"
)
// This function reads a dimension of an image you would use it like readImageDimension("IMAGENAME.PNG", "HEIGHT")
func readImageDimension(path string, which string) int{
var dimensionyes int
if(which == "" || which == " "){
panic ("You have not entered which dimension you want to have.")
} else if (which == "Height" || which == "HEIGHT" || which == "height" || which == "h" || which =="H"){
//TODO: Insert code for reading the Height of the image
return dimensionyes
} else if (which == "Width" || which == "WIDTH" || which == "width" || which == "w" || which =="W"){
//TODO: Insert code for reading the Width of the image
return dimensionyes
} else {
panic("Dimension type not recognized.")
}
}
func addImage(path string, image string, Height int, Width int){
var Size int
Size = Width * Height
var Pix [Size][3]int
}
func main() {
}
I'm just beginning programming with Go, so I'm sorry if this question sounds nooby