Ann Lozich https://annlozich.knight.domains Just another WordPress site Tue, 25 Apr 2023 04:53:27 +0000 en hourly 1 https://wordpress.org/?v=6.2 Just What I Needed https://annlozich.knight.domains/blog/just-what-i-needed/ https://annlozich.knight.domains/blog/just-what-i-needed/#respond Tue, 25 Apr 2023 04:52:23 +0000 https://annlozich.knight.domains/?p=96

Hi everyone! I’m excited to share with you all a couple updates!

First, I moved from circles to squares. I think the square’s edges make it more apparent what areas a user was looking at.

Second, the user has the option of displaying a visual gaze during the trial. This was meant to prevent the user being distracted of the red circle where their gaze would be.

Third, the user can now select images of any height and width. If the image size is larger than what the screen can handle, the application reduces the size of the image to fit the screen. Here’s if you’re curious to see what it looks like:

// McVey's suggested code
if (img.Height > this.ClientSize.Height || img.Width > this.ClientSize.Width) // If the height or width of the image is larger than the screen
            {
                int newHeight = 0;
                int newWidth = 0;

                if(img.Height > this.ClientSize.Height && img.Width > this.ClientSize.Width) // If both height and width are bigger than the screen
                {
                    newHeight = this.ClientSize.Height;
                    newWidth = (img.Width * this.ClientSize.Height) / img.Height;

                    if (newWidth > this.ClientSize.Width) // If width is still bigger than the screen
                    {
                        newWidth = this.ClientSize.Width;
                        newHeight = (img.Height * this.ClientSize.Width) / img.Width;
                    }
                }
                else if(img.Width > this.ClientSize.Width) // If width is larger than the screen
                {
                    newWidth = this.ClientSize.Width;
                    newHeight = (img.Height * this.ClientSize.Width) / img.Width;
                }
                else                                       // If height is larger than the screen
                {
                    newHeight = this.ClientSize.Height;
                    newWidth = (img.Width * this.ClientSize.Height) / img.Height;
                }
                Bitmap resizedBmp = new Bitmap(img, newWidth, newHeight);
                img = resizedBmp;
            }

It’s basically calculating the right proportions so I know what to reduce the size of the image to. Thank you to McVey for helping debug this.

Tomorrow, I’ll share how I improved the accuracy of my collection and the algorithm used to determine the color of each square.

Thanks for reading!

]]>
https://annlozich.knight.domains/blog/just-what-i-needed/feed/ 0
Yellow Submarine https://annlozich.knight.domains/blog/yellow-submarine/ https://annlozich.knight.domains/blog/yellow-submarine/#respond Tue, 11 Apr 2023 03:49:49 +0000 https://annlozich.knight.domains/?p=91

This is what I was doing on the car ride home from Easter. It’s for the colors of my heatmap. It takes white and starts decreasing the blue and then the green to make red eventually. So this heatmap will look like a scale from white to yellow to orange to red. I’m really excited to implement it this week to see how it will look.

I will say, I did try to convert the ARGB value to the int32 value. For example, white is -1 and red is -65536. I thought I would be making it easy for myself if I just decreased that value, but I didn’t think too hard about it. What that ends up looking like is from white to yellow to white to yellow over and over again until it gets to red. The BLUE decreases from 255 to 0, and then decreases the GREEN by 1 each time.

We’re close to the finishing line!

]]>
https://annlozich.knight.domains/blog/yellow-submarine/feed/ 0
Paint It Black (or Red) https://annlozich.knight.domains/blog/paint-it-black-or-red/ https://annlozich.knight.domains/blog/paint-it-black-or-red/#respond Mon, 03 Apr 2023 21:41:16 +0000 https://annlozich.knight.domains/?p=88 It’s been a bit of a struggle mapping the screen coordinates to the image coordinates. What the tracker actually sends me is the screen coordinates from a (0-1) scale. For example, the middle of the screen would be (0.5, 0.5). Then I have to convert those coordinates based on the resolution of the screen. Then I have to convert those coordinates to the pixels of the image. It’s a bit more complicated considering the taskbar and the bar at the top of the form.

On the other hand, the program divides the coordinates into sections of the screen. For instance, if a picture was divided into a 2×2 grid, the points would be divided into one of those four sections.

Here, I was looking everywhere except the bottom-left corner. If you can see, the bottom-right circle is more intense than the others. That is because I looked more in that spot than the others.

Meanwhile, I’m going to do some math. Wish me luck.

]]>
https://annlozich.knight.domains/blog/paint-it-black-or-red/feed/ 0
Can’t You See https://annlozich.knight.domains/blog/cant-you-see/ https://annlozich.knight.domains/blog/cant-you-see/#respond Tue, 21 Mar 2023 03:45:38 +0000 https://annlozich.knight.domains/?p=83

Can’t you see! The red circle that tracks your gaze!

This took me way too long to figure out, and I hope no one has to deal with Drawing ever again. But yes, my first mistake was drawing circles wherever the user looked. With that, the trial image would disappear and a trail of red circles would appear. I couldn’t figure out how to make it appear as if a circle was moving.

Then I came to a revelation that I don’t need to draw anything. I can just put a PictureBox of a circle on the Form and then move it wherever the user looks. However, that left behind a trail of the old PictureBox’s location which is called a “ghosting” effect. This was a quick fix of setting the form’s DoubleBuffer property to true. This video is the fruitful result of a long and perilous undertaking. I hope you enjoy.

]]>
https://annlozich.knight.domains/blog/cant-you-see/feed/ 0
Life’s Been Good https://annlozich.knight.domains/blog/lifes-been-good/ https://annlozich.knight.domains/blog/lifes-been-good/#respond Fri, 03 Mar 2023 18:27:26 +0000 https://annlozich.knight.domains/?p=79 We beat the Stream Engine. We figured it out!

Our main issue was hooking up the dynamic-link library to my project. After some forum scraping and soul-searching, we found out someone had the same issue as us. They told us to not listen to Tobii and set the platform to x86. And it worked!

And then it didn’t.

result = Interop.tobii_device_create(apiContext, urls[0], Interop.tobii_field_of_use_t.TOBII_FIELD_OF_USE_STORE_OR_TRANSFER_FALSE, out deviceContext);
Debug.Assert(result == tobii_error_t.TOBII_ERROR_NO_ERROR);

Above is code provided by Tobii for a simple C# application. tobii_device_create creates a device instance to be used for communicating with a specific device. The third parameter of this function is how the device will be used. TOBII_FIELD_OF_USE_STORE_OR_TRANSFER_FALSE was not initially a valid enumerator, so we had to change it to TOBII_FIELD_OF_USE_INTERACTIVE.

result = Interop.tobii_device_create(apiContext, urls[0], Interop.tobii_field_of_use_t.TOBII_FIELD_OF_USE_INTERACTIVE, out deviceContext);
Debug.Assert(result == tobii_error_t.TOBII_ERROR_NO_ERROR);

Dr. Diederich and Dr. McVey were extremely helpful in debugging this whole Tobii situation. Figuring it out was a joyous moment for all of us.

Next on my agenda is figuring out where the user is looking during the trial. I want to visualize where the user is looking during the trial so I know that the tracker isn’t being wonky. I’m playing around with the Graphics class for now.

Happy Friday!

]]>
https://annlozich.knight.domains/blog/lifes-been-good/feed/ 0
Who’ll Stop the Rain https://annlozich.knight.domains/blog/wholl-stop-the-rain/ https://annlozich.knight.domains/blog/wholl-stop-the-rain/#respond Tue, 28 Feb 2023 03:41:51 +0000 https://annlozich.knight.domains/?p=76 Just kidding. I’m stuck.

This Tobii stuff was a lot harder than I expected. I’m running into loads of bugs. However, I know the best way to manage a situation like this is to step away for a bit. I plan on meeting with Dr Diederich, but in the meantime, I’ll ask my friends to help with debugging.

This is a short entry, so I plan on making another one this week to let you guys know how it’s going.

]]>
https://annlozich.knight.domains/blog/wholl-stop-the-rain/feed/ 0
Some Kind of Wonderful https://annlozich.knight.domains/blog/some-kind-of-wonderful/ https://annlozich.knight.domains/blog/some-kind-of-wonderful/#respond Tue, 21 Feb 2023 21:08:18 +0000 https://annlozich.knight.domains/?p=69 I have super duper awesome great news!

I have the Stream Engine now! I won’t say how because I don’t want to get in trouble with the big wigs at Tobii. I managed to integrate the engine into my project so I can start working on all that fun eye tracker stuff.

What’s even better is that I have a user interface to work with. From the start menu, the user can now choose an image from their files and start a trial. After the trial, they will then be redirected back to the start menu to begin another trial.

However, I still need to implement a way to prevent users from starting a trial without an image selected.

I was going for a very minimalist look. This is not a finished product, but I was looking for the application to be bright and simple. Part of my UX philosophy is to use as few words as possible. However, I tested on some friends and they were like “What do I do?” So I think I need some more work on the design.

My next steps are going to be playing around with this eye tracker. I have a lot of resources at my disposable which I’m incredibly grateful for.

]]>
https://annlozich.knight.domains/blog/some-kind-of-wonderful/feed/ 0
The Game Plan https://annlozich.knight.domains/blog/the-game-plan/ https://annlozich.knight.domains/blog/the-game-plan/#respond Tue, 14 Feb 2023 04:51:22 +0000 https://annlozich.knight.domains/?p=60 From my understanding, I need the Tobii Stream Engine SDK to use the Tobii Eye Tracker 5. That wouldn’t be a problem unless I had access to it. You have to request to download it. Dr. Diederich and I have run into some issues regarding that, but I can work on other stuff in the meantime.

Here’s The Game Plan:

I tried to be as pessimistic as I could with the amount of time I would need for each task.

Some bad news regarding Eye Tracker is that it is only supported on Windows. I was hoping the application would be available for use on multiple platforms. That’s okay.

According to my Game Plan, I should start working on the user interface.

I’ll report back next week with how it looks!

]]>
https://annlozich.knight.domains/blog/the-game-plan/feed/ 0
Break It Down https://annlozich.knight.domains/blog/break-it-down/ https://annlozich.knight.domains/blog/break-it-down/#respond Wed, 08 Feb 2023 22:21:17 +0000 https://annlozich.knight.domains/?p=49 Now here’s the tough part. The design.

With some time to think, I’ve deliberated in what I hope for the final product to look like.

A

The user runs the application and the start menu appears. The user selects an image for the user to look at during the trial.

B

After selection, the start menu disappears from view and the trial begins. The user looks at the image for a minute while the application tracks the user’s eye movements on the image.

C

To be decided. The application will either return a video of the eye tracking movements of the image or a heat-map image.

D

The user can now choose whether to download the video/image or to discard it.

E

If the user chooses to download, a file explorer will prompt the user to select where to download the video/image.

After either downloading or discarding, the user will be sent back to the start menu either to use the same image again, or to select a different image for the next trial.

For now, this is the game plan. I’m definitely not married to anything just yet, but any thoughts or considerations would be greatly appreciated.

A piece of history from the office of Dr. Diederich.
]]>
https://annlozich.knight.domains/blog/break-it-down/feed/ 0
New Year, New Project https://annlozich.knight.domains/blog/new-year-new-project/ https://annlozich.knight.domains/blog/new-year-new-project/#respond Mon, 30 Jan 2023 21:48:47 +0000 https://annlozich.knight.domains/?p=18 I’m incredibly excited to announce the new application I’ll be developing for the next few months. My application will help psychological researchers to study cognitive processes by producing metrics based on participant eye movements. The Tobii Eye Tracker 5 will be the main device used for the application. It’s a camera with the added ability to return coordinates of where a participant is looking at. As of now, I have downloaded the Tobii Pro SDK and plan to use .NET for the application. To me, I find .NET makes it easier to build software, and I have experience making applications with .NET. I will continue to write blog posts weekly, so stay tuned for updates!

]]>
https://annlozich.knight.domains/blog/new-year-new-project/feed/ 0