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:
000 255 000
255 000 000
000 000 255
255 255 255
000 255 000
255 000 000
000 000 255
255 255 255
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?
2 Replies
JavaBot
JavaBot2w ago
This post has been reserved for your question.
Hey @Wannabree! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
JavaBot
JavaBot2w ago
Post Closed
This post has been closed by <@237269674654433282>.

Did you find this page helpful?