Wannabree
JCHJava Community | Help. Code. Learn.
•Created by Wannabree on 4/13/2025 in #java-help
LUT get index from .txt file
Hello, beginner here. In class we're currently working with OpenCV for image manipulation.
We're asked to create a
LookUpTable
as a .txt
file and and change the color of some pixels in an image.
the .txt
file is something like this:
I know that I can use a Scanner to read the values etc. but let's assume i just want the value 255
from col3 row3. Is there a direct way to access that value or do it have to loop through each line/value until i get to that point?
I tried using FileReader
and BufferReader
but I haven't found way to read a specific value.
My inital idea was it to read every value in the LUT and create an array so i don't have to loop through the whole table to get a single entry but that kind of destroys the purpose of a LUT.
TL;DR is there a way to call a specific index from the LUT using only a .txt
file?4 replies
JCHJava Community | Help. Code. Learn.
•Created by Wannabree on 4/8/2025 in #java-help
Call method from different class in a different package (beginner)
Hello, i have the following Problem:
I have a class
Histogramm.java
inside a package Basis
And my Main.java
inside the package Main
Histogramm.java
has a function i want to call from Main.java
in my Main.java
file i have a a Matrix that i want to pass to the gibHistogrammDaten(Mat bildMatrix)
method.
I've been trying to call that method for a couple hours now.
I tried setting the method to static public static int[] gibHistogrammDaten(Mat bildMatrix)
which didn't work.
I also tried creating an object of Histogramm lel = new Histogramm();
to go the route of int[] histogramm = lel.gibHistogrammDaten(hilfeOne);
but that didn't work either.
Next try was
which just tells me "The method gibHistogrammDaten(Mat)
is undefined for the type Aufgaben02"
Pretty much every answer i've found on google didn't work.4 replies